@pat-lewczuk/cezar 0.1.2 → 0.1.4

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.
Files changed (164) hide show
  1. package/README.md +249 -45
  2. package/dist/config.d.ts +8 -0
  3. package/dist/config.js +6 -0
  4. package/dist/config.js.map +1 -1
  5. package/dist/core/agent-runner.d.ts +44 -2
  6. package/dist/core/agent-runner.js +8 -2
  7. package/dist/core/agent-runner.js.map +1 -1
  8. package/dist/core/backend-detect.d.ts +6 -4
  9. package/dist/core/backend-detect.js +44 -4
  10. package/dist/core/backend-detect.js.map +1 -1
  11. package/dist/core/claude-cli-runner.d.ts +3 -25
  12. package/dist/core/claude-cli-runner.js +2 -19
  13. package/dist/core/claude-cli-runner.js.map +1 -1
  14. package/dist/core/claude-ui-mapper.d.ts +57 -0
  15. package/dist/core/claude-ui-mapper.js +370 -0
  16. package/dist/core/claude-ui-mapper.js.map +1 -0
  17. package/dist/core/codex-app-server-runner.d.ts +29 -0
  18. package/dist/core/codex-app-server-runner.js +452 -0
  19. package/dist/core/codex-app-server-runner.js.map +1 -0
  20. package/dist/core/codex-ui-mapper.d.ts +53 -0
  21. package/dist/core/codex-ui-mapper.js +411 -0
  22. package/dist/core/codex-ui-mapper.js.map +1 -0
  23. package/dist/core/ndjson.d.ts +6 -0
  24. package/dist/core/ndjson.js +23 -0
  25. package/dist/core/ndjson.js.map +1 -0
  26. package/dist/core/opencode-server-runner.d.ts +30 -0
  27. package/dist/core/opencode-server-runner.js +451 -0
  28. package/dist/core/opencode-server-runner.js.map +1 -0
  29. package/dist/core/opencode-ui-mapper.d.ts +105 -0
  30. package/dist/core/opencode-ui-mapper.js +578 -0
  31. package/dist/core/opencode-ui-mapper.js.map +1 -0
  32. package/dist/core/process-usage.d.ts +63 -0
  33. package/dist/core/process-usage.js +181 -0
  34. package/dist/core/process-usage.js.map +1 -0
  35. package/dist/core/runner-factory.d.ts +8 -0
  36. package/dist/core/runner-factory.js +22 -0
  37. package/dist/core/runner-factory.js.map +1 -0
  38. package/dist/core/tool-display.d.ts +27 -0
  39. package/dist/core/tool-display.js +150 -0
  40. package/dist/core/tool-display.js.map +1 -0
  41. package/dist/core/ui-events.d.ts +294 -0
  42. package/dist/core/ui-events.js +25 -0
  43. package/dist/core/ui-events.js.map +1 -0
  44. package/dist/index.js +0 -0
  45. package/dist/pack-check.d.ts +17 -0
  46. package/dist/pack-check.js +27 -0
  47. package/dist/pack-check.js.map +1 -0
  48. package/dist/planner.js +7 -3
  49. package/dist/planner.js.map +1 -1
  50. package/dist/runs/store.d.ts +5 -0
  51. package/dist/runs/store.js +3 -0
  52. package/dist/runs/store.js.map +1 -1
  53. package/dist/runs/title-summary.d.ts +15 -0
  54. package/dist/runs/title-summary.js +84 -0
  55. package/dist/runs/title-summary.js.map +1 -0
  56. package/dist/runs/ui-event-sink.d.ts +81 -0
  57. package/dist/runs/ui-event-sink.js +210 -0
  58. package/dist/runs/ui-event-sink.js.map +1 -0
  59. package/dist/server/capabilities.d.ts +18 -0
  60. package/dist/server/capabilities.js +23 -0
  61. package/dist/server/capabilities.js.map +1 -0
  62. package/dist/server/forge/github.d.ts +39 -0
  63. package/dist/server/forge/github.js +369 -0
  64. package/dist/server/forge/github.js.map +1 -0
  65. package/dist/server/forge/index.d.ts +24 -0
  66. package/dist/server/forge/index.js +45 -0
  67. package/dist/server/forge/index.js.map +1 -0
  68. package/dist/server/forge/types.d.ts +80 -0
  69. package/dist/server/forge/types.js +2 -0
  70. package/dist/server/forge/types.js.map +1 -0
  71. package/dist/server/git-changes.d.ts +182 -0
  72. package/dist/server/git-changes.js +424 -0
  73. package/dist/server/git-changes.js.map +1 -0
  74. package/dist/server/open-in-app.d.ts +19 -0
  75. package/dist/server/open-in-app.js +134 -0
  76. package/dist/server/open-in-app.js.map +1 -0
  77. package/dist/server/server.js +34 -10
  78. package/dist/server/server.js.map +1 -1
  79. package/dist/server/static-ui.d.ts +49 -0
  80. package/dist/server/static-ui.js +92 -0
  81. package/dist/server/static-ui.js.map +1 -0
  82. package/dist/update-check.d.ts +12 -0
  83. package/dist/update-check.js +41 -0
  84. package/dist/update-check.js.map +1 -0
  85. package/dist/workflows/run.d.ts +3 -0
  86. package/dist/workflows/run.js +22 -7
  87. package/dist/workflows/run.js.map +1 -1
  88. package/dist/workflows/types.d.ts +16 -0
  89. package/dist/workflows/types.js +3 -1
  90. package/dist/workflows/types.js.map +1 -1
  91. package/package.json +1 -1
  92. package/web/app/node_modules/.vite/vitest/ca84d1343b96baa8137c943ed1860e522cacb238/results.json +1 -0
  93. package/web/app/src/components/app-shell-container.tsx +76 -0
  94. package/web/app.js +145 -18
  95. package/web/dist/assets/arrow-left-BE957rJs.js +1 -0
  96. package/web/dist/assets/bundle-mjs-DLPpRFyl.js +1 -0
  97. package/web/dist/assets/chunk-BO2N2NFS-f5igTtpB.js +131 -0
  98. package/web/dist/assets/compare-variants-D6fPL9cS.js +1 -0
  99. package/web/dist/assets/core-BuMqAF_1.js +12 -0
  100. package/web/dist/assets/css-BsVw1vtW.js +1 -0
  101. package/web/dist/assets/dialog-BEgEWFDS.js +1 -0
  102. package/web/dist/assets/diff-view-CctnJHWe.js +4 -0
  103. package/web/dist/assets/diff-woXpYk--.js +1 -0
  104. package/web/dist/assets/dist-CW7M_Jhs.js +1 -0
  105. package/web/dist/assets/ellipsis-vertical-DJPAfccS.js +1 -0
  106. package/web/dist/assets/engine-javascript-FQvzRocB.js +141 -0
  107. package/web/dist/assets/folder-RbRLfIX-.js +1 -0
  108. package/web/dist/assets/git-pull-request-DJkAMT0f.js +1 -0
  109. package/web/dist/assets/git-toolbar-D8OPPqBP.js +1 -0
  110. package/web/dist/assets/github-BYIHwIJB.js +1 -0
  111. package/web/dist/assets/go-rLFTqkRN.js +1 -0
  112. package/web/dist/assets/highlighted-body-OFNGDK62-DGHHie_q.js +1 -0
  113. package/web/dist/assets/highlighter-BKVEsACy.js +3 -0
  114. package/web/dist/assets/html-BY76lXLH.js +1 -0
  115. package/web/dist/assets/index-9qG98Orw.js +11 -0
  116. package/web/dist/assets/index-Bz_r8Jt3.css +2 -0
  117. package/web/dist/assets/input-BRsSo4xH.js +1 -0
  118. package/web/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  119. package/web/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  120. package/web/dist/assets/javascript-BgS3c2Ky.js +1 -0
  121. package/web/dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  122. package/web/dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  123. package/web/dist/assets/json-qhed-kSA.js +1 -0
  124. package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  125. package/web/dist/assets/jsx-Bz0zcwM4.js +1 -0
  126. package/web/dist/assets/lib-CNGa3Dig.js +1 -0
  127. package/web/dist/assets/loader-circle-BV3DO9mE.js +1 -0
  128. package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  129. package/web/dist/assets/markdown-CR_HLGTs.js +1 -0
  130. package/web/dist/assets/mermaid-GHXKKRXX-DM2VsGBG.js +1 -0
  131. package/web/dist/assets/open-mercato-toBr6SOa.svg +11 -0
  132. package/web/dist/assets/python-gzcpVVnB.js +1 -0
  133. package/web/dist/assets/react-dom-Ddtik4qM.js +1 -0
  134. package/web/dist/assets/refresh-cw-DCa-Rlwz.js +1 -0
  135. package/web/dist/assets/repo-git-XTqlVOl2.js +1 -0
  136. package/web/dist/assets/run-diff-C7mfxj7f.js +3 -0
  137. package/web/dist/assets/run-header-CfVeY3uM.js +1 -0
  138. package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
  139. package/web/dist/assets/search-x-CoCyl7zT.js +1 -0
  140. package/web/dist/assets/shellscript-CLZ0U2zV.js +1 -0
  141. package/web/dist/assets/skill-detail-C9cniyId.js +1 -0
  142. package/web/dist/assets/skills-DXgY1uXJ.js +1 -0
  143. package/web/dist/assets/skills-ynuO5oCr.js +1 -0
  144. package/web/dist/assets/sql-BsFa4tDR.js +1 -0
  145. package/web/dist/assets/square-terminal-B6PZX4Qp.js +1 -0
  146. package/web/dist/assets/tab-link-phWEqSBy.js +1 -0
  147. package/web/dist/assets/task-changes-DYwnPnTN.js +1 -0
  148. package/web/dist/assets/task-commits-DZzxEzbn.js +1 -0
  149. package/web/dist/assets/task-files-FOAAz2FB.js +2 -0
  150. package/web/dist/assets/task-thread-Bncxe8Os.js +5 -0
  151. package/web/dist/assets/toaster-BS2E1bhz.js +43 -0
  152. package/web/dist/assets/trash-2-CDtxmmc8.js +1 -0
  153. package/web/dist/assets/triangle-alert-6su4Js5O.js +1 -0
  154. package/web/dist/assets/tsx-udAQXfEw.js +1 -0
  155. package/web/dist/assets/typescript-bsJCZSQ-.js +1 -0
  156. package/web/dist/assets/upload-Bp7hQxll.js +1 -0
  157. package/web/dist/assets/use-desktop-eHm2iTXX.js +3 -0
  158. package/web/dist/assets/utils-rQGbOrwc.js +1 -0
  159. package/web/dist/assets/workflows-Dg2wQg6i.js +11 -0
  160. package/web/dist/assets/x-Br_jIDBw.js +1 -0
  161. package/web/dist/assets/yaml-rwi0_p6S.js +1 -0
  162. package/web/dist/index.html +67 -0
  163. package/web/index.html +1 -0
  164. package/web/style.css +28 -8
@@ -0,0 +1 @@
1
+ var e=[Object.freeze(JSON.parse(`{"displayName":"Rust","name":"rust","patterns":[{"begin":"(<)(\\\\[)","beginCaptures":{"1":{"name":"punctuation.brackets.angle.rust"},"2":{"name":"punctuation.brackets.square.rust"}},"end":">","endCaptures":{"0":{"name":"punctuation.brackets.angle.rust"}},"patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#gtypes"},{"include":"#lvariables"},{"include":"#lifetimes"},{"include":"#punctuation"},{"include":"#types"}]},{"captures":{"1":{"name":"keyword.operator.macro.dollar.rust"},"3":{"name":"keyword.other.crate.rust"},"4":{"name":"entity.name.type.metavariable.rust"},"6":{"name":"keyword.operator.key-value.rust"},"7":{"name":"variable.other.metavariable.specifier.rust"}},"match":"(\\\\$)((crate)|([A-Z]\\\\w*))(\\\\s*(:)\\\\s*(block|expr(?:_2021)?|ident|item|lifetime|literal|meta|pat(?:_param)?|path|stmt|tt|ty|vis)\\\\b)?","name":"meta.macro.metavariable.type.rust","patterns":[{"include":"#keywords"}]},{"captures":{"1":{"name":"keyword.operator.macro.dollar.rust"},"2":{"name":"variable.other.metavariable.name.rust"},"4":{"name":"keyword.operator.key-value.rust"},"5":{"name":"variable.other.metavariable.specifier.rust"}},"match":"(\\\\$)([a-z]\\\\w*)(\\\\s*(:)\\\\s*(block|expr(?:_2021)?|ident|item|lifetime|literal|meta|pat(?:_param)?|path|stmt|tt|ty|vis)\\\\b)?","name":"meta.macro.metavariable.rust","patterns":[{"include":"#keywords"}]},{"captures":{"1":{"name":"entity.name.function.macro.rules.rust"},"3":{"name":"entity.name.function.macro.rust"},"4":{"name":"entity.name.type.macro.rust"},"5":{"name":"punctuation.brackets.curly.rust"}},"match":"\\\\b(macro_rules!)\\\\s+(([0-9_a-z]+)|([A-Z][0-9_a-z]*))\\\\s+(\\\\{)","name":"meta.macro.rules.rust"},{"captures":{"1":{"name":"storage.type.rust"},"2":{"name":"entity.name.module.rust"}},"match":"(mod)\\\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][0-9A-Z_a-z]*)"},{"begin":"\\\\b(extern)\\\\s+(crate)","beginCaptures":{"1":{"name":"storage.type.rust"},"2":{"name":"keyword.other.crate.rust"}},"end":";","endCaptures":{"0":{"name":"punctuation.semi.rust"}},"name":"meta.import.rust","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#punctuation"}]},{"begin":"\\\\b(use)\\\\s","beginCaptures":{"1":{"name":"keyword.other.rust"}},"end":";","endCaptures":{"0":{"name":"punctuation.semi.rust"}},"name":"meta.use.rust","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#types"},{"include":"#lvariables"}]},{"include":"#block-comments"},{"include":"#comments"},{"include":"#attributes"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#types"},{"include":"#keywords"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#variables"}],"repository":{"attributes":{"begin":"(#)(!?)(\\\\[)","beginCaptures":{"1":{"name":"punctuation.definition.attribute.rust"},"3":{"name":"punctuation.brackets.attribute.rust"}},"end":"]","endCaptures":{"0":{"name":"punctuation.brackets.attribute.rust"}},"name":"meta.attribute.rust","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lifetimes"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#gtypes"},{"include":"#types"}]},"block-comments":{"patterns":[{"match":"/\\\\*\\\\*/","name":"comment.block.rust"},{"begin":"/\\\\*\\\\*","end":"\\\\*/","name":"comment.block.documentation.rust","patterns":[{"include":"#block-comments"}]},{"begin":"/\\\\*(?!\\\\*)","end":"\\\\*/","name":"comment.block.rust","patterns":[{"include":"#block-comments"}]}]},"comments":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.comment.rust"}},"match":"(///).*$","name":"comment.line.documentation.rust"},{"captures":{"1":{"name":"punctuation.definition.comment.rust"}},"match":"(//).*$","name":"comment.line.double-slash.rust"}]},"constants":{"patterns":[{"match":"\\\\b[A-Z]{2}[0-9A-Z_]*\\\\b","name":"constant.other.caps.rust"},{"captures":{"1":{"name":"storage.type.rust"},"2":{"name":"constant.other.caps.rust"}},"match":"\\\\b(const)\\\\s+([A-Z][0-9A-Z_a-z]*)\\\\b"},{"captures":{"1":{"name":"punctuation.separator.dot.decimal.rust"},"2":{"name":"keyword.operator.exponent.rust"},"3":{"name":"keyword.operator.exponent.sign.rust"},"4":{"name":"constant.numeric.decimal.exponent.mantissa.rust"},"5":{"name":"entity.name.type.numeric.rust"}},"match":"\\\\b\\\\d[_\\\\d]*(\\\\.?)[_\\\\d]*(?:([Ee])([-+]?)([_\\\\d]+))?(f32|f64|i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\\\b","name":"constant.numeric.decimal.rust"},{"captures":{"1":{"name":"entity.name.type.numeric.rust"}},"match":"\\\\b0x[A-F_a-f\\\\d]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\\\b","name":"constant.numeric.hex.rust"},{"captures":{"1":{"name":"entity.name.type.numeric.rust"}},"match":"\\\\b0o[0-7_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\\\b","name":"constant.numeric.oct.rust"},{"captures":{"1":{"name":"entity.name.type.numeric.rust"}},"match":"\\\\b0b[01_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\\\b","name":"constant.numeric.bin.rust"},{"match":"\\\\b(true|false)\\\\b","name":"constant.language.bool.rust"}]},"escapes":{"captures":{"1":{"name":"constant.character.escape.backslash.rust"},"2":{"name":"constant.character.escape.bit.rust"},"3":{"name":"constant.character.escape.unicode.rust"},"4":{"name":"constant.character.escape.unicode.punctuation.rust"},"5":{"name":"constant.character.escape.unicode.punctuation.rust"}},"match":"(\\\\\\\\)(?:(x[0-7][A-Fa-f\\\\d])|(u(\\\\{)[A-Fa-f\\\\d]{4,6}(}))|.)","name":"constant.character.escape.rust"},"functions":{"patterns":[{"captures":{"1":{"name":"keyword.other.rust"},"2":{"name":"punctuation.brackets.round.rust"}},"match":"\\\\b(pub)(\\\\()"},{"begin":"\\\\b(fn)\\\\s+((?:r#(?!crate|[Ss]elf|super))?[0-9A-Z_a-z]+)((\\\\()|(<))","beginCaptures":{"1":{"name":"keyword.other.fn.rust"},"2":{"name":"entity.name.function.rust"},"4":{"name":"punctuation.brackets.round.rust"},"5":{"name":"punctuation.brackets.angle.rust"}},"end":"(\\\\{)|(;)","endCaptures":{"1":{"name":"punctuation.brackets.curly.rust"},"2":{"name":"punctuation.semi.rust"}},"name":"meta.function.definition.rust","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}]},{"begin":"((?:r#(?!crate|[Ss]elf|super))?[0-9A-Z_a-z]+)(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.rust"},"2":{"name":"punctuation.brackets.round.rust"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.brackets.round.rust"}},"name":"meta.function.call.rust","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#attributes"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}]},{"begin":"((?:r#(?!crate|[Ss]elf|super))?[0-9A-Z_a-z]+)(?=::<.*>\\\\()","beginCaptures":{"1":{"name":"entity.name.function.rust"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.brackets.round.rust"}},"name":"meta.function.call.rust","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#attributes"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}]}]},"gtypes":{"patterns":[{"match":"\\\\b(Some|None)\\\\b","name":"entity.name.type.option.rust"},{"match":"\\\\b(Ok|Err)\\\\b","name":"entity.name.type.result.rust"}]},"interpolations":{"captures":{"1":{"name":"punctuation.definition.interpolation.rust"},"2":{"name":"punctuation.definition.interpolation.rust"}},"match":"(\\\\{)[^\\"{}]*(})","name":"meta.interpolation.rust"},"keywords":{"patterns":[{"match":"\\\\b(await|break|continue|do|else|for|if|loop|match|return|try|while|yield)\\\\b","name":"keyword.control.rust"},{"match":"\\\\b(extern|let|macro|mod)\\\\b","name":"keyword.other.rust storage.type.rust"},{"match":"\\\\b(const)\\\\b","name":"storage.modifier.rust"},{"match":"\\\\b(type)\\\\b","name":"keyword.declaration.type.rust storage.type.rust"},{"match":"\\\\b(enum)\\\\b","name":"keyword.declaration.enum.rust storage.type.rust"},{"match":"\\\\b(trait)\\\\b","name":"keyword.declaration.trait.rust storage.type.rust"},{"match":"\\\\b(struct)\\\\b","name":"keyword.declaration.struct.rust storage.type.rust"},{"match":"\\\\b(abstract|static)\\\\b","name":"storage.modifier.rust"},{"match":"\\\\b(as|async|become|box|dyn|move|final|gen|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual|where)\\\\b","name":"keyword.other.rust"},{"match":"\\\\bfn\\\\b","name":"keyword.other.fn.rust"},{"match":"\\\\bcrate\\\\b","name":"keyword.other.crate.rust"},{"match":"\\\\bmut\\\\b","name":"storage.modifier.mut.rust"},{"match":"([\\\\^|]|\\\\|\\\\||&&|<<|>>|!)(?!=)","name":"keyword.operator.logical.rust"},{"match":"&(?![\\\\&=])","name":"keyword.operator.borrow.and.rust"},{"match":"((?:[-%\\\\&*+/^|]|<<|>>)=)","name":"keyword.operator.assignment.rust"},{"match":"(?<![<>])=(?![=>])","name":"keyword.operator.assignment.equal.rust"},{"match":"(=(=)?(?!>)|!=|<=|(?<!=)>=)","name":"keyword.operator.comparison.rust"},{"match":"(([%+]|(\\\\*(?!\\\\w)))(?!=))|(-(?!>))|(/(?!/))","name":"keyword.operator.math.rust"},{"captures":{"1":{"name":"punctuation.brackets.round.rust"},"2":{"name":"punctuation.brackets.square.rust"},"3":{"name":"punctuation.brackets.curly.rust"},"4":{"name":"keyword.operator.comparison.rust"},"5":{"name":"punctuation.brackets.round.rust"},"6":{"name":"punctuation.brackets.square.rust"},"7":{"name":"punctuation.brackets.curly.rust"}},"match":"(?:\\\\b|(?:(\\\\))|(])|(})))[\\\\t ]+([<>])[\\\\t ]+(?:\\\\b|(?:(\\\\()|(\\\\[)|(\\\\{)))"},{"match":"::","name":"keyword.operator.namespace.rust"},{"captures":{"1":{"name":"keyword.operator.dereference.rust"}},"match":"(\\\\*)(?=\\\\w+)"},{"match":"@","name":"keyword.operator.subpattern.rust"},{"match":"\\\\.(?!\\\\.)","name":"keyword.operator.access.dot.rust"},{"match":"\\\\.{2}([.=])?","name":"keyword.operator.range.rust"},{"match":":(?!:)","name":"keyword.operator.key-value.rust"},{"match":"->|<-","name":"keyword.operator.arrow.skinny.rust"},{"match":"=>","name":"keyword.operator.arrow.fat.rust"},{"match":"\\\\$","name":"keyword.operator.macro.dollar.rust"},{"match":"\\\\?","name":"keyword.operator.question.rust"}]},"lifetimes":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.lifetime.rust"},"2":{"name":"entity.name.type.lifetime.rust"}},"match":"(')([A-Z_a-z][0-9A-Z_a-z]*)(?!')\\\\b"},{"captures":{"1":{"name":"keyword.operator.borrow.rust"},"2":{"name":"punctuation.definition.lifetime.rust"},"3":{"name":"entity.name.type.lifetime.rust"}},"match":"(&)(')([A-Z_a-z][0-9A-Z_a-z]*)(?!')\\\\b"}]},"lvariables":{"patterns":[{"match":"\\\\b[Ss]elf\\\\b","name":"variable.language.self.rust"},{"match":"\\\\bsuper\\\\b","name":"variable.language.super.rust"}]},"macros":{"patterns":[{"captures":{"2":{"name":"entity.name.function.macro.rust"},"3":{"name":"entity.name.type.macro.rust"}},"match":"(([_a-z][0-9A-Z_a-z]*!)|([A-Z_][0-9A-Z_a-z]*!))","name":"meta.macro.rust"}]},"namespaces":{"patterns":[{"captures":{"1":{"name":"entity.name.namespace.rust"},"2":{"name":"keyword.operator.namespace.rust"}},"match":"(?<![0-9A-Z_a-z])([0-9A-Z_a-z]+)((?<!s(?:uper|elf))::)"}]},"punctuation":{"patterns":[{"match":",","name":"punctuation.comma.rust"},{"match":"[{}]","name":"punctuation.brackets.curly.rust"},{"match":"[()]","name":"punctuation.brackets.round.rust"},{"match":";","name":"punctuation.semi.rust"},{"match":"[]\\\\[]","name":"punctuation.brackets.square.rust"},{"match":"(?<!=)[<>]","name":"punctuation.brackets.angle.rust"}]},"strings":{"patterns":[{"begin":"(b?)(\\")","beginCaptures":{"1":{"name":"string.quoted.byte.raw.rust"},"2":{"name":"punctuation.definition.string.rust"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.rust"}},"name":"string.quoted.double.rust","patterns":[{"include":"#escapes"},{"include":"#interpolations"}]},{"begin":"(b?r)(#*)(\\")","beginCaptures":{"1":{"name":"string.quoted.byte.raw.rust"},"2":{"name":"punctuation.definition.string.raw.rust"},"3":{"name":"punctuation.definition.string.rust"}},"end":"(\\")(\\\\2)","endCaptures":{"1":{"name":"punctuation.definition.string.rust"},"2":{"name":"punctuation.definition.string.raw.rust"}},"name":"string.quoted.double.rust"},{"begin":"(b)?(')","beginCaptures":{"1":{"name":"string.quoted.byte.raw.rust"},"2":{"name":"punctuation.definition.char.rust"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.char.rust"}},"name":"string.quoted.single.char.rust","patterns":[{"include":"#escapes"}]}]},"types":{"patterns":[{"captures":{"1":{"name":"entity.name.type.numeric.rust"}},"match":"(?<![A-Za-z])(f32|f64|i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)\\\\b"},{"begin":"\\\\b(_?[A-Z][0-9A-Z_a-z]*)(<)","beginCaptures":{"1":{"name":"entity.name.type.rust"},"2":{"name":"punctuation.brackets.angle.rust"}},"end":">","endCaptures":{"0":{"name":"punctuation.brackets.angle.rust"}},"patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#lifetimes"},{"include":"#punctuation"},{"include":"#types"},{"include":"#variables"}]},{"match":"\\\\b(bool|char|str)\\\\b","name":"entity.name.type.primitive.rust"},{"captures":{"1":{"name":"keyword.declaration.trait.rust storage.type.rust"},"2":{"name":"entity.name.type.trait.rust"}},"match":"\\\\b(trait)\\\\s+(_?[A-Z][0-9A-Z_a-z]*)\\\\b"},{"captures":{"1":{"name":"keyword.declaration.struct.rust storage.type.rust"},"2":{"name":"entity.name.type.struct.rust"}},"match":"\\\\b(struct)\\\\s+(_?[A-Z][0-9A-Z_a-z]*)\\\\b"},{"captures":{"1":{"name":"keyword.declaration.enum.rust storage.type.rust"},"2":{"name":"entity.name.type.enum.rust"}},"match":"\\\\b(enum)\\\\s+(_?[A-Z][0-9A-Z_a-z]*)\\\\b"},{"captures":{"1":{"name":"keyword.declaration.type.rust storage.type.rust"},"2":{"name":"entity.name.type.declaration.rust"}},"match":"\\\\b(type)\\\\s+(_?[A-Z][0-9A-Z_a-z]*)\\\\b"},{"match":"\\\\b_?[A-Z][0-9A-Z_a-z]*\\\\b(?!!)","name":"entity.name.type.rust"}]},"variables":{"patterns":[{"match":"\\\\b(?<!(?<!\\\\.)\\\\.)(?:r#(?!(crate|[Ss]elf|super)))?[0-9_a-z]+\\\\b","name":"variable.other.rust"}]}},"scopeName":"source.rust","aliases":["rs"]}`))];export{e as default};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-rQGbOrwc.js";var t=e(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
@@ -0,0 +1 @@
1
+ var e=[Object.freeze(JSON.parse(`{"displayName":"Shell","name":"shellscript","patterns":[{"include":"#initial_context"}],"repository":{"alias_statement":{"begin":"[\\\\t ]*+(alias)[\\\\t ]*+((?:((?<!\\\\w)-\\\\w+)\\\\b[\\\\t ]*+)*)[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"storage.type.alias.shell"},"2":{"patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"}]},"3":{"name":"string.unquoted.argument.shell constant.other.option.shell"},"4":{"name":"variable.other.assignment.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"variable.other.assignment.shell"},"7":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"8":{"name":"punctuation.definition.array.access.shell"},"9":{"name":"keyword.operator.assignment.shell"},"10":{"name":"keyword.operator.assignment.compound.shell"},"11":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\t ]|$)|(?:(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&))","endCaptures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"name":"meta.expression.assignment.alias.shell","patterns":[{"include":"#normal_context"}]},"argument":{"begin":"[\\\\t ]++(?![\\\\n#\\\\&(\\\\[|]|$|;)","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)\`])","endCaptures":{},"name":"meta.argument.shell","patterns":[{"include":"#argument_context"},{"include":"#line_continuation"}]},"argument_context":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell","patterns":[{"match":"\\\\*","name":"variable.language.special.wildcard.shell"},{"include":"#variable"},{"include":"#numeric_literal"},{"captures":{"1":{"name":"constant.language.$1.shell"}},"match":"(?<!\\\\w)\\\\b(true|false)\\\\b(?!\\\\w)"}]}},"match":"[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]+(?!>))"},{"include":"#normal_context"}]},"arithmetic_double":{"patterns":[{"begin":"\\\\(\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"end":"\\\\)\\\\s*\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"arithmetic_no_dollar":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"array_access_inline":{"captures":{"1":{"name":"punctuation.section.array.shell"},"2":{"patterns":[{"include":"#special_expansion"},{"include":"#string"},{"include":"#variable"}]},"3":{"name":"punctuation.section.array.shell"}},"match":"(\\\\[)([^]\\\\[]+)(])"},"array_value":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))[\\\\t ]*+(\\\\()","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"punctuation.definition.array.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.array.shell"}},"patterns":[{"include":"#comment"},{"captures":{"1":{"name":"variable.other.assignment.array.shell entity.other.attribute-name.shell"},"2":{"name":"keyword.operator.assignment.shell punctuation.definition.assignment.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(=)"},{"captures":{"1":{"name":"punctuation.definition.bracket.named-array.shell"},"2":{"name":"string.unquoted.shell entity.other.attribute-name.bracket.shell"},"3":{"name":"punctuation.definition.bracket.named-array.shell"},"4":{"name":"punctuation.definition.assignment.shell"}},"match":"(\\\\[)(.+?)(])(=)"},{"include":"#normal_context"},{"include":"#simple_unquoted"}]},"assignment_statement":{"patterns":[{"include":"#array_value"},{"include":"#modified_assignment_statement"},{"include":"#normal_assignment_statement"}]},"basic_command_name":{"captures":{"1":{"name":"storage.modifier.$1.shell"},"2":{"name":"entity.name.function.call.shell entity.name.command.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"support.function.builtin.shell"},{"include":"#variable"}]}},"match":"(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?:((?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$))|((?![\\"']|\\\\\\\\\\\\n?$)[^\\\\t\\\\n\\\\r !\\"'<>]+?))(?:(?=[\\\\t ])|(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\))","name":"meta.statement.command.name.basic.shell"},"block_comment":{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.shell"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.shell"}},"name":"comment.block.shell"},"boolean":{"match":"\\\\b(?:true|false)\\\\b","name":"constant.language.$0.shell"},"case_statement":{"begin":"\\\\b(case)\\\\b[\\\\t ]*+(.+?)[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.case.shell"},"2":{"patterns":[{"include":"#initial_context"}]},"3":{"name":"keyword.control.in.shell"}},"end":"\\\\besac\\\\b","endCaptures":{"0":{"name":"keyword.control.esac.shell"}},"name":"meta.case.shell","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"keyword.operator.pattern.case.default.shell"}},"match":"[\\\\t ]*+(\\\\* *\\\\))"},{"begin":"(?<!\\\\))(?![\\\\t ]*+(?:esac\\\\b|$))","beginCaptures":{},"end":"(?=\\\\besac\\\\b)|(\\\\))","endCaptures":{"1":{"name":"keyword.operator.pattern.case.shell"}},"name":"meta.case.entry.pattern.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"(?<=\\\\))","beginCaptures":{},"end":"(;;)|(?=\\\\besac\\\\b)","endCaptures":{"1":{"name":"punctuation.terminator.statement.case.shell"}},"name":"meta.case.entry.body.shell","patterns":[{"include":"#typical_statements"},{"include":"#initial_context"}]}]},"case_statement_context":{"patterns":[{"match":"\\\\*","name":"variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\+","name":"variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\?","name":"variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"@","name":"variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell"},{"match":"\\\\|","name":"keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell"},{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"match":"(?<=\\\\tin| in|[\\\\t ]|;;)\\\\(","name":"keyword.operator.pattern.case.shell"},{"begin":"(?<=\\\\S)(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"name":"meta.parenthese.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"name":"string.regexp.character-class.shell","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"}]},{"include":"#string"},{"match":"[^\\\\t\\\\n )*?@\\\\[|]","name":"string.unquoted.pattern.shell string.regexp.unquoted.shell"}]},"command_name_range":{"begin":"\\\\G","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)\`])|(?=<)","endCaptures":{},"name":"meta.statement.command.name.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"},{"include":"#variable"},{"captures":{"1":{"name":"entity.name.function.call.shell entity.name.command.shell"}},"match":"(?<!\\\\w)(?<=\\\\G|[\\"')}])([^\\\\t\\\\n\\\\r \\"\\\\&');->\`{|]+)"},{"begin":"(?:\\\\G|(?<![\\\\t\\\\n #\\\\&;{|]))(\\\\$?)((\\")|('))","beginCaptures":{"1":{"name":"meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"},"2":{},"3":{"name":"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},"4":{"name":"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"}},"end":"(?<!\\\\G)(?<=\\\\2)","endCaptures":{},"patterns":[{"include":"#continuation_of_single_quoted_command_name"},{"include":"#continuation_of_double_quoted_command_name"}]},{"include":"#line_continuation"},{"include":"#simple_unquoted"}]},"command_statement":{"begin":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"},{"include":"#heredoc"}]},"comment":{"captures":{"1":{"name":"comment.line.number-sign.shell meta.shebang.shell"},"2":{"name":"punctuation.definition.comment.shebang.shell"},"3":{"name":"comment.line.number-sign.shell"},"4":{"name":"punctuation.definition.comment.shell"}},"match":"(?:^|[\\\\t ]++)(?:((#!).*)|((#).*))"},"comments":{"patterns":[{"include":"#block_comment"},{"include":"#line_comment"}]},"compound-command":{"patterns":[{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical-expression"},{"include":"#initial_context"}]},{"begin":"(?<=\\\\s|^)\\\\{(?=\\\\s|$)","beginCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"end":"(?<=^|;)\\\\s*(})","endCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"continuation_of_double_quoted_command_name":{"begin":"\\\\G(?<=\\")","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command","end":"\\"","endCaptures":{"0":{"name":"string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"continuation_of_single_quoted_command_name":{"begin":"\\\\G(?<=')","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command","end":"'","endCaptures":{"0":{"name":"string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}}},"custom_command_names":{"patterns":[]},"custom_commands":{"patterns":[]},"double_quote_context":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"double_quote_escape_char":{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},"floating_keyword":{"patterns":[{"match":"(?<=^|[\\\\t \\\\&;])(?:then|elif|else|done|end|do|if|fi)(?=[\\\\t \\\\&;]|$)","name":"keyword.control.$0.shell"}]},"for_statement":{"patterns":[{"begin":"\\\\b(for)\\\\b[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"},"2":{"name":"variable.other.for.shell"},"3":{"name":"keyword.control.in.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.in.shell","patterns":[{"include":"#string"},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},{"begin":"\\\\b(for)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.shell","patterns":[{"include":"#arithmetic_double"},{"include":"#normal_context"}]}]},"function_definition":{"applyEndPatternLast":1,"begin":"[\\\\t ]*+(?:\\\\b(function)\\\\b[\\\\t ]*+([^\\\\t\\\\n\\\\r \\"'()=]+)(?:(\\\\()[\\\\t ]*+(\\\\)))?|([^\\\\t\\\\n\\\\r \\"'()=]+)[\\\\t ]*+(\\\\()[\\\\t ]*+(\\\\)))","beginCaptures":{"1":{"name":"storage.type.function.shell"},"2":{"name":"entity.name.function.shell"},"3":{"name":"punctuation.definition.arguments.shell"},"4":{"name":"punctuation.definition.arguments.shell"},"5":{"name":"entity.name.function.shell"},"6":{"name":"punctuation.definition.arguments.shell"},"7":{"name":"punctuation.definition.arguments.shell"}},"end":"(?<=[)}])","endCaptures":{},"name":"meta.function.shell","patterns":[{"match":"\\\\G[\\\\t\\\\n ]"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"include":"#initial_context"}]},"heredoc":{"patterns":[{"begin":"((?<!<)<<-)[\\\\t ]*+([\\"'])[\\\\t ]*+([^\\"']+?)(?=[\\"\\\\&';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.indent.$3","end":"^\\\\t*\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.$0.shell"}},"patterns":[]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([\\"'])[\\\\t ]*+([^\\"']+?)(?=[\\"\\\\&';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.no-indent.$3","end":"^\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[]},{"begin":"((?<!<)<<-)[\\\\t ]*+([^\\\\t \\"']+)(?=[\\"\\\\&';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.indent.$2","end":"^\\\\t*\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([^\\\\t \\"']+)(?=[\\"\\\\&';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.no-indent.$2","end":"^\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]}]},"herestring":{"patterns":[{"begin":"(<<<)\\\\s*(('))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.single.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.single.shell","end":"(')","endCaptures":{"0":{"name":"string.quoted.single.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell"},{"begin":"(<<<)\\\\s*((\\"))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.double.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.double.shell","end":"(\\")","endCaptures":{"0":{"name":"string.quoted.double.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell","patterns":[{"include":"#double_quote_context"}]},{"captures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.unquoted.herestring.shell","patterns":[{"include":"#initial_context"}]}},"match":"(<<<)\\\\s*(([^)\\\\\\\\\\\\s]|\\\\\\\\.)+)","name":"meta.herestring.shell"}]},"initial_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#logical_expression_double"},{"include":"#logical_expression_single"},{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#loop"},{"include":"#function_definition"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#misc_ranges"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#alias_statement"},{"include":"#normal_statement"},{"include":"#string"},{"include":"#support"}]},"inline_comment":{"captures":{"1":{"name":"comment.block.shell punctuation.definition.comment.begin.shell"},"2":{"name":"comment.block.shell"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.shell punctuation.definition.comment.end.shell"},{"match":"\\\\*","name":"comment.block.shell"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"},"interpolation":{"patterns":[{"include":"#arithmetic_dollar"},{"include":"#subshell_dollar"},{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"name":"string.interpolated.backtick.shell","patterns":[{"match":"\\\\\\\\[$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"begin":"(?<=\\\\W)(?=#)(?!#\\\\{)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.shell"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.shell"}},"end":"(?=\`)","name":"comment.line.number-sign.shell"}]},{"include":"#initial_context"}]}]},"keyword":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=[\\\\&;\\\\s]|$)","name":"keyword.control.shell"},{"match":"(?<=^|[\\\\&;\\\\s])(?:export|declare|typeset|local|readonly)(?=[\\\\&;\\\\s]|$)","name":"storage.modifier.shell"}]},"line_comment":{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.shell"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.shell","patterns":[{"include":"#line_continuation_character"}]},"line_continuation":{"match":"\\\\\\\\(?=\\\\n)","name":"constant.character.escape.line-continuation.shell"},"logical-expression":{"patterns":[{"include":"#arithmetic_no_dollar"},{"match":"=[=~]?|!=?|[<>]|&&|\\\\|\\\\|","name":"keyword.operator.logical.shell"},{"match":"(?<!\\\\S)-(nt|ot|ef|eq|ne|l[et]|g[et]|[GLNOSa-hknopr-uwxz])\\\\b","name":"keyword.operator.logical.shell"}]},"logical_expression_context":{"patterns":[{"include":"#regex_comparison"},{"include":"#arithmetic_no_dollar"},{"include":"#logical-expression"},{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#comment"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"logical_expression_double":{"begin":"\\\\[\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"logical_expression_single":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"loop":{"patterns":[{"begin":"(?<=^|[\\\\&;\\\\s])(for)\\\\s+(.+?)\\\\s+(in)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell","patterns":[{"include":"#string"}]},"3":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.for-in-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(while|until)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.while-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(select)\\\\s+((?:[^\\\\\\\\\\\\s]|\\\\\\\\.)+)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell"}},"end":"(?<=^|[\\\\&;\\\\s])(done)(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"1":{"name":"keyword.control.shell"}},"name":"meta.scope.select-block.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])if(?=[\\\\&;\\\\s]|$)","beginCaptures":{"0":{"name":"keyword.control.if.shell"}},"end":"(?<=^|[\\\\&;\\\\s])fi(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"keyword.control.fi.shell"}},"name":"meta.scope.if-block.shell","patterns":[{"include":"#initial_context"}]}]},"math":{"patterns":[{"include":"#variable"},{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":";","name":"punctuation.separator.semicolon.range"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"},{"match":"(?<!\\\\w)[0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"}]},"math_operators":{"patterns":[{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"}]},"misc_ranges":{"patterns":[{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#subshell_dollar"},{"begin":"(?<![^\\\\t ])(\\\\{)(?![$\\\\w])","beginCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"modified_assignment_statement":{"begin":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","beginCaptures":{"0":{"name":"storage.modifier.$0.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell meta.expression.assignment.modified.shell","patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"},{"include":"#array_value"},{"captures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"10":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"11":{"name":"constant.numeric.shell constant.numeric.other.shell"},"12":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"13":{"name":"constant.numeric.shell constant.numeric.version.shell"},"14":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))?(?:(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}]))?"},{"include":"#normal_context"}]},"modifiers":{"match":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","name":"storage.modifier.$0.shell"},"normal_assignment_statement":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.expression.assignment.shell","patterns":[{"include":"#comment"},{"include":"#string"},{"include":"#normal_assignment_statement"},{"begin":"(?<=[\\\\t ])(?![\\\\t ]|\\\\w+=)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.env.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"}]},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},"normal_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#misc_ranges"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"},{"include":"#parenthese"}]},"normal_statement":{"begin":"(?!^[\\\\t ]*+$)(?:(?<=(?:^until| until|\\\\tuntil|^while| while|\\\\twhile|^elif| elif|\\\\telif|^else| else|\\\\telse|^then| then|\\\\tthen|^do| do|\\\\tdo|^if| if|\\\\tif) )|(?<=^|[!\\\\&(;\`{|]))[\\\\t ]*+(?!nocorrect\\\\W|nocorrect\\\\$|function\\\\W|function\\\\$|foreach\\\\W|foreach\\\\$|repeat\\\\W|repeat\\\\$|logout\\\\W|logout\\\\$|coproc\\\\W|coproc\\\\$|select\\\\W|select\\\\$|while\\\\W|while\\\\$|pushd\\\\W|pushd\\\\$|until\\\\W|until\\\\$|case\\\\W|case\\\\$|done\\\\W|done\\\\$|elif\\\\W|elif\\\\$|else\\\\W|else\\\\$|esac\\\\W|esac\\\\$|popd\\\\W|popd\\\\$|then\\\\W|then\\\\$|time\\\\W|time\\\\$|for\\\\W|for\\\\$|end\\\\W|end\\\\$|fi\\\\W|fi\\\\$|do\\\\W|do\\\\$|in\\\\W|in\\\\$|if\\\\W|if\\\\$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell","patterns":[{"include":"#typical_statements"}]},"normal_statement_seperator":{"captures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"match":"(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&)"},"numeric_literal":{"captures":{"1":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"2":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"3":{"name":"constant.numeric.shell constant.numeric.other.shell"},"4":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"5":{"name":"constant.numeric.shell constant.numeric.version.shell"},"6":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}])"},"option":{"begin":"[\\\\t ]++(-)((?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;]))","beginCaptures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"contentName":"string.unquoted.argument constant.other.option","end":"(?=[\\\\t ])|(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"patterns":[{"include":"#option_context"}]},"option_context":{"patterns":[{"include":"#misc_ranges"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"parenthese":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"name":"meta.parenthese.group.shell","patterns":[{"include":"#initial_context"}]}]},"pathname":{"patterns":[{"match":"(?<=[:=\\\\s]|^)~","name":"keyword.operator.tilde.shell"},{"match":"[*?]","name":"keyword.operator.glob.shell"},{"begin":"([!*+?@])(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.extglob.shell"},"2":{"name":"punctuation.definition.extglob.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.extglob.shell"}},"name":"meta.structure.extglob.shell","patterns":[{"include":"#initial_context"}]}]},"pipeline":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(time)(?=[\\\\&;\\\\s]|$)","name":"keyword.other.shell"},{"match":"[!|]","name":"keyword.operator.pipe.shell"}]},"redirect_fix":{"captures":{"1":{"name":"keyword.operator.redirect.shell"},"2":{"name":"string.unquoted.argument.shell"}},"match":"(>>?)[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]+)"},"redirect_number":{"captures":{"1":{"name":"keyword.operator.redirect.stdout.shell"},"2":{"name":"keyword.operator.redirect.stderr.shell"},"3":{"name":"keyword.operator.redirect.$3.shell"}},"match":"(?<=[\\\\t ])(?:(1)|(2)|(\\\\d+))(?=>)"},"redirection":{"patterns":[{"begin":"[<>]\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.interpolated.process-substitution.shell","patterns":[{"include":"#initial_context"}]},{"match":"(?<![<>])(&>|\\\\d*>&\\\\d*|\\\\d*(>>|[<>])|\\\\d*<&|\\\\d*<>)(?![<>])","name":"keyword.operator.redirect.shell"}]},"regex_comparison":{"match":"=~","name":"keyword.operator.logical.regex.shell"},"regexp":{"patterns":[{"match":".+"}]},"simple_options":{"captures":{"0":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"match":"[\\\\t ]++(-)(\\\\w+)"}]}},"match":"(?:[\\\\t ]++-\\\\w+)*"},"simple_unquoted":{"match":"[^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\\`|]","name":"string.unquoted.shell"},"special_expansion":{"match":"!|:[-=?]?|[*@]|##?|%%|[%/]","name":"keyword.operator.expansion.shell"},"start_of_command":{"match":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)"},"string":{"patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.shell"},{"begin":"\\\\$?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.double.shell","patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"\\\\$'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.dollar.shell","patterns":[{"match":"\\\\\\\\['\\\\\\\\abefnrtv]","name":"constant.character.escape.ansi-c.shell"},{"match":"\\\\\\\\[0-9]{3}\\"","name":"constant.character.escape.octal.shell"},{"match":"\\\\\\\\x\\\\h{2}\\"","name":"constant.character.escape.hex.shell"},{"match":"\\\\\\\\c.\\"","name":"constant.character.escape.control-char.shell"}]}]},"subshell_dollar":{"patterns":[{"begin":"\\\\$\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"name":"meta.scope.subshell","patterns":[{"include":"#parenthese"},{"include":"#initial_context"}]}]},"support":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])[.:](?=[\\\\&;\\\\s]|$)","name":"support.function.builtin.shell"}]},"typical_statements":{"patterns":[{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#while_statement"},{"include":"#function_definition"},{"include":"#command_statement"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#normal_context"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.all.shell"},"2":{"name":"variable.parameter.positional.all.shell"}},"match":"(\\\\$)(@(?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"variable.parameter.positional.shell"}},"match":"(\\\\$)([0-9](?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.language.special.shell"},"2":{"name":"variable.language.special.shell"}},"match":"(\\\\$)([-!#$*0?_](?!\\\\w))"},{"begin":"(\\\\$)(\\\\{)[\\\\t ]*+(?=\\\\d)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"[0-9]+","name":"variable.parameter.positional.shell"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"begin":"(\\\\$)(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.other.normal.shell"},"2":{"name":"variable.other.normal.shell"}},"match":"(\\\\$)(\\\\w+(?!\\\\w))"}]},"while_statement":{"patterns":[{"begin":"\\\\b(while)\\\\b","beginCaptures":{"1":{"name":"keyword.control.while.shell"}},"end":"(?=[\\\\n\\\\&);\`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.while.shell","patterns":[{"include":"#line_continuation"},{"include":"#math_operators"},{"include":"#option"},{"include":"#simple_unquoted"},{"include":"#normal_context"},{"include":"#string"}]}]}},"scopeName":"source.shell","aliases":["bash","sh","shell","zsh"]}`))];export{e as default};
@@ -0,0 +1 @@
1
+ import{a as e}from"./bundle-mjs-DLPpRFyl.js";import{Dt as t}from"./toaster-BS2E1bhz.js";import{n,t as r}from"./utils-rQGbOrwc.js";import{i,r as a,s as o,t as s}from"./dialog-BEgEWFDS.js";import{r as c}from"./skills-ynuO5oCr.js";import{t as l}from"./markdown-CR_HLGTs.js";var u=n(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),d=n(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),f=e();function p({source:e,className:t}){return(0,f.jsx)(`span`,{"data-slot":`skill-source`,"data-source":e,className:r(`shrink-0 rounded-full border border-border px-2 py-px font-mono text-[10.5px]`,c({source:e})?`font-semibold text-foreground`:`text-soft-foreground`,t),children:e})}function m({skill:e,usedBy:t,heading:n=`h2`}){return(0,f.jsxs)(`div`,{"data-slot":`skill-detail`,className:`min-w-0`,children:[(0,f.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2.5`,children:[(0,f.jsx)(n,{className:`min-w-0 font-mono text-lg font-semibold break-all`,children:e.name}),(0,f.jsx)(p,{source:e.source})]}),(0,f.jsxs)(`p`,{"data-slot":`skill-path`,className:`mt-1 font-mono text-[10.5px] break-all text-soft-foreground`,children:[e.path,e.team?` · from ${e.team.repo}`:``]}),e.description?(0,f.jsx)(`p`,{"data-slot":`skill-description`,className:`mt-2.5 text-[13px] text-muted-foreground`,children:e.description}):null,t===void 0?null:(0,f.jsxs)(`section`,{"data-slot":`skill-used-by`,className:`mt-5`,children:[(0,f.jsx)(`h3`,{className:`text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:`Used by`}),t.length>0?(0,f.jsx)(`ul`,{className:`mt-1.5 flex flex-col gap-1`,children:t.map(e=>(0,f.jsxs)(`li`,{className:`flex items-center gap-1.5 font-mono text-xs text-muted-foreground`,children:[(0,f.jsx)(u,{"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`}),e]},e))}):(0,f.jsx)(`p`,{className:`mt-1.5 text-xs text-soft-foreground`,children:`Not referenced by any workflow yet — quick-task picks it up when the task mentions it.`})]}),(0,f.jsxs)(`section`,{className:`mt-5`,children:[(0,f.jsx)(`h3`,{className:`text-[11px] font-semibold tracking-[.04em] text-soft-foreground uppercase`,children:`Content`}),(0,f.jsx)(`div`,{"data-slot":`skill-body`,className:`mt-2 text-sm`,children:(0,f.jsx)(l,{children:e.body})})]})]})}function h({skill:e,onClose:n}){return(0,f.jsx)(s,{open:e!==null,onOpenChange:e=>e?void 0:n(),children:(0,f.jsx)(a,{"data-slot":`skill-preview`,className:`block max-h-[80dvh] overflow-y-auto sm:max-w-2xl`,children:e?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(o,{className:`sr-only`,children:e.name}),(0,f.jsx)(i,{className:`sr-only`,children:`Read-only skill preview`}),(0,f.jsx)(m,{skill:e,heading:`h3`}),(0,f.jsx)(`p`,{className:`mt-5`,children:(0,f.jsx)(t,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-preview-manage`,onClick:n,className:`text-xs font-semibold text-violet hover:underline`,children:`Open in the Skills catalog`})})]}):null})})}export{d as i,h as n,p as r,m as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{D as r,Dt as i,It as a,Lt as o,St as s,X as c,n as l,q as u,r as d,zt as f}from"./toaster-BS2E1bhz.js";import{t as p}from"./utils-rQGbOrwc.js";import{t as m}from"./arrow-left-BE957rJs.js";import{i as h,r as g,t as _}from"./skill-detail-C9cniyId.js";import{t as v}from"./refresh-cw-DCa-Rlwz.js";import{t as y}from"./triangle-alert-6su4Js5O.js";import{i as b,o as x,r as S,t as C}from"./skills-ynuO5oCr.js";import{t as w}from"./input-BRsSo4xH.js";import{X as T,s as E}from"./index-9qG98Orw.js";var D=t(n(),1),O=e(),k=`__bm`;function A(){return(0,O.jsxs)(`div`,{"data-route":`skills`,className:`flex min-h-full flex-col`,children:[(0,O.jsxs)(`header`,{className:`sticky top-0 z-10 hidden h-14 shrink-0 items-center gap-3 border-b border-border bg-background px-5 md:flex`,children:[(0,O.jsx)(`h1`,{className:`text-base font-semibold`,children:`Skills`}),(0,O.jsx)(`p`,{className:`text-[13px] text-muted-foreground`,children:`Markdown playbooks agents can follow.`})]}),(0,O.jsx)(j,{})]})}function j(){let e=u(),t=c(),[n]=a(),[g,S]=(0,D.useState)(``),A=f(),j=o({mutationFn:()=>s(),onSuccess:e=>{A.setQueryData(r.skills,e),l(`Team skills refreshed.`)},onError:e=>l(e.message,{tone:`danger`})});if(e.isError)return(0,O.jsx)(d,{icon:(0,O.jsx)(y,{}),tone:`danger`,heading:`h2`,title:`Could not load skills`,subtitle:e.error.message});let N=b(e.data??[]),P=n.get(`skill`),F=P===k?k:P!==null&&N.some(e=>e.name===P)?P:N[0]?.name??k,I=N.find(e=>e.name===F)??null,L=C(N,g);return(0,O.jsxs)(`div`,{"data-slot":`skills-section`,className:`flex min-h-full flex-1 items-stretch`,children:[(0,O.jsxs)(`section`,{"data-slot":`skills-list`,className:p(`w-full flex-col border-border md:flex md:w-[320px] md:shrink-0 md:border-r`,`md:sticky md:top-14 md:max-h-[calc(100dvh-(var(--spacing)*14))]`,P===null?`flex`:`hidden md:flex`),children:[(0,O.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 p-3 pb-2`,children:[(0,O.jsx)(w,{"data-slot":`skills-filter`,placeholder:`Filter skills…`,"aria-label":`Filter skills`,value:g,onChange:e=>S(e.target.value),className:`h-8 text-[13px]`}),(0,O.jsxs)(`button`,{type:`button`,"data-slot":`skills-refresh`,title:`git fetch the team skills repos`,disabled:j.isPending,onClick:()=>j.mutate(),className:`flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-55`,children:[(0,O.jsx)(v,{"aria-hidden":`true`,className:p(`size-3`,j.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,O.jsx)(`ul`,{"data-slot":`skill-rows`,className:`min-h-0 flex-1 overflow-y-auto px-2 pb-2`,children:e.isPending?(0,O.jsx)(`li`,{className:`px-2.5 py-2 text-[13px] text-soft-foreground`,children:`Loading…`}):L.length>0?L.map(e=>(0,O.jsx)(M,{skill:e,active:F===e.name},e.path)):(0,O.jsx)(`li`,{className:`px-2.5 py-2 text-xs leading-relaxed text-soft-foreground`,children:N.length>0?`(no skills match)`:(0,O.jsxs)(O.Fragment,{children:[`No skills yet. Drop Markdown files into `,(0,O.jsx)(`span`,{className:`font-mono`,children:`.ai/skills/`}),` or`,` `,(0,O.jsx)(`span`,{className:`font-mono`,children:`.ai/cezar/skills/`}),` — optional frontmatter:`,` `,(0,O.jsx)(`span`,{className:`font-mono`,children:`name`}),`, `,(0,O.jsx)(`span`,{className:`font-mono`,children:`description`}),`. Team skills from your skills repo appear here too — try Refresh.`]})})}),(0,O.jsx)(`div`,{className:`shrink-0 border-t border-border p-2`,children:(0,O.jsxs)(i,{to:`/skills?skill=${k}`,"data-slot":`bookmarklets-row`,"aria-current":F===k?`page`:void 0,className:p(`flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,F===k&&`bg-muted`),children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,O.jsx)(h,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,O.jsx)(`span`,{className:`min-w-0 truncate text-[13px] font-medium`,children:`Run from GitHub`}),(0,O.jsx)(`span`,{className:`ml-auto shrink-0 rounded-full border border-border px-2 py-px font-mono text-[10.5px] text-soft-foreground`,children:`bookmarklets`})]}),(0,O.jsx)(`span`,{className:`pl-[22px] text-xs text-soft-foreground`,children:`One-click skill launch from any GitHub PR or issue.`})]})})]}),(0,O.jsx)(`section`,{"data-slot":`skills-detail`,className:p(`min-w-0 flex-1 flex-col`,P===null?`hidden md:flex`:`flex`),children:(0,O.jsxs)(`div`,{className:`min-w-0 flex-1 px-4 py-4 md:px-7 md:py-5`,children:[(0,O.jsxs)(i,{to:`/skills`,"data-slot":`skills-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,O.jsx)(m,{"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),F===k?(0,O.jsx)(E,{skills:N}):I?(0,O.jsx)(_,{skill:I,usedBy:x(t.data?.workflows??[],I.name)}):e.isPending?null:(0,O.jsx)(d,{icon:(0,O.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`No skill selected`,subtitle:`Pick a skill from the catalog.`})]})})]})}function M({skill:e,active:t}){let n=S(e);return(0,O.jsx)(`li`,{children:(0,O.jsxs)(i,{to:`/skills?skill=${encodeURIComponent(e.name)}`,"data-slot":`skill-row`,"data-skill":e.name,"data-project":n?`true`:void 0,"aria-current":t?`page`:void 0,className:p(`flex flex-col gap-0.5 rounded-md px-2.5 py-2 transition-colors hover:bg-muted`,t&&`bg-muted`),children:[(0,O.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,O.jsx)(T,{"aria-hidden":`true`,className:p(`size-3.5 shrink-0`,n?`text-violet`:`text-soft-foreground`)}),(0,O.jsx)(`span`,{className:p(`min-w-0 truncate font-mono text-[13px]`,n?`font-semibold text-foreground`:`font-medium text-muted-foreground`),children:e.name}),(0,O.jsx)(g,{source:e.source,className:`ml-auto`})]}),e.description?(0,O.jsx)(`span`,{className:`line-clamp-2 pl-[22px] text-xs text-soft-foreground`,children:e.description}):null]})})}export{A as SkillsRoute};
@@ -0,0 +1 @@
1
+ var e=new Set([`ai`,`cezar`,`agents`]);function t(t){return e.has(t.source)}function n(e){return[...e].sort((e,n)=>Number(!t(e))-Number(!t(n)))}function r(e,n){let r=new Map;n.forEach((e,t)=>{r.has(e)||r.set(e,t)});let i=e=>r.get(e.name)??2**53-1;return[...e].sort((e,n)=>Number(!t(e))-Number(!t(n))||i(e)-i(n))}function i(e,t){if(t===``)return!0;let n=e.toLowerCase(),r=t.toLowerCase(),i=0;for(let e of r){if(i=n.indexOf(e,i),i===-1)return!1;i+=1}return!0}function a(e,t){let n=[];for(let r of e)for(let e of r.steps??[])e.skill===t&&n.push(`${r.name} › ${e.name??e.id}`);return n}function o(e,t){return n(e).filter(e=>i(e.name,t)||i(e.description??``,t))}export{r as a,n as i,i as n,a as o,t as r,o as t};
@@ -0,0 +1 @@
1
+ var e=[Object.freeze(JSON.parse(`{"displayName":"SQL","name":"sql","patterns":[{"match":"((?<!@)@)\\\\b(\\\\w+)\\\\b","name":"text.variable"},{"match":"(\\\\[)[^]]*(])","name":"text.bracketed"},{"include":"#comments"},{"captures":{"1":{"name":"keyword.other.create.sql"},"2":{"name":"keyword.other.sql"},"5":{"name":"entity.name.function.sql"}},"match":"(?i:^\\\\s*(create(?:\\\\s+or\\\\s+replace)?)\\\\s+(aggregate|conversion|database|domain|function|group|(unique\\\\s+)?index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view)\\\\s+)([\\"'\`]?)(\\\\w+)\\\\4","name":"meta.create.sql"},{"captures":{"1":{"name":"keyword.other.create.sql"},"2":{"name":"keyword.other.sql"}},"match":"(?i:^\\\\s*(drop)\\\\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view))","name":"meta.drop.sql"},{"captures":{"1":{"name":"keyword.other.create.sql"},"2":{"name":"keyword.other.table.sql"},"3":{"name":"entity.name.function.sql"},"4":{"name":"keyword.other.cascade.sql"}},"match":"(?i:\\\\s*(drop)\\\\s+(table)\\\\s+(\\\\w+)(\\\\s+cascade)?\\\\b)","name":"meta.drop.sql"},{"captures":{"1":{"name":"keyword.other.create.sql"},"2":{"name":"keyword.other.table.sql"}},"match":"(?i:^\\\\s*(alter)\\\\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|proc(edure)?|rule|schema|sequence|table|tablespace|trigger|type|user|view)\\\\s+)","name":"meta.alter.sql"},{"captures":{"1":{"name":"storage.type.sql"},"2":{"name":"storage.type.sql"},"3":{"name":"constant.numeric.sql"},"4":{"name":"storage.type.sql"},"5":{"name":"constant.numeric.sql"},"6":{"name":"storage.type.sql"},"7":{"name":"constant.numeric.sql"},"8":{"name":"constant.numeric.sql"},"9":{"name":"storage.type.sql"},"10":{"name":"constant.numeric.sql"},"11":{"name":"storage.type.sql"},"12":{"name":"storage.type.sql"},"13":{"name":"storage.type.sql"},"14":{"name":"constant.numeric.sql"},"15":{"name":"storage.type.sql"}},"match":"(?i)\\\\b(bigint|bigserial|bit|boolean|box|bytea|cidr|circle|date|double\\\\sprecision|inet|int|integer|line|lseg|macaddr|money|oid|path|point|polygon|real|serial|smallint|sysdate|text)\\\\b|\\\\b(bit\\\\svarying|character\\\\s(?:varying)?|tinyint|var\\\\schar|float|interval)\\\\((\\\\d+)\\\\)|\\\\b(char|number|varchar\\\\d?)\\\\b(?:\\\\((\\\\d+)\\\\))?|\\\\b(numeric|decimal)\\\\b(?:\\\\((\\\\d+),(\\\\d+)\\\\))?|\\\\b(times?)\\\\b(?:\\\\((\\\\d+)\\\\))?(\\\\swith(?:out)?\\\\stime\\\\szone\\\\b)?|\\\\b(timestamp)(s|tz)?\\\\b(?:\\\\((\\\\d+)\\\\))?(\\\\s(with(?:|out))\\\\stime\\\\szone\\\\b)?"},{"match":"(?i:\\\\b((?:primary|foreign)\\\\s+key|references|on\\\\s+(delete|update)(\\\\s+cascade)?|nocheck|check|constraint|collate|default)\\\\b)","name":"storage.modifier.sql"},{"match":"\\\\b\\\\d+\\\\b","name":"constant.numeric.sql"},{"match":"(?i:\\\\b(select(\\\\s+(all|distinct))?|insert\\\\s+(ignore\\\\s+)?into|update|delete|from|set|where|group\\\\s+by|or|like|and|union(\\\\s+all)?|having|order\\\\s+by|limit|cross\\\\s+join|join|straight_join|(inner|(left|right|full)(\\\\s+outer)?)\\\\s+join|natural(\\\\s+(inner|(left|right|full)(\\\\s+outer)?))?\\\\s+join)\\\\b)","name":"keyword.other.DML.sql"},{"match":"(?i:\\\\b(on|off|((is\\\\s+)?not\\\\s+)?null)\\\\b)","name":"keyword.other.DDL.create.II.sql"},{"match":"(?i:\\\\bvalues\\\\b)","name":"keyword.other.DML.II.sql"},{"match":"(?i:\\\\b(begin(\\\\s+work)?|start\\\\s+transaction|commit(\\\\s+work)?|rollback(\\\\s+work)?)\\\\b)","name":"keyword.other.LUW.sql"},{"match":"(?i:\\\\b(grant(\\\\swith\\\\sgrant\\\\soption)?|revoke)\\\\b)","name":"keyword.other.authorization.sql"},{"match":"(?i:\\\\bin\\\\b)","name":"keyword.other.data-integrity.sql"},{"match":"(?i:^\\\\s*(comment\\\\s+on\\\\s+(table|column|aggregate|constraint|database|domain|function|index|operator|rule|schema|sequence|trigger|type|view))\\\\s+)","name":"keyword.other.object-comments.sql"},{"match":"(?i)\\\\bAS\\\\b","name":"keyword.other.alias.sql"},{"match":"(?i)\\\\b(DESC|ASC)\\\\b","name":"keyword.other.order.sql"},{"match":"\\\\*","name":"keyword.operator.star.sql"},{"match":"[!<>]?=|<>|[<>]","name":"keyword.operator.comparison.sql"},{"match":"[-+/]","name":"keyword.operator.math.sql"},{"match":"\\\\|\\\\|","name":"keyword.operator.concatenator.sql"},{"captures":{"1":{"name":"support.function.aggregate.sql"}},"match":"(?i)\\\\b(approx_count_distinct|approx_percentile_cont|approx_percentile_disc|avg|checksum_agg|count|count_big|group|grouping|grouping_id|max|min|sum|stdevp??|varp??)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.analytic.sql"}},"match":"(?i)\\\\b(cume_dist|first_value|lag|last_value|lead|percent_rank|percentile_cont|percentile_disc)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.bitmanipulation.sql"}},"match":"(?i)\\\\b((?:bit_coun|get_bi|left_shif|right_shif|set_bi)t)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.conversion.sql"}},"match":"(?i)\\\\b(cast|convert|parse|try_cast|try_convert|try_parse)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.collation.sql"}},"match":"(?i)\\\\b(collationproperty|tertiary_weights)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.cryptographic.sql"}},"match":"(?i)\\\\b(asymkey_id|asymkeyproperty|certproperty|cert_id|crypt_gen_random|decryptbyasymkey|decryptbycert|decryptbykey|decryptbykeyautoasymkey|decryptbykeyautocert|decryptbypassphrase|encryptbyasymkey|encryptbycert|encryptbykey|encryptbypassphrase|hashbytes|is_objectsigned|key_guid|key_id|key_name|signbyasymkey|signbycert|symkeyproperty|verifysignedbycert|verifysignedbyasymkey)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.cursor.sql"}},"match":"(?i)\\\\b(cursor_status)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.datetime.sql"}},"match":"(?i)\\\\b(sysdatetime|sysdatetimeoffset|sysutcdatetime|current_time(stamp)?|getdate|getutcdate|datename|datepart|day|month|year|datefromparts|datetime2fromparts|datetimefromparts|datetimeoffsetfromparts|smalldatetimefromparts|timefromparts|datediff|dateadd|datetrunc|eomonth|switchoffset|todatetimeoffset|isdate|date_bucket)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.datatype.sql"}},"match":"(?i)\\\\b(datalength|ident_current|ident_incr|ident_seed|identity|sql_variant_property)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.expression.sql"}},"match":"(?i)\\\\b(coalesce|nullif)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.globalvar.sql"}},"match":"(?<!@)@@(?i)\\\\b(cursor_rows|connections|cpu_busy|datefirst|dbts|error|fetch_status|identity|idle|io_busy|langid|language|lock_timeout|max_connections|max_precision|nestlevel|options|packet_errors|pack_received|pack_sent|procid|remserver|rowcount|servername|servicename|spid|textsize|timeticks|total_errors|total_read|total_write|trancount|version)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.json.sql"}},"match":"(?i)\\\\b(json|isjson|json_object|json_array|json_value|json_query|json_modify|json_path_exists)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.logical.sql"}},"match":"(?i)\\\\b(choose|iif|greatest|least)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.mathematical.sql"}},"match":"(?i)\\\\b(abs|acos|asin|atan|atn2|ceiling|cos|cot|degrees|exp|floor|log|log10|pi|power|radians|rand|round|sign|sin|sqrt|square|tan)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.metadata.sql"}},"match":"(?i)\\\\b(app_name|applock_mode|applock_test|assemblyproperty|col_length|col_name|columnproperty|database_principal_id|databasepropertyex|db_id|db_name|file_id|file_idex|file_name|filegroup_id|filegroup_name|filegroupproperty|fileproperty|fulltextcatalogproperty|fulltextserviceproperty|index_col|indexkey_property|indexproperty|object_definition|object_id|object_name|object_schema_name|objectproperty|objectpropertyex|original_db_name|parsename|schema_id|schema_name|scope_identity|serverproperty|stats_date|type_id|type_name|typeproperty)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.ranking.sql"}},"match":"(?i)\\\\b(rank|dense_rank|ntile|row_number)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.rowset.sql"}},"match":"(?i)\\\\b(generate_series|opendatasource|openjson|openrowset|openquery|openxml|predict|string_split)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.security.sql"}},"match":"(?i)\\\\b(certencoded|certprivatekey|current_user|database_principal_id|has_perms_by_name|is_member|is_rolemember|is_srvrolemember|original_login|permissions|pwdcompare|pwdencrypt|schema_id|schema_name|session_user|suser_id|suser_sid|suser_sname|system_user|suser_name|user_id|user_name)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.string.sql"}},"match":"(?i)\\\\b(ascii|char|charindex|concat|difference|format|left|len|lower|ltrim|nchar|nodes|patindex|quotename|replace|replicate|reverse|right|rtrim|soundex|space|str|string_agg|string_escape|string_split|stuff|substring|translate|trim|unicode|upper)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.system.sql"}},"match":"(?i)\\\\b(binary_checksum|checksum|compress|connectionproperty|context_info|current_request_id|current_transaction_id|decompress|error_line|error_message|error_number|error_procedure|error_severity|error_state|formatmessage|get_filestream_transaction_context|getansinull|host_id|host_name|isnull|isnumeric|min_active_rowversion|newid|newsequentialid|rowcount_big|session_context|session_id|xact_state)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.textimage.sql"}},"match":"(?i)\\\\b(patindex|textptr|textvalid)\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"support.function.vector.sql"}},"match":"(?i)\\\\b(vector_(?:distance|norm|normalize))\\\\b\\\\s*\\\\("},{"captures":{"1":{"name":"constant.other.database-name.sql"},"2":{"name":"constant.other.table-name.sql"}},"match":"(\\\\w+?)\\\\.(\\\\w+)"},{"include":"#strings"},{"include":"#regexps"},{"match":"\\\\b(?i)(abort|abort_after_wait|absent|absolute|accent_sensitivity|acceptable_cursopt|acp|action|activation|add|address|admin|aes_128|aes_192|aes_256|affinity|after|aggregate|algorithm|all_constraints|all_errormsgs|all_indexes|all_levels|all_results|allow_connections|allow_dup_row|allow_encrypted_value_modifications|allow_page_locks|allow_row_locks|allow_snapshot_isolation|alter|altercolumn|always|anonymous|ansi_defaults|ansi_null_default|ansi_null_dflt_off|ansi_null_dflt_on|ansi_nulls|ansi_padding|ansi_warnings|appdomain|append|application|apply|arithabort|arithignore|array|assembly|asymmetric|asynchronous_commit|at|atan2|atomic|attach|attach_force_rebuild_log|attach_rebuild_log|audit|auth_realm|authentication|auto|auto_cleanup|auto_close|auto_create_statistics|auto_drop|auto_shrink|auto_update_statistics|auto_update_statistics_async|automated_backup_preference|automatic|autopilot|availability|availability_mode|backup|backup_priority|base64|basic|batches|batchsize|before|between|bigint|binary|binding|bit|block|blockers|blocksize|bmk|both|break|broker|broker_instance|bucket_count|buffer|buffercount|bulk_logged|by|call|caller|card|case|catalog|catch|cert|certificate|change_retention|change_tracking|change_tracking_context|changes|char|character|character_set|check_expiration|check_policy|checkconstraints|checkindex|checkpoint|checksum|cleanup_policy|clear|clear_port|close|clustered|codepage|collection|column_encryption_key|column_master_key|columnstore|columnstore_archive|colv_80_to_100|colv_100_to_80|commit_differential_base|committed|compatibility_level|compress_all_row_groups|compression|compression_delay|concat_null_yields_null|concatenate|configuration|connect|connection|containment|continue|continue_after_error|contract|contract_name|control|conversation|conversation_group_id|conversation_handle|copy|copy_only|count_rows|counter|create(\\\\\\\\s+or\\\\\\\\s+alter)?|credential|cross|cryptographic|cryptographic_provider|cube|cursor|cursor_close_on_commit|cursor_default|data|data_compression|data_flush_interval_seconds|data_mirroring|data_purity|data_source|database|database_name|database_snapshot|datafiletype|date_correlation_optimization|date|datefirst|dateformat|date_format|datetime2??|datetimeoffset|day(s)?|db_chaining|dbid|dbidexec|dbo_only|deadlock_priority|deallocate|dec|decimal|declare|decrypt|decrypt_a|decryption|default_database|default_fulltext_language|default_language|default_logon_domain|default_schema|definition|delay|delayed_durability|delimitedtext|density_vector|dependent|des|description|desired_state|desx|differential|digest|disable|disable_broker|disable_def_cnst_chk|disabled|disk|distinct|distributed|distribution|drop|drop_existing|dts_buffers|dump|durability|dynamic|edition|elements|else|emergency|empty|enable|enable_broker|enabled|encoding|encrypted|encrypted_value|encryption|encryption_type|end|endpoint|endpoint_url|enhancedintegrity|entry|error_broker_conversations|errorfile|estimateonly|event|except|exec|executable|execute|exists|expand|expiredate|expiry_date|explicit|external|external_access|failover|failover_mode|failure_condition_level|fast|fast_forward|fastfirstrow|federated_service_account|fetch|field_terminator|fieldterminator|file|filelistonly|filegroup|filegrowth|filename|filestream|filestream_log|filestream_on|filetable|file_format|filter|first_row|fips_flagger|fire_triggers|first|firstrow|float|flush_interval_seconds|fmtonly|following|for|force|force_failover_allow_data_loss|force_service_allow_data_loss|forced|forceplan|formatfile|format_options|format_type|formsof|forward_only|free_cursors|free_exec_context|fullscan|fulltext|fulltextall|fulltextkey|function|generated|get|geography|geometry|global|go|goto|governor|guid|hadoop|hardening|hash|hashed|header_limit|headeronly|health_check_timeout|hidden|hierarchyid|histogram|histogram_steps|hits_cursors|hits_exec_context|hour(s)?|http|identity|identity_value|if|ifnull|ignore|ignore_constraints|ignore_dup_key|ignore_dup_row|ignore_triggers|image|immediate|implicit_transactions|include|include_null_values|incremental|index|inflectional|init|initiator|insensitive|insert|instead|int|integer|integrated|intersect|intermediate|interval_length_minutes|into|inuse_cursors|inuse_exec_context|io|is|isabout|iso_week|isolation|job_tracker_location|json|keep|keep_nulls|keep_replication|keepdefaults|keepfixed|keepidentity|keepnulls|kerberos|key|key_path|key_source|key_store_provider_name|keyset|kill|kilobytes_per_batch|labelonly|langid|language|last|lastrow|leading|legacy_cardinality_estimation|length|level|lifetime|lineage_80_to_100|lineage_100_to_80|listener_ip|listener_port|load|loadhistory|lob_compaction|local|local_service_name|locate|location|lock_escalation|lock_timeout|lockres|log|login|login_type|loop|manual|mark_in_use_for_removal|masked|master|match|matched|max_queue_readers|max_duration|max_outstanding_io_per_volume|maxdop|maxerrors|maxlength|maxtransfersize|max_plans_per_query|max_storage_size_mb|mediadescription|medianame|mediapassword|memogroup|memory_optimized|merge|message|message_forward_size|message_forwarding|microsecond|millisecond|minute(s)?|mirror_address|misses_cursors|misses_exec_context|mixed|modify|money|month|move|multi_user|must_change|name|namespace|nanosecond|native|native_compilation|nchar|ncharacter|nested_triggers|never|new_account|new_broker|newname|next|no|no_browsetable|no_checksum|no_compression|no_infomsgs|no_triggers|no_truncate|nocount|noexec|noexpand|noformat|noinit|nolock|nonatomic|nonclustered|nondurable|none|norecompute|norecovery|noreset|norewind|noskip|not|notification|nounload|now|nowait|ntext|ntlm|nulls|numeric|numeric_roundabort|nvarchar|object|objid|oem|offline|old_account|online|operation_mode|open|openjson|optimistic|option|orc|out|outer|output|over|override|owner|ownership|pad_index|page|page_checksum|page_verify|pagecount|paglock|param|parameter_sniffing|parameter_type_expansion|parameterization|parquet|parseonly|partial|partition|partner|password|path|pause|percentage|permission_set|persisted|period|physical_only|plan_forcing_mode|policy|pool|population|ports|preceding|precision|predicate|presume_abort|primary|primary_role|print|prior|priority |priority_level|private|proc(edure)?|procedure_name|profile|provider|quarter|query_capture_mode|query_governor_cost_limit|query_optimizer_hotfixes|query_store|queue|quoted_identifier|raiserror|range|raw|rcfile|rc2|rc4|rc4_128|rdbms|read_committed_snapshot|read|read_only|read_write|readcommitted|readcommittedlock|readonly|readpast|readuncommitted|readwrite|real|rebuild|receive|recmodel_70backcomp|recompile|reconfigure|recovery|recursive|recursive_triggers|redo_queue|reject_sample_value|reject_type|reject_value|relative|remote|remote_data_archive|remote_proc_transactions|remote_service_name|remove|removed_cursors|removed_exec_context|reorganize|repeat|repeatable|repeatableread|replace|replica|replicated|replnick_100_to_80|replnickarray_80_to_100|replnickarray_100_to_80|required|required_cursopt|resample|reset|resource|resource_manager_location|respect|restart|restore|restricted_user|resume|retaindays|retention|return|revert|rewind|rewindonly|returns|robust|role|rollup|root|round_robin|route|row|rowdump|rowguidcol|rowlock|row_terminator|rows|rows_per_batch|rowsets_only|rowterminator|rowversion|rsa_1024|rsa_2048|rsa_3072|rsa_4096|rsa_512|safe|safety|sample|save|scalar|schema|schemabinding|scoped|scroll|scroll_locks|sddl|second|secexpr|seconds|secondary|secondary_only|secondary_role|secret|security|securityaudit|selective|self|send|sent|sequence|serde_method|serializable|server|service|service_broker|service_name|service_objective|session_timeout|sessions??|seterror|setopts|sets|shard_map_manager|shard_map_name|sharded|shared_memory|shortest_path|show_statistics|showplan_all|showplan_text|showplan_xml|showplan_xml_with_recompile|shrinkdb|shutdown|sid|signature|simple|single_blob|single_clob|single_nclob|single_user|singleton|site|size|size_based_cleanup_mode|skip|smalldatetime|smallint|smallmoney|snapshot|snapshot_import|snapshotrestorephase|soap|softnuma|sort_in_tempdb|sorted_data|sorted_data_reorg|spatial|sql|sql_bigint|sql_binary|sql_bit|sql_char|sql_date|sql_decimal|sql_double|sql_float|sql_guid|sql_handle|sql_longvarbinary|sql_longvarchar|sql_numeric|sql_real|sql_smallint|sql_time|sql_timestamp|sql_tinyint|sql_tsi_day|sql_tsi_frac_second|sql_tsi_hour|sql_tsi_minute|sql_tsi_month|sql_tsi_quarter|sql_tsi_second|sql_tsi_week|sql_tsi_year|sql_type_date|sql_type_time|sql_type_timestamp|sql_varbinary|sql_varchar|sql_variant|sql_wchar|sql_wlongvarchar|ssl|ssl_port|standard|standby|start|start_date|started|stat_header|state|statement|static|statistics|statistics_incremental|statistics_norecompute|statistics_only|statman|stats|stats_stream|status|stop|stop_on_error|stopat|stopatmark|stopbeforemark|stoplist|stopped|string_delimiter|subject|supplemental_logging|supported|suspend|symmetric|synchronous_commit|synonym|sysname|system|system_time|system_versioning|table|tableresults|tablockx??|take|tape|target|target_index|target_partition|target_recovery_time|tcp|temporal_history_retention|text|textimage_on|then|thesaurus|throw|time|timeout|timestamp|tinyint|top??|torn_page_detection|track_columns_updated|trailing|tran|transaction|transfer|transform_noise_words|triple_des|triple_des_3key|truncate|trustworthy|try|tsql|two_digit_year_cutoff|type|type_desc|type_warning|tzoffset|uid|unbounded|uncommitted|unique|uniqueidentifier|unlimited|unload|unlock|unsafe|updlock|url|use|useplan|useroptions|use_type_default|using|utcdatetime|valid_xml|validation|values??|varbinary|varchar|vector|verbose|verifyonly|version|view_metadata|virtual_device|visiblity|wait_at_low_priority|waitfor|webmethod|week|weekday|weight|well_formed_xml|when|while|widechar|widechar_ansi|widenative|windows??|with|within|within group|witness|without|without_array_wrapper|workload|wsdl|xact_abort|xlock|xml|xmlschema|xquery|xsinil|year|zone)\\\\b","name":"keyword.other.sql"},{"captures":{"1":{"name":"punctuation.section.scope.begin.sql"},"2":{"name":"punctuation.section.scope.end.sql"}},"match":"(\\\\()(\\\\))","name":"meta.block.sql"}],"repository":{"comment-block":{"begin":"/\\\\*","captures":{"0":{"name":"punctuation.definition.comment.sql"}},"end":"\\\\*/","name":"comment.block","patterns":[{"include":"#comment-block"}]},"comments":{"patterns":[{"begin":"(^[\\\\t ]+)?(?=--)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.sql"}},"end":"(?!\\\\G)","patterns":[{"begin":"--","beginCaptures":{"0":{"name":"punctuation.definition.comment.sql"}},"end":"\\\\n","name":"comment.line.double-dash.sql"}]},{"begin":"(^[\\\\t ]+)?(?=#)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.sql"}},"end":"(?!\\\\G)","patterns":[]},{"include":"#comment-block"}]},"regexps":{"patterns":[{"begin":"/(?=\\\\S.*/)","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.sql"}},"end":"/","endCaptures":{"0":{"name":"punctuation.definition.string.end.sql"}},"name":"string.regexp.sql","patterns":[{"include":"#string_interpolation"},{"match":"\\\\\\\\/","name":"constant.character.escape.slash.sql"}]},{"begin":"%r\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.sql"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.string.end.sql"}},"name":"string.regexp.modr.sql","patterns":[{"include":"#string_interpolation"}]}]},"string_escape":{"match":"\\\\\\\\.","name":"constant.character.escape.sql"},"string_interpolation":{"captures":{"1":{"name":"punctuation.definition.string.begin.sql"},"3":{"name":"punctuation.definition.string.end.sql"}},"match":"(#\\\\{)([^}]*)(})","name":"string.interpolated.sql"},"strings":{"patterns":[{"captures":{"2":{"name":"punctuation.definition.string.begin.sql"},"3":{"name":"punctuation.definition.string.end.sql"}},"match":"(?:(?<![0-9A-Z_a-z])(N))?(')[^']*(')","name":"string.quoted.single.sql"},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.sql"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.sql"}},"name":"string.quoted.single.sql","patterns":[{"include":"#string_escape"}]},{"captures":{"1":{"name":"punctuation.definition.string.begin.sql"},"2":{"name":"punctuation.definition.string.end.sql"}},"match":"(\`)[^\\\\\\\\\`]*(\`)","name":"string.quoted.other.backtick.sql"},{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.sql"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.string.end.sql"}},"name":"string.quoted.other.backtick.sql","patterns":[{"include":"#string_escape"}]},{"captures":{"1":{"name":"punctuation.definition.string.begin.sql"},"2":{"name":"punctuation.definition.string.end.sql"}},"match":"(\\")[^\\"#]*(\\")","name":"string.quoted.double.sql"},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.sql"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.sql"}},"name":"string.quoted.double.sql","patterns":[{"include":"#string_interpolation"}]},{"begin":"%\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.sql"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.string.end.sql"}},"name":"string.other.quoted.brackets.sql","patterns":[{"include":"#string_interpolation"}]}]}},"scopeName":"source.sql"}`))];export{e as default};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-rQGbOrwc.js";var t=e(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./bundle-mjs-DLPpRFyl.js";import{Dt as t}from"./toaster-BS2E1bhz.js";import{n,t as r}from"./utils-rQGbOrwc.js";var i=n(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),a=e();function o({to:e,active:n=!1,children:i}){return(0,a.jsx)(t,{to:e,"aria-current":n?`page`:void 0,className:r(`-mb-px flex h-8 items-center rounded-t-md border-b-2 px-3 text-[13px] font-medium`,n?`border-foreground font-semibold text-foreground`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`),children:i})}export{i as n,o as t};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{D as r,Ft as i,Lt as a,R as o,Z as s,a as c,at as l,ft as u,j as d,mt as f,n as p,r as m,tt as h,yt as g,z as _,zt as v}from"./toaster-BS2E1bhz.js";import{a as y,i as b,t as x}from"./run-header-CfVeY3uM.js";import{a as S,i as C,n as w,r as T}from"./git-toolbar-D8OPPqBP.js";import{a as E,n as D,t as O}from"./use-desktop-eHm2iTXX.js";import{a as k,i as A,o as j,r as M,s as N,t as P}from"./dialog-BEgEWFDS.js";import{C as F,L as I,c as L,d as R,u as z}from"./index-9qG98Orw.js";var B=t(n(),1),V=e=>e===`running`||e===`queued`||e===`waiting`,H=`no worktree — this task ran directly in the repo working tree`;function U(e){let t=e=>({id:`commit`,label:`Commit`,enabled:!1,reason:e});return e.hasWorktree?e.status===`running`?t(`Commit unavailable — the agent is still working in this worktree`):e.changedFiles===void 0?t(`Commit unavailable — changes are still loading`):e.changedFiles===0?t(`Commit unavailable — no changes to commit`):{id:`commit`,label:`Commit`,enabled:!0}:t(`Commit unavailable — ${H}`)}function W(e){let t=e=>({id:`push`,label:`Push`,enabled:!1,reason:e});return e.hasWorktree?e.remote===void 0?t(`Push unavailable — no remote configured`):e.branch===void 0?t(`Push unavailable — the run has no branch to push`):e.status===`running`?t(`Push unavailable — the agent is still working in this worktree`):{id:`push`,label:`Push`,enabled:!0}:t(`Push unavailable — ${H}`)}function G(e){let t=e=>({id:`create-pr`,label:`Create PR`,enabled:!1,reason:e});return!e.hasWorktree||e.branch===void 0?t(`Create PR unavailable — ${H}`):e.forge===null?t(`Create PR unavailable — no supported forge remote (GitHub) detected`):e.forge.available?V(e.status)?t(`Create PR unavailable — the run is still active; wait for the review gate`):{id:`create-pr`,label:`Create PR`,enabled:!0}:t(`Create PR unavailable — ${e.forge.reason??`the forge is unreachable`}`)}function K(e){let t=e.prUrl?{id:`view-pr`,label:`View PR`,enabled:!0,href:e.prUrl}:U(e),n=e.prUrl?[U(e),W(e)]:[W(e),G(e)],r=[];if(e.localHandoff){let t=e.hasSession?V(e.status)?{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — the session is still active in the engine`}:{id:`open-terminal`,label:`Open in terminal`,enabled:!0}:{id:`open-terminal`,label:`Open in terminal`,enabled:!1,reason:`Terminal unavailable — no agent session to resume`};r.push(t)}return{primary:t,secondary:n,menu:r}}var q=e();function J({run:e,open:t,onOpenChange:n}){let i=v(),[o,s]=(0,B.useState)(``),l=I(e),u=(0,B.useRef)(l);u.current=l,(0,B.useEffect)(()=>{t&&s(u.current)},[t]);let d=a({mutationFn:t=>h(e.id,t),onSuccess:t=>{p(`Committed ${t.sha.slice(0,7)}`),n(!1),i.invalidateQueries({queryKey:r.runs.changes(e.id)}),i.invalidateQueries({queryKey:r.runs.all})},onError:e=>p(e.message,{tone:`danger`})}),f=()=>{let e=o.trim();e.length===0||d.isPending||d.mutate(e)};return(0,q.jsx)(P,{open:t,onOpenChange:n,children:(0,q.jsxs)(M,{"data-slot":`commit-dialog`,children:[(0,q.jsxs)(j,{children:[(0,q.jsx)(N,{children:`Commit changes`}),(0,q.jsxs)(A,{children:[`Stages everything in the task's worktree (git add -A) and commits to`,` `,e.branch?(0,q.jsx)(`span`,{className:`font-mono`,children:e.branch}):`its branch`,`.`]})]}),(0,q.jsx)(L,{"data-slot":`commit-message`,"aria-label":`Commit message`,rows:3,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{F({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),f())}}),(0,q.jsxs)(k,{children:[(0,q.jsx)(c,{variant:`outline`,onClick:()=>n(!1),children:`Cancel`}),(0,q.jsx)(c,{"data-slot":`commit-confirm`,disabled:o.trim().length===0||d.isPending,onClick:f,children:d.isPending?`Committing…`:`Commit`})]})]})})}function Y(){let{id:e}=i(),t=o(e);return t.isPending?(0,q.jsx)(R,{tab:`changes`}):t.isError?(0,q.jsx)(z,{tab:`changes`,error:t.error}):(0,q.jsx)(X,{run:t.data})}function X({run:e}){let t=d(),n=_(e.id,b(e.status)),i=O(),[o,c]=(0,B.useState)(`unified`),[u,h]=(0,B.useState)(!1),[k,A]=(0,B.useState)(null),[j,M]=(0,B.useState)(!1),N=v(),P=()=>N.invalidateQueries({queryKey:r.runs.all}),F=e=>p(e.message,{tone:`danger`}),I=a({mutationFn:()=>g(e.id),onSuccess:e=>p(e.upstreamSet?`Pushed ${e.branch} to ${e.remote} (upstream set)`:`Pushed ${e.branch} to ${e.remote}`),onError:F}),L=a({mutationFn:()=>l(e.id),onSuccess:e=>{p(`Draft PR created — ${e.url}`),P()},onError:F}),R=a({mutationFn:()=>f(e.id),onError:e=>{if(e instanceof s&&e.command){navigator.clipboard.writeText(e.command).then(()=>p(`No terminal found — command copied to clipboard.`)).catch(()=>p(`Run manually: ${e.command}`));return}F(e)}}),z=n.isError&&n.error instanceof s&&n.error.status===409,V=K({status:e.status,hasWorktree:!!e.worktreePath&&!z,branch:e.branch,changedFiles:n.data?.stat.files,remote:t.data?.repo?.remote,forge:t.data?.forge??null,localHandoff:t.data?.capabilities.localHandoff??!1,hasSession:y(e)!==void 0,prUrl:e.pullRequestUrl}),H=e=>{switch(e){case`commit`:M(!0);break;case`push`:I.mutate();break;case`create-pr`:L.mutate();break;case`open-terminal`:R.mutate();break;case`view-pr`:break}},U=n.data?.files??[],W=(0,B.useMemo)(()=>T(U),[U]),G=i?o:`unified`,Y=!i||u;return(0,q.jsxs)(`div`,{"data-route":`task-changes`,className:`flex min-h-full flex-col`,children:[(0,q.jsx)(x,{run:e,tab:`changes`}),(0,q.jsx)(w,{bar:V,branch:e.branch,stat:n.data?.stat,mode:G,wrap:Y,onModeChange:c,onWrapChange:h,onAction:H}),n.isPending?(0,q.jsx)(`p`,{"data-slot":`changes-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading changes…`}):n.isError?(0,q.jsx)(m,{icon:z?(0,q.jsx)(S,{}):(0,q.jsx)(E,{}),tone:z?`neutral`:`danger`,heading:`h2`,title:z?`No changes to show`:`Could not load the changes`,subtitle:n.error.message}):U.length===0?(0,q.jsx)(m,{icon:(0,q.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`No changes yet`,subtitle:`The worktree matches its base branch. Changes appear here as the agent works.`}):(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-start gap-5 px-4 py-4 [--diff-sticky-top:10rem] md:px-6`,children:[(0,q.jsx)(`aside`,{className:`sticky top-40 hidden w-60 shrink-0 md:block lg:w-72`,children:(0,q.jsx)(C,{root:W,selected:k,onSelect:e=>{A(e),document.querySelector(`[data-slot="diff-file"][data-path="${CSS.escape(e)}"]`)?.scrollIntoView?.({block:`start`,behavior:`smooth`})}})}),(0,q.jsx)(D,{files:U,mode:G,wrap:Y,loadFileText:t=>Z(e.id,t),className:`min-w-0 flex-1`})]}),(0,q.jsx)(J,{run:e,open:j,onOpenChange:M})]})}async function Z(e,t){try{let n=await u(e,t);return n.type!==`file`||n.binary||n.tooLarge?null:n.content??null}catch{return null}}export{Y as TaskChangesRoute};
@@ -0,0 +1 @@
1
+ import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{B as r,Dt as i,Ft as a,R as o,V as s,Z as c,a as l,r as u}from"./toaster-BS2E1bhz.js";import{i as d,t as f}from"./run-header-CfVeY3uM.js";import{t as p}from"./arrow-left-BE957rJs.js";import{a as m,i as h,n as g,t as _}from"./use-desktop-eHm2iTXX.js";import{t as v}from"./search-x-CoCyl7zT.js";import{t as y}from"./triangle-alert-6su4Js5O.js";import{P as b,d as x,u as S}from"./index-9qG98Orw.js";var C=t(n(),1),w=e();function T(){let{id:e}=a(),t=o(e);return t.isPending?(0,w.jsx)(x,{tab:`changes`}):t.isError?(0,w.jsx)(S,{tab:`changes`,error:t.error}):(0,w.jsx)(E,{run:t.data})}function E({run:e}){let{sha:t}=a(),n=s(e.id,d(e.status));return(0,w.jsxs)(`div`,{"data-route":`task-commits`,className:`flex min-h-full flex-col`,children:[(0,w.jsx)(f,{run:e,tab:`commits`}),t?(0,w.jsx)(D,{runId:e.id,sha:t}):n.isPending?(0,w.jsx)(`p`,{"data-slot":`commits-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commits…`}):n.isError?(0,w.jsx)(u,{icon:(0,w.jsx)(m,{}),tone:n.error instanceof c&&n.error.status===409?`neutral`:`danger`,heading:`h2`,title:n.error instanceof c&&n.error.status===409?`No commits to show`:`Could not load the commits`,subtitle:n.error.message}):n.data.commits.length===0?(0,w.jsx)(u,{icon:(0,w.jsx)(m,{}),tone:`neutral`,heading:`h2`,title:`No commits yet`,subtitle:`This task hasn't committed anything on its branch. Autosave commits and any the agent makes appear here.`}):(0,w.jsx)(`ul`,{"data-slot":`task-commits`,className:`mx-auto flex w-full max-w-[820px] flex-col divide-y divide-border px-2 py-1 md:px-4`,children:n.data.commits.map(t=>(0,w.jsx)(`li`,{children:(0,w.jsxs)(i,{"data-slot":`commit-row`,"data-sha":t.sha,to:`/tasks/${e.id}/commits/${t.sha}`,className:`flex min-w-0 items-baseline gap-3 rounded-sm px-2 py-2.5 hover:bg-muted`,children:[(0,w.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:t.sha.slice(0,8)}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] font-medium`,children:t.subject}),(0,w.jsxs)(`span`,{className:`hidden shrink-0 text-[11px] text-soft-foreground sm:inline`,children:[t.author,` · `,t.when]})]})},t.sha))})]})}function D({runId:e,sha:t}){let n=r(e,t),a=_(),[o,s]=(0,C.useState)(`unified`),[d,f]=(0,C.useState)(!1),x=n.isError&&n.error instanceof c&&n.error.status===409,S=a?o:`unified`,T=!a||d;return(0,w.jsxs)(`section`,{"data-slot":`task-commit`,"data-sha":t,className:`mx-auto flex min-h-0 w-full max-w-[820px] flex-1 flex-col`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,w.jsx)(l,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,w.jsxs)(i,{to:`/tasks/${e}/commits`,children:[(0,w.jsx)(p,{"aria-hidden":`true`}),`All commits`]})}),n.data?(0,w.jsx)(b,{stat:n.data.stat}):null,(0,w.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,w.jsx)(h,{mode:o,wrap:d,onModeChange:s,onWrapChange:f})})]}),n.isPending?(0,w.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):n.isError?(0,w.jsx)(u,{icon:x?(0,w.jsx)(v,{}):(0,w.jsx)(y,{}),tone:x?`neutral`:`danger`,heading:`h2`,title:x?`Commit not found`:`Could not load the commit`,subtitle:n.error.message}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,w.jsx)(`h2`,{className:`text-sm font-semibold`,children:n.data.subject}),(0,w.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[n.data.author,` · `,n.data.when,` ·`,` `,(0,w.jsx)(`span`,{className:`font-mono select-all`,children:n.data.sha})]})]}),n.data.files.length===0?(0,w.jsx)(u,{icon:(0,w.jsx)(m,{}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,w.jsx)(`div`,{className:`px-4 py-4 [--diff-sticky-top:10rem] md:px-6`,children:(0,w.jsx)(g,{files:n.data.files,mode:S,wrap:T,className:`min-w-0`})})]})]})}export{T as TaskCommitsRoute};
@@ -0,0 +1,2 @@
1
+ import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{Ft as r,R as i,U as a,Z as o,r as s,wt as c}from"./toaster-BS2E1bhz.js";import{n as l,t as u}from"./utils-rQGbOrwc.js";import{t as d}from"./run-header-CfVeY3uM.js";import{n as f,t as p}from"./folder-RbRLfIX-.js";import{t as m}from"./triangle-alert-6su4Js5O.js";import{i as h,n as g,r as _}from"./highlighter-BKVEsACy.js";import{d as v,ot as y,u as b}from"./index-9qG98Orw.js";var x=l(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),S=l(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),C=l(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),w=l(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),T=l(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),E=l(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),D=t(n(),1),O=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`svg`,`bmp`,`ico`,`avif`]);function k(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:O.has(t.slice(n+1).toLowerCase())}function A(e){return e.tooLarge?`too-large`:k(e.path)?`image`:e.binary?`binary`:`text`}function j(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}var M=e();function N({runId:e,path:t,className:n}){let r=a(e,t??void 0);if(t===null)return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(s,{icon:(0,M.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from the tree to preview it here.`})});if(r.isPending)return(0,M.jsx)(F,{className:n,children:(0,M.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof o&&r.error.status===409;return(0,M.jsx)(F,{className:n,children:(0,M.jsx)(s,{icon:e?(0,M.jsx)(C,{}):(0,M.jsx)(m,{}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,M.jsx)(P,{runId:e,entry:r.data,className:n}):null}function P({runId:e,entry:t,className:n}){let r=A(t);return(0,M.jsxs)(F,{className:n,children:[(0,M.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,M.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,M.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:j(t.size)})]}),r===`image`?(0,M.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,M.jsx)(`img`,{"data-slot":`file-preview-image`,src:c(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):r===`too-large`?(0,M.jsx)(s,{icon:(0,M.jsx)(x,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${j(t.size)} — past the preview cap. Open it in your editor instead.`}):r===`binary`?(0,M.jsx)(s,{icon:(0,M.jsx)(S,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${j(t.size)} of binary data — no text preview.`}):(0,M.jsx)(R,{path:t.path,text:t.content??``})]})}function F({className:e,children:t}){return(0,M.jsx)(`section`,{"data-slot":`file-preview`,className:u(`overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var I=1500;function L(e,t){let n=(0,D.useMemo)(()=>t.split(`
2
+ `).map(e=>[{content:e}]),[t]),r=(0,D.useMemo)(()=>h(e),[e]),i=n.length>I,[a,o]=(0,D.useState)(null);return(0,D.useEffect)(()=>{if(r===null||i)return;let n=!1;return g(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:_(t,r)?.tokens??n}function R({path:e,text:t}){let n=L(e,t);return(0,M.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":h(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,M.jsxs)(`div`,{className:`flex px-4`,children:[(0,M.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,M.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}function z({runId:e,selected:t,onSelect:n}){return(0,M.jsx)(`nav`,{"data-slot":`files-tree`,"aria-label":`Worktree files`,className:`min-w-0 text-[13px]`,children:(0,M.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,M.jsx)(B,{runId:e,path:``,depth:0,selected:t,onSelect:n})})})}function B({runId:e,path:t,depth:n,selected:r,onSelect:i}){let o=a(e,t);return o.isPending?(0,M.jsx)(`li`,{"data-slot":`files-tree-loading`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${24+n*14}px`},children:`Loading…`}):o.isError?(0,M.jsx)(`li`,{"data-slot":`files-tree-error`,className:`px-1.5 py-1 text-xs text-danger`,style:{paddingLeft:`${24+n*14}px`},children:o.error.message}):o.data.type===`dir`?o.data.entries.length===0?(0,M.jsx)(`li`,{"data-slot":`files-tree-empty`,className:`px-1.5 py-1 text-xs text-soft-foreground`,style:{paddingLeft:`${24+n*14}px`},children:`Empty directory`}):(0,M.jsx)(M.Fragment,{children:o.data.entries.map(a=>a.type===`dir`?(0,M.jsx)(V,{runId:e,name:a.name,path:t===``?a.name:`${t}/${a.name}`,depth:n,selected:r,onSelect:i},a.name):(0,M.jsx)(H,{name:a.name,path:t===``?a.name:`${t}/${a.name}`,size:a.size,depth:n,selected:r,onSelect:i},a.name))}):null}function V({runId:e,name:t,path:n,depth:r,selected:i,onSelect:a}){let[o,s]=(0,D.useState)(!1);return(0,M.jsxs)(`li`,{children:[(0,M.jsxs)(`button`,{type:`button`,"data-slot":`files-dir`,"data-path":n,"data-state":o?`open`:`closed`,"aria-expanded":o,onClick:()=>s(e=>!e),className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+r*14}px`},children:[(0,M.jsx)(y,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0 transition-transform`,o&&`rotate-90`)}),(0,M.jsx)(p,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,M.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:t})]}),o?(0,M.jsx)(`ul`,{className:`flex flex-col gap-px`,children:(0,M.jsx)(B,{runId:e,path:n,depth:r+1,selected:i,onSelect:a})}):null]})}function H({name:e,path:t,size:n,depth:r,selected:i,onSelect:a}){let o=i===t,s=k(t)?T:f;return(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{type:`button`,"data-slot":`files-file`,"data-path":t,"aria-current":o?`true`:void 0,onClick:()=>a(t),className:u(`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,o?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+r*14}px`},children:[(0,M.jsx)(s,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,M.jsx)(`span`,{className:`min-w-0 truncate`,children:e}),n===void 0?null:(0,M.jsx)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] tabular-nums text-soft-foreground`,children:j(n)})]})})}function U(){let{id:e}=r(),t=i(e);return t.isPending?(0,M.jsx)(v,{tab:`files`}):t.isError?(0,M.jsx)(b,{tab:`files`,error:t.error}):(0,M.jsx)(W,{run:t.data})}function W({run:e}){let t=a(e.id,``),[n,r]=(0,D.useState)(null),i=t.isError&&t.error instanceof o&&t.error.status===409;return(0,M.jsxs)(`div`,{"data-route":`task-files`,className:`flex min-h-full flex-col`,children:[(0,M.jsx)(d,{run:e,tab:`files`}),t.isPending?(0,M.jsx)(`p`,{"data-slot":`files-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading files…`}):t.isError?(0,M.jsx)(s,{icon:i?(0,M.jsx)(w,{}):(0,M.jsx)(m,{}),tone:i?`neutral`:`danger`,heading:`h2`,title:i?`No files to browse`:`Could not load the files`,subtitle:t.error.message}):(0,M.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-stretch gap-5 px-4 py-4 md:flex-row md:items-start md:px-6`,children:[(0,M.jsx)(`aside`,{className:`w-full shrink-0 md:sticky md:top-28 md:w-60 lg:w-72`,children:(0,M.jsx)(z,{runId:e.id,selected:n,onSelect:r})}),(0,M.jsx)(N,{runId:e.id,path:n,className:`min-w-0 flex-1`})]})]})}export{U as TaskFilesRoute};
@@ -0,0 +1,5 @@
1
+ import{a as e,l as t,o as n}from"./bundle-mjs-DLPpRFyl.js";import{t as r}from"./react-dom-Ddtik4qM.js";import{D as i,Dt as a,Ft as o,G as s,K as c,Lt as l,Mt as u,R as d,Z as f,a as p,at as m,i as h,n as g,nt as _,r as v,zt as y}from"./toaster-BS2E1bhz.js";import{n as b,t as x}from"./utils-rQGbOrwc.js";import{c as S,n as C,o as w,r as T,s as E,t as D}from"./run-header-CfVeY3uM.js";import{n as O,t as ee}from"./loader-circle-BV3DO9mE.js";import{n as te,t as k}from"./trash-2-CDtxmmc8.js";import{n as ne}from"./tab-link-phWEqSBy.js";import{t as re}from"./git-pull-request-DJkAMT0f.js";import{t as ie}from"./search-x-CoCyl7zT.js";import{t as ae}from"./square-terminal-B6PZX4Qp.js";import{i as A,n as j,r as M,t as oe}from"./run-diff-C7mfxj7f.js";import{t as se}from"./markdown-CR_HLGTs.js";import{C as ce,S as le,Z as ue,c as de,ct as fe,et as pe,it as me,l as he,lt as ge,ot as N,q as _e,st as ve}from"./index-9qG98Orw.js";var ye=b(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),be=b(`corner-up-left`,[[`path`,{d:`M20 20v-7a4 4 0 0 0-4-4H4`,key:`1nkjon`}],[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}]]),xe=b(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),Se=b(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Ce=b(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),we=b(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),Te=b(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),Ee=b(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),P=t(n(),1),De=[`run-event`,`ui-event`];function Oe(e){let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let{seq:n,type:r}=t;return typeof n!=`number`||typeof r!=`string`||r===``?null:t}function ke(e){let[t,n]=(0,P.useState)([]);return(0,P.useEffect)(()=>{if(n([]),!e)return;let t=globalThis.EventSource;if(typeof t!=`function`)return;let r=0,i=null,a,o=!1,s=e=>{let t=Oe(e.data);!t||!(t.seq>r)||(r=t.seq,n(e=>[...e,t]))},c=()=>{o||a!==void 0||(a=setTimeout(()=>{a=void 0,o||l()},1500))},l=()=>{i?.close(),i=new t(`/api/runs/${encodeURIComponent(e)}/events`);for(let e of De)i.addEventListener(e,s);i.addEventListener(`error`,()=>{i?.readyState===2&&c()})},u=()=>{document.visibilityState===`visible`&&(!i||i.readyState===2)&&(clearTimeout(a),a=void 0,l())},d=()=>{clearTimeout(a),a=void 0,i?.close()},f=e=>{e.persisted&&l()};return document.addEventListener(`visibilitychange`,u),window.addEventListener(`pagehide`,d),window.addEventListener(`pageshow`,f),l(),()=>{o=!0,clearTimeout(a),document.removeEventListener(`visibilitychange`,u),window.removeEventListener(`pagehide`,d),window.removeEventListener(`pageshow`,f),i?.close()}},[e]),t}function Ae(e){let t=e.visualViewport;return t?Math.max(0,Math.round(e.innerHeight-t.height-t.offsetTop)):0}function je(e,t,n,r=250){let i=e.visualViewport;if(!i)return t(0),()=>{};let a,o=()=>{let i=Ae(e);t(i),n&&(clearTimeout(a),a=setTimeout(()=>n(i),r))};return t(Ae(e)),i.addEventListener(`resize`,o),i.addEventListener(`scroll`,o),()=>{clearTimeout(a),i.removeEventListener(`resize`,o),i.removeEventListener(`scroll`,o),t(0)}}function Me(e){let t=(0,P.useRef)(e);t.current=e,(0,P.useEffect)(()=>{let e=document.documentElement;return je(window,t=>e.style.setProperty(`--kb`,`${t}px`),e=>t.current?.(e))},[])}var Ne=t(r(),1),F=e();function Pe({src:e,alt:t=``,className:n,...r}){let[i,a]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{if(!i)return;let e=e=>{e.key===`Escape`&&a(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[i]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`img`,{...r,src:e,alt:t,loading:`lazy`,onClick:()=>a(!0),className:x(`cursor-zoom-in`,n)}),i?(0,Ne.createPortal)((0,F.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Image preview`,"data-slot":`image-lightbox`,onClick:()=>a(!1),className:`fixed inset-0 z-[100] flex cursor-zoom-out items-center justify-center bg-black/80 p-4 backdrop-blur-sm`,children:(0,F.jsx)(`img`,{src:e,alt:t,className:`max-h-full max-w-full rounded-md object-contain shadow-2xl`})}),document.body):null]})}var I=e=>e.kind===`tool`,Fe=e=>(e.toolKind===`read`||e.toolKind===`search`)&&e.status===`completed`,Ie=(e,t,n)=>`${e} ${e===1?t:n}`;function Le(e,t){let n=[];return e>0&&n.push(Ie(e,`file`,`files`)),t>0&&n.push(Ie(t,`search`,`searches`)),`Explored ${n.join(` · `)}`}function Re(e){return`${e} earlier tool call${e===1?``:`s`}`}var ze=[`Web search`,`Ran`,`Edit`,`Write`,`Read`,`Search`,`Fetch`,`Task:`];function Be(e){for(let t of ze)if(e.startsWith(`${t} `)&&e.length>t.length+1)return{verb:t===`Task:`?`Task`:t,detail:e.slice(t.length+1)};return{verb:e}}function Ve(e){let t=e.filter(e=>!(e.kind===`tool`&&e.toolKind===`plan`)),n=new Set(t.filter(I).map(e=>e.id)),r=new Map,i=[];for(let e of t){let t=(e.kind===`message`||e.kind===`reasoning`||e.kind===`tool`)&&e.parentItemId!==void 0&&e.parentItemId!==e.id&&n.has(e.parentItemId)?e.parentItemId:void 0;if(t===void 0)i.push(e);else{let n=r.get(t);n?n.push(e):r.set(t,[e])}}let a=[],o=[],s=()=>{if(o.length>=2){let e=o.filter(e=>e.toolKind===`read`).length;a.push({kind:`context-group`,id:`group:${o[0].id}`,tools:o,files:e,searches:o.length-e,label:Le(e,o.length-e)})}else for(let e of o)a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]});o=[]};for(let e of i)I(e)&&Fe(e)&&!r.has(e.id)?o.push(e):(s(),I(e)?a.push({kind:`tool-card`,id:e.id,item:e,children:r.get(e.id)??[]}):a.push({kind:`entry`,id:e.id,entry:e}));s();let c=e=>e.kind===`context-group`||e.kind===`tool-card`&&e.item.status===`completed`,l=e=>e.kind===`context-group`?e.tools.length:1,u=[],d=[],f=()=>{if(d.length>3){let e=d.slice(0,d.length-3);u.push({kind:`streak`,id:`streak:${e[0].id}`,count:e.reduce((e,t)=>e+l(t),0),blocks:e}),u.push(...d.slice(d.length-3))}else u.push(...d);d=[]};for(let e of a)c(e)?d.push(e):(f(),u.push(e));return f(),u}var L=new Map,He=(0,P.createContext)(null);function Ue(){return(0,P.useContext)(He)}function We({runId:e,children:t}){let n=(0,P.useMemo)(()=>({get:t=>L.get(e)?.get(t),set:(t,n)=>{let r=L.get(e)??new Map;r.set(t,n),L.set(e,r)}}),[e]);return(0,F.jsx)(He.Provider,{value:n,children:t})}function R(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<t}function Ge(e,t){let n=new URLSearchParams(e).get(`thread`);return n===`flat`||n===`virtual`?n:t>300?`virtual`:`flat`}var Ke=new Map;function qe(e,t){Ke.set(e,t)}function Je(e){return Ke.get(e)}var Ye=new Map;function Xe(e,t){Ye.set(e,t)}function Ze(e,t){let n=Ye.get(e);return n!==void 0&&n.rows===t?n.cache:void 0}function z({text:e,imageCount:t=0,images:n=[]}){let r=t-n.length;return(0,F.jsxs)(`div`,{"data-slot":`user-bubble`,className:`max-w-[78%] self-end rounded-2xl rounded-br-md bg-muted px-[15px] py-2.5 text-[13.5px] leading-[1.55] whitespace-pre-wrap md:max-w-[70%]`,children:[e,n.length>0?(0,F.jsx)(`span`,{"data-slot":`user-images`,className:`mt-2 flex flex-wrap justify-end gap-1.5`,children:n.map(e=>(0,F.jsx)(Pe,{src:e,alt:`attached`,className:`max-h-40 max-w-[220px] rounded-md border border-border object-contain`},e))}):null,r>0?(0,F.jsxs)(`span`,{className:`mt-1 block text-xs text-soft-foreground`,children:[r,` image`,r>1?`s`:``,` attached`]}):null]})}function Qe({text:e}){return(0,F.jsx)(`div`,{"data-slot":`assistant-message`,className:`min-w-0 text-[13.5px] leading-[1.6]`,children:(0,F.jsx)(se,{children:e})})}function $e({note:e}){return(0,F.jsxs)(`div`,{"data-slot":`note-line`,"data-tone":e.tone,className:x(`px-0.5 text-xs`,e.tone===`danger`?`text-danger`:`text-soft-foreground`),children:[e.tone===`danger`?`✗ `:`· `,e.text]})}function et({text:e}){let t=e.split(`
2
+ `,1)[0]??``,n=t.length<e.length;return(0,F.jsxs)(j,{"data-slot":`reasoning`,className:`min-w-0`,children:[(0,F.jsxs)(A,{className:`group flex w-full items-center gap-1.5 rounded-md p-0.5 text-left text-[13px] text-soft-foreground hover:text-muted-foreground`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,F.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Thinking — `,(0,F.jsx)(`em`,{className:`text-muted-foreground not-italic`,children:t}),n?`…`:``]})]}),(0,F.jsx)(M,{children:(0,F.jsx)(`div`,{className:`px-6 py-1.5 text-[13px] leading-[1.6] whitespace-pre-wrap text-soft-foreground`,children:e})})]})}var tt={read:S,edit:Te,delete:k,move:xe,search:ue,execute:ae,think:ye,fetch:Se,task:fe,plan:Ce,other:Ee},nt=e=>e.split(`
3
+ `).length;function rt({text:e,streaming:t}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(null),a=(0,P.useRef)(!0);(0,P.useEffect)(()=>{let e=i.current;t&&e&&a.current&&(e.scrollTop=e.scrollHeight)},[e,t]);let o=nt(e),s=!t&&!n&&o>12;return(0,F.jsxs)(`div`,{"data-slot":`tool-output`,"data-clamped":s?`true`:void 0,children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`div`,{ref:i,onScroll:t?e=>{a.current=R(e.currentTarget)}:void 0,className:x(`overflow-x-auto`,t&&`max-h-[216px] overflow-y-auto`,s&&`max-h-[216px] overflow-y-hidden`),children:(0,F.jsx)(`pre`,{className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre text-muted-foreground`,children:e})}),s?(0,F.jsx)(`div`,{"data-slot":`tool-output-fade`,"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-14 bg-gradient-to-b from-transparent to-card-2`}):null]}),!t&&o>12?(0,F.jsx)(`button`,{type:`button`,"data-slot":`tool-output-toggle`,onClick:()=>r(e=>!e),className:`block w-full border-t border-border/50 px-4 py-1.5 text-left text-[11px] font-medium text-soft-foreground hover:text-foreground`,children:n?`Show less`:`Show all ${o} lines`}):null]})}function it({diffs:e}){return(0,F.jsx)(F.Fragment,{children:e.map((e,t)=>(0,F.jsxs)(`div`,{"data-slot":`diff-preview`,className:`min-w-0`,children:[(0,F.jsx)(`div`,{className:`border-b border-border/50 px-4 py-1.5 font-mono text-[11px] text-soft-foreground`,children:e.path}),(0,F.jsx)(`pre`,{className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7] whitespace-pre`,children:e.unified===void 0?[...at(e.oldText).map((e,t)=>(0,F.jsxs)(`span`,{className:`block bg-diff-del px-4 text-muted-foreground`,children:[`- `,e]},`old-${t}`)),...at(e.newText).map((e,t)=>(0,F.jsxs)(`span`,{className:`block bg-diff-add px-4`,children:[`+ `,e]},`new-${t}`))]:e.unified.split(`
4
+ `).map((e,t)=>(0,F.jsx)(ot,{text:e},t))})]},`${e.path}:${t}`))})}function at(e){return e==null||e===``?[]:e.replace(/\n$/,``).split(`
5
+ `)}function ot({text:e}){return(0,F.jsx)(`span`,{className:x(`block px-4`,e.startsWith(`+`)&&`bg-diff-add`,e.startsWith(`-`)&&`bg-diff-del text-muted-foreground`,e.startsWith(`@@`)&&`text-soft-foreground`),children:e})}function st(e){return e.status===`failed`||e.toolKind===`execute`&&e.status===`running`&&e.output!==void 0}function B({item:e,nested:t=[],cacheKey:n}){let r=Ue(),[i,a]=(0,P.useState)(()=>n===void 0?null:r?.get(n)??null),o=e=>{n!==void 0&&r?.set(n,e),a(e)},s=e.status===`running`||e.status===`pending`,c=e.output!==void 0&&e.output!==``||e.error!==void 0&&e.error!==``||e.diffs!==void 0&&e.diffs.length>0||t.length>0,l=c&&(i??st(e)),{verb:u,detail:d}=Be(e.title),f=tt[e.toolKind]??Ee;return(0,F.jsxs)(j,{"data-slot":`tool-card`,"data-status":e.status,"data-kind":e.toolKind,open:l,onOpenChange:o,className:x(`min-w-0 overflow-hidden rounded-lg border bg-card`,e.status===`failed`?`border-danger/40`:`border-border`),children:[(0,F.jsxs)(A,{disabled:!c,className:`group flex min-h-[42px] w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] enabled:hover:bg-muted`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:x(`size-3.5 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`,!c&&`invisible`)}),(0,F.jsx)(f,{"aria-hidden":!0,className:x(`size-4 shrink-0`,e.status===`failed`?`text-danger`:`text-muted-foreground`)}),(0,F.jsx)(`span`,{className:x(`shrink-0 font-semibold`,s&&`shimmer`,e.status===`failed`&&`text-danger`,e.status===`declined`&&`text-muted-foreground`),children:u}),d===void 0?null:(0,F.jsx)(`code`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:d}),(0,F.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-2`,children:[s?(0,F.jsx)(ee,{role:`status`,"aria-label":`Running`,className:`size-3.5 animate-spin text-soft-foreground`}):null,e.status===`failed`?(0,F.jsx)(`span`,{className:`text-xs text-danger`,children:`failed`}):null,e.status===`declined`?(0,F.jsx)(`span`,{className:`text-xs text-soft-foreground`,children:`declined`}):null,e.toolKind===`execute`&&typeof e.exitCode==`number`?(0,F.jsx)(`span`,{"data-slot":`tool-exit`,className:x(`rounded-full px-2 py-px font-mono text-[10.5px] font-semibold`,e.exitCode===0?`bg-success/10 text-success`:`bg-danger/10 text-danger`),children:e.exitCode}):null]})]}),(0,F.jsx)(M,{children:(0,F.jsxs)(`div`,{className:`border-t border-border bg-card-2`,children:[e.error!==void 0&&e.error!==``?(0,F.jsx)(`div`,{"data-slot":`tool-error`,className:`px-4 py-3 font-mono text-xs leading-[1.7] whitespace-pre-wrap text-danger`,children:e.error}):null,e.diffs!==void 0&&e.diffs.length>0?(0,F.jsx)(it,{diffs:e.diffs}):null,e.output!==void 0&&e.output!==``?(0,F.jsx)(rt,{text:e.output,streaming:s}):null,t.length>0?(0,F.jsx)(`div`,{"data-slot":`tool-nested`,className:`flex flex-col gap-2 border-l-2 border-border py-2.5 pr-3 pl-3 ml-4 my-2`,children:t.map(e=>(0,F.jsx)(ct,{entry:e,scope:n},e.id))}):null]})})]})}function ct({entry:e,scope:t}){switch(e.kind){case`message`:return(0,F.jsx)(Qe,{text:e.text});case`reasoning`:return(0,F.jsx)(et,{text:e.text});case`tool`:return(0,F.jsx)(B,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`});case`note`:return(0,F.jsx)($e,{note:e});case`image`:return(0,F.jsx)(dt,{image:e})}}function lt({group:e,scope:t}){return(0,F.jsxs)(j,{"data-slot":`ctx-group`,className:`min-w-0`,children:[(0,F.jsxs)(A,{className:`group flex h-[34px] w-full items-center gap-2 rounded-md px-2 -mx-2 text-left text-[13px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-soft-foreground transition-transform group-data-[state=open]:rotate-90`}),e.label]}),(0,F.jsx)(M,{children:(0,F.jsx)(`div`,{className:`flex flex-col gap-1.5 pt-1.5 pl-4`,children:e.tools.map(e=>(0,F.jsx)(B,{item:e,cacheKey:t===void 0?void 0:`${t}:${e.id}`},e.id))})})]})}function ut({count:e,children:t}){return(0,F.jsxs)(j,{"data-slot":`tool-streak`,className:`min-w-0`,children:[(0,F.jsxs)(A,{className:`group flex items-center gap-1.5 rounded-md p-0.5 text-left text-xs text-soft-foreground hover:text-muted-foreground`,children:[(0,F.jsx)(N,{"aria-hidden":!0,className:`size-3.5 shrink-0 transition-transform group-data-[state=open]:rotate-90`}),Re(e)]}),(0,F.jsx)(M,{children:(0,F.jsx)(`div`,{className:`flex flex-col gap-2 pt-2`,children:t})})]})}function dt({image:e}){return(0,F.jsx)(Pe,{"data-slot":`thread-image`,src:e.url,alt:e.name??`image from the agent session`,className:`max-h-72 max-w-full self-start rounded-lg border border-border`})}var ft=new Map;function pt(){return typeof window.matchMedia!=`function`||window.matchMedia(`(min-width: 768px)`).matches}function mt(e){return{done:e.filter(e=>e.status===`completed`).length,total:e.length}}function ht(e){return e.find(e=>e.status===`in_progress`)??e.find(e=>e.status===`pending`)}function gt({runId:e,entries:t}){let[n,r]=(0,P.useState)(()=>ft.get(e)??pt());if(t.length===0)return null;let{done:i,total:a}=mt(t),o=ht(t);return(0,F.jsxs)(`section`,{"data-slot":`plan-dock`,"data-state":n?`open`:`collapsed`,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card shadow-xs`,children:[(0,F.jsx)(`div`,{"aria-hidden":!0,"data-slot":`grad-edge`,className:`h-[3px]`,style:{background:`var(--grad)`}}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(t=>(ft.set(e,!t),!t)),"aria-expanded":n,className:x(`flex w-full items-center gap-2 px-3.5 text-left text-[13px]`,n?`pt-2 pb-1.5`:`py-2`),children:[(0,F.jsx)(`span`,{className:`shrink-0 font-semibold`,children:`Plan`}),(0,F.jsxs)(`span`,{"data-slot":`plan-count`,className:`shrink-0 text-muted-foreground tabular-nums`,children:[`· `,i,`/`,a]}),!n&&o!==void 0?(0,F.jsxs)(`span`,{"data-slot":`plan-current`,className:`min-w-0 truncate text-muted-foreground`,children:[`— `,o.activeForm??o.content]}):null,(0,F.jsx)(ve,{"aria-hidden":!0,className:x(`ml-auto size-3.5 shrink-0 text-soft-foreground transition-transform`,!n&&`rotate-180`)})]}),n?(0,F.jsx)(`ul`,{"data-slot":`plan-list`,className:`flex flex-col gap-[7px] px-3.5 pb-3`,children:t.map((e,t)=>(0,F.jsx)(_t,{entry:e},`${t}:${e.content}`))}):null]})}function _t({entry:e}){return(0,F.jsxs)(`li`,{"data-slot":`plan-item`,"data-status":e.status,className:x(`flex min-h-5 min-w-0 items-center gap-2.5 text-[13px]`,e.status===`completed`&&`text-soft-foreground line-through`,e.status===`in_progress`&&`font-medium`,e.status===`pending`&&`text-muted-foreground`),children:[(0,F.jsx)(vt,{status:e.status}),(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:e.content}),e.status===`in_progress`?(0,F.jsx)(`span`,{"data-slot":`plan-tag`,className:`ml-auto shrink-0 rounded-full bg-muted px-2 py-0.5 text-[10.5px] font-semibold tracking-[0.05em] text-muted-foreground uppercase`,children:`in progress`}):null]})}function vt({status:e}){return e===`completed`?(0,F.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-success`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,opacity:`.35`}),(0,F.jsx)(`path`,{d:`m8.5 12.2 2.4 2.4 4.6-5`})]}):e===`in_progress`?(0,F.jsxs)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 animate-pulse motion-reduce:animate-none`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,F.jsx)(`circle`,{className:`stroke-pending`,cx:`12`,cy:`12`,r:`8.5`,strokeWidth:`2`}),(0,F.jsx)(`path`,{className:`fill-pending`,d:`M12 3.5 A8.5 8.5 0 0 1 12 20.5 Z`})]}):(0,F.jsx)(`svg`,{"aria-hidden":!0,className:`size-[15px] shrink-0 text-soft-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`})})}function yt({run:e}){return(0,F.jsxs)(`section`,{"data-slot":`review-panel`,"aria-label":`Review the changes`,className:`flex flex-col gap-3`,children:[(0,F.jsxs)(`div`,{"data-slot":`review-banner`,className:`flex items-center gap-2.5 rounded-md border border-violet/30 bg-violet/10 px-3.5 py-2.5`,children:[(0,F.jsx)(me,{className:`size-4 shrink-0 text-violet`,"aria-hidden":`true`}),(0,F.jsxs)(`p`,{className:`min-w-0 text-[13px]`,children:[(0,F.jsx)(`span`,{className:`font-semibold`,children:`Review the changes before anything lands.`}),` `,(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:`Read the diff, send notes back, draft a PR — or accept. Nothing merges on its own.`})]})]}),(0,F.jsx)(oe,{runId:e.id}),(0,F.jsx)(bt,{run:e})]})}function bt({run:e}){let t=y(),n=(0,P.useRef)(null),[r,a]=(0,P.useState)(``),[o,s]=(0,P.useState)(null),c=C(e.id),u=()=>t.invalidateQueries({queryKey:i.runs.all}),d=l({mutationFn:t=>_(e.id,`Review feedback:\n${t}`),onSuccess:()=>{a(``),u()},onError:e=>g(e.message,{tone:`danger`})}),h=l({mutationFn:()=>m(e.id),onSuccess:e=>{g(`Draft PR created — ${e.url}`),u()},onError:e=>{e instanceof f&&e.manual!==void 0&&s(e.manual),g(e.message,{tone:`danger`})}}),v=()=>{let e=r.trim();if(e.length===0){g(`Write what to change first.`),n.current?.focus();return}d.mutate(e)};return(0,F.jsxs)(`div`,{"data-slot":`review-actions`,className:`flex flex-col gap-2`,children:[(0,F.jsx)(de,{ref:n,"data-slot":`review-notes`,"aria-label":`Notes for the agent`,placeholder:`Notes for the agent — what should change?`,rows:2,value:r,onChange:e=>a(e.target.value),onKeyDown:e=>{ce({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),v())},className:`min-h-[52px] text-[13px]`}),(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(p,{"data-slot":`review-send-back`,variant:`outline`,size:`sm`,title:`Send the notes back into the agent's session`,disabled:d.isPending,onClick:v,children:[(0,F.jsx)(be,{"aria-hidden":`true`}),`Send back`]}),e.pullRequestUrl===void 0?(0,F.jsxs)(p,{"data-slot":`review-draft-pr`,variant:`outline`,size:`sm`,title:`Push the branch and open a draft PR`,disabled:h.isPending,onClick:()=>h.mutate(),children:[(0,F.jsx)(re,{"aria-hidden":`true`}),`Draft PR`]}):(0,F.jsx)(p,{asChild:!0,variant:`outline`,size:`sm`,children:(0,F.jsxs)(`a`,{"data-slot":`pr-link`,href:e.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,title:`The PR for this task is already open`,children:[(0,F.jsx)(ne,{"aria-hidden":`true`}),`PR ↗`]})}),(0,F.jsxs)(p,{"data-slot":`review-accept`,variant:`contrast`,size:`sm`,className:`ml-auto`,title:T(`review`),disabled:c.isPending,onClick:()=>c.mutate(),children:[(0,F.jsx)(O,{"aria-hidden":`true`}),`Accept`]})]}),o===null?null:(0,F.jsx)(xt,{command:o})]})}function xt({command:e}){return(0,F.jsxs)(`button`,{type:`button`,"data-slot":`review-manual`,title:`Copy the command`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>g(`Command copied to clipboard.`)).catch(()=>g(`Run manually: ${e}`))},className:`flex w-full min-w-0 items-center gap-1.5 rounded-sm px-1 py-0.5 text-left font-mono text-[11px] text-soft-foreground hover:bg-muted hover:text-foreground`,children:[(0,F.jsx)(te,{className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,F.jsxs)(`span`,{className:`truncate`,children:[`manual path: `,e]})]})}function St(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var Ct=1500;function wt({status:e}){let t=(0,P.useRef)(e),[n,r]=(0,P.useState)(!1);return(0,P.useEffect)(()=>{let n=t.current;if(t.current=e,n!==`review`||e!==`done`||St())return;r(!0);let i=setTimeout(()=>r(!1),Ct);return()=>clearTimeout(i)},[e]),n?(0,F.jsxs)(`div`,{"data-slot":`accept-celebration`,"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 isolate z-40`,children:[(0,F.jsx)(h,{}),(0,F.jsx)(`div`,{className:`flex justify-center pt-24`,children:(0,F.jsx)(`span`,{className:`rounded-full border border-violet/30 bg-violet/15 px-4 py-1.5 text-[13px] font-medium text-violet shadow-modal`,children:`✓ Changes accepted`})})]}):null}var V=null,{min:H,max:U,abs:Tt,floor:Et}=Math,Dt=(e,t,n)=>H(n,U(t,e)),Ot=e=>[...e].sort((e,t)=>e-t),kt=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)},At=()=>{let e;return[new Promise(t=>{e=t}),e]},jt=e=>{let t;return()=>(e&&=(t=e(),void 0),t)},W=(e,t,n)=>{let r=n?`unshift`:`push`;for(let n=0;n<t;n++)e[r](-1);return e},Mt=(e,t)=>{let n=e.t[t];return n===-1?e.o:n},Nt=(e,t,n)=>{let r=e.t[t]===-1;return e.t[t]=n,e.i=H(t,e.i),r},G=(e,t)=>{if(!e.l)return 0;if(e.i>=t)return e.u[t];e.i<0&&(e.u[0]=0,e.i=0);let n=e.i,r=e.u[n];for(;n<t;)r+=Mt(e,n),e.u[++n]=r;return e.i=t,r},K=(e,t,n=0,r=e.l-1)=>{let i=n;for(;n<=r;){let a=Et((n+r)/2);G(e,a)<=t?(i=a,n=a+1):r=a-1}return Dt(i,0,e.l-1)},Pt=(e,t,n)=>{let r=t-e.l;return e.i=n?-1:H(t-1,e.i),e.l=t,r>0?(W(e.u,r),W(e.t,r,n),e.o*r):(e.u.splice(r),(n?e.t.splice(0,-r):e.t.splice(r)).reduce((t,n)=>t-(n===-1?e.o:n),0))},Ft=typeof window<`u`,It=e=>e.documentElement,Lt=e=>e.ownerDocument,Rt=e=>e.defaultView,zt=jt(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>0),Bt=jt(()=>`scrollBehavior`in It(document).style),Vt=e=>U(e.h(),e.p()),Ht=(e,t=40,n=0,r,i=!1)=>{let a=!!n,o=1,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=V,g=[0,a?U(n-1,0):-1],_=0,v=!1,y=((e,t,n)=>({o:t,t:n?W(n.slice(0,H(e,n.length)),U(0,e-n.length)):W([],e),l:e,i:-1,u:W([],e+1)}))(e,r?r[1]:t,r&&r[0]),b=new Set,x=()=>l-c,S=()=>x()+d+u,C=(e,t)=>((e,t,n,r)=>{if(r=H(r,e.l-1),G(e,r)<=t){let i=K(e,n,r);return[K(e,t,r,i),i]}{let i=K(e,t,void 0,r);return[i,K(e,n,i)]}})(y,e,t,g[0]),w=()=>G(y,y.l),T=(e,t)=>{let n=G(y,e)-d;return t?w()-n-E(e):n},E=e=>Mt(y,e),D=(e,t=-1)=>y.t[e]===t,O=e=>{e&&(zt()&&p!==0||h&&m===1?d+=e:u+=e)};return{v:()=>{b.clear()},m:()=>o,_:()=>(e=>[e.t.slice(),e.o])(y),S:(e=200)=>{if(!v||a)return g;let t,n;if(f)[t,n]=g;else{let r=U(0,S()),a=r+s;i||(e=U(0,e),p!==1&&(r-=e),p!==2&&(a+=e)),[t,n]=g=C(U(0,r),U(0,a)),h&&(t=H(t,h[0]),n=U(n,h[1]))}return[U(t,0),H(n,y.l-1)]},$:e=>K(y,e-c),I:D,k:T,R:E,T:()=>y.l,C:()=>l,M:()=>p!==0,p:()=>s,O:()=>c,h:w,H:()=>(f=u,u=0,[f,m===2]),W:(e,t)=>{let n=[e,t];return b.add(n),()=>{b.delete(n)}},B:(e,t)=>{let n,r,g=0;switch(e){case 1:{if(t===l&&m===0)break;let e=f;f=0;let n=t-l,i=Tt(n);e&&i<Tt(e)+1||m!==0||(p=n<0?2:1),a&&=!1,l=t,g=4;let o=x();o>=-s&&o<=w()&&(g+=1,r=i>s);break}case 2:g=8,p!==0&&(n=!0,g+=1),p=0,m=0,h=V;break;case 3:{let e=t.filter(([e,t])=>!D(e,t));if(!e.length)break;O(e.reduce((e,[t,n])=>{let r;if(m===2)r=!0;else if(h&&m===1)r=t<h[0];else{let e=x(),n=T(t),i=E(t);r=p!==1&&m===0?n+i<=e:n<e&&n+i<e+s}return r&&(e+=n-E(t)),e},0));for(let[t,n]of e){let e=E(t),r=Nt(y,t,n);i&&(_+=r?n:n-e)}i&&s&&_>s&&(O(((e,t)=>{let n=0,r=[];e.t.forEach((e,i)=>{e!==-1&&(r.push(e),i<t&&n++)}),e.i=-1;let i=Ot(r),a=i.length,o=a/2|0,s=a%2==0?(i[o-1]+i[o])/2:i[o],c=e.o;return((e.o=s)-c)*U(t-n,0)})(y,K(y,S()))),i=!1),g=3,r=!0;break}case 4:s!==t&&(s||(v=r=!0),s=t,g=3);break;case 5:t[1]?(O(Pt(y,t[0],!0)),m=2,g=1):(Pt(y,t[0]),g=1);break;case 6:c=t;break;case 7:m=1;break;case 8:h=C(t,t+s),g=1}g&&(o=1+(2147483647&o),n&&d&&(u+=d,d=0),b.forEach(([e,t])=>{g&e&&t(r)}))}}},Ut=setTimeout,Wt=(e,t)=>t?-e:e,Gt=(e,t,n,r,i,a)=>{let o=Date.now,s=0,c=!1,l=!1,u=!1,d=!1,f=(()=>{let t,n=()=>{t!=V&&clearTimeout(t)},r=()=>{n(),t=Ut(()=>{t=V,(()=>{if(c||l)return c=!1,void f();u=!1,e.B(2)})()},150)};return r.J=n,r})(),p=()=>{s=o(),u&&(d=!0),a&&e.B(6,a()),e.B(1,r()),f()},m=t=>{if(c||!e.M()||t.ctrlKey)return;let r=o()-s;150>r&&50<r&&(n?t.deltaX:t.deltaY)&&(c=!0)},h=()=>{l=!0,u=d=!1},g=()=>{l=!1,zt()&&(u=!0)};return t.addEventListener(`scroll`,p),t.addEventListener(`wheel`,m,{passive:!0}),t.addEventListener(`touchstart`,h,{passive:!0}),t.addEventListener(`touchend`,g,{passive:!0}),{A:()=>{t.removeEventListener(`scroll`,p),t.removeEventListener(`wheel`,m),t.removeEventListener(`touchstart`,h),t.removeEventListener(`touchend`,g),f.J()},L:()=>{let[t,n]=e.H();t&&(i(t,n,d),d=!1,n&&e.p()>e.h()&&e.B(1,r()))}}},Kt=(e,t,n)=>{let r;return[async(i,a)=>{if(!await t())return;r&&r();let o=()=>{let[t,n]=At();return r=()=>{n(!1)},e.p()&&Ut(r,150),[t,e.W(2,()=>{n(!0)})]};if(a&&Bt())e.B(8,i()),kt(async()=>{for(;;){let t=!0;for(let[n,r]=e.S();n<=r;n++)if(e.I(n)){t=!1;break}if(t)break;let[n,r]=o();try{if(!await n)return}finally{r()}}e.B(7),n(i(),a)});else for(;;){let[t,r]=o();try{if(e.B(7),n(i()),!await t)return}finally{r()}}},()=>{r&&r()}]},qt=(e,t)=>{let n,r,i=At(),a=!1,o=t?`scrollLeft`:`scrollTop`,s=t?`overflowX`:`overflowY`,[c,l]=Kt(e,()=>i[0],(e,r)=>{e=Wt(e,a),r?n.scrollTo({[t?`left`:`top`]:e,behavior:`smooth`}):n[o]=e});return{N(c,u){n=u,t&&(a=getComputedStyle(u).direction===`rtl`),r=Gt(e,u,t,()=>Wt(u[o],a),(t,n,r)=>{if(r){let e=u.style,t=e[s];e[s]=`hidden`,Ut(()=>{e[s]=t})}u[o]=Wt(e.C()+t,a),n&&l()}),i[1](!0)},v(){r&&r.A(),i[1](!1),i=At()},P:()=>a,V(e){c(()=>e)},X(t){t+=e.C(),c(()=>t)},Y(t,{align:n,smooth:r,offset:i=0}={}){if(t=Dt(t,0,e.T()-1),n===`nearest`){let r=e.k(t),i=e.C();if(r<i)n=`start`;else{if(!(r+e.R(t)>i+e.p()))return;n=`end`}}c(()=>i+e.O()+e.k(t)+(n===`end`?e.R(t)-e.p():n===`center`?(e.R(t)-e.p())/2:0),r)},q:()=>{r&&r.L()}}},Jt=e=>{let t;return{j(n){(t||=new(Rt(Lt(n))).ResizeObserver(e)).observe(n)},D(e){t.unobserve(e)},A(){t&&t.disconnect()}}},Yt=(e,t)=>{let n,r=t?`width`:`height`,i=new WeakMap,a=Jt(t=>{let a=[];for(let{target:o,contentRect:s}of t)if(o.offsetParent)if(o===n)e.B(4,s[r]);else{let e=i.get(o);e!=V&&a.push([e,s[r]])}a.length&&e.B(3,a)});return{G(e){a.j(n=e)},U:(e,t)=>(i.set(e,t),a.j(e),()=>{i.delete(e),a.D(e)}),v:a.A}},q=Ft?P.useLayoutEffect:P.useEffect,J=`current`,Xt=(e,t)=>{if(Array.isArray(e))for(let n of e)Xt(n,t);else e==null||typeof e==`boolean`||t.push(e)},Zt=(e,t)=>e.key??`_`+t,Qt=e=>{let t=(0,P.useRef)(null);return t[J]||(t[J]=e())},$t=e=>{let t=(0,P.useRef)(e);return q(()=>{t[J]=e},[e]),t},en=(0,P.memo)(({Z:e,ee:t,te:n,oe:r,ne:i,re:a,se:o,ie:s})=>{let c=(0,P.useRef)(null);q(()=>t(c[J],n),[n]);let l=(0,P.useMemo)(()=>{let e={contain:`layout style`,position:i&&s?void 0:`absolute`,[o?`height`:`width`]:`100%`,[o?`top`:`left`]:0,[o?`left`:`top`]:r,visibility:!i||s?void 0:`hidden`};return o&&(e.display=`inline-flex`),e},[r,i,s,o]);return(0,F.jsx)(a,typeof a==`string`?{ref:c,style:l,children:e}:{ref:c,style:l,index:n,children:e})}),tn=(e,t)=>(0,P.useMemo)(()=>{if(typeof e==`function`)return[n=>e(t[n],n),t.length];let n=(e=>{let t=[];return Xt(e,t),t})(e);return[e=>n[e],n.length]},[e,t]),nn=(0,P.forwardRef)(({children:e,data:t,bufferSize:n,itemSize:r,shift:i,horizontal:a,keepMounted:o,cache:s,startMargin:c=0,ssrCount:l,as:u=`div`,item:d=`div`,scrollRef:f,onScroll:p,onScrollEnd:m},h)=>{let[g,_]=tn(e,t),v=(0,P.useRef)(null),y=(0,P.useRef)(!!l),b=$t(p),x=$t(m),[S,C,w,T]=Qt(()=>{let e=!!a,t=Ht(_,r,l,s,!r);return[t,Yt(t,e),qt(t,e),e]});_!==S.T()&&S.B(5,[_,i]),c!==S.O()&&S.B(6,c);let[E,D]=(0,P.useReducer)(S.m,void 0,S.m),O=S.M(),ee=S.h(),te=w.P(),k=[],ne=e=>{let t=g(e);return(0,F.jsx)(en,{ee:C.U,te:e,oe:S.k(e,te),ne:S.I(e),re:d,Z:t,se:T,ie:y[J]},Zt(t,e))};if(q(()=>{y[J]=!1,S.W(1,e=>{e?(0,Ne.flushSync)(D):D()}),S.W(4,()=>{b[J]&&b[J](S.C())}),S.W(8,()=>{x[J]&&x[J]()});let e=v[J],t=t=>{C.G(t),w.N(e,t)};return f?kt(()=>{f[J]&&t(f[J])}):t(e.parentElement),()=>{S.v(),C.v(),w.v()}},[]),q(()=>{w.q()},[E]),(0,P.useImperativeHandle)(h,()=>({get cache(){return S._()},get scrollOffset(){return S.C()},get scrollSize(){return Vt(S)},get viewportSize(){return S.p()},findItemIndex:S.$,getItemOffset:S.k,getItemSize:S.R,scrollToIndex:w.Y,scrollTo:w.V,scrollBy:w.X}),[]),o){let e=new Set(o);for(let[t,r]=S.S(n);t<=r;t++)e.add(t);Ot([...e]).forEach(e=>{k.push(ne(e))})}else for(let[e,t]=S.S(n);e<=t;e++)k.push(ne(e));return(0,F.jsx)(u,{ref:v,style:{contain:`size style`,overflowAnchor:`none`,flex:`none`,position:`relative`,width:T?ee:`100%`,height:T?`100%`:ee,pointerEvents:O?`none`:void 0},children:k})});function rn(e){let t=(0,P.useRef)(null),[n,r]=(0,P.useState)(null),[i,a]=(0,P.useState)(!1),o=(0,P.useRef)(!0),s=(0,P.useRef)(null),c=(0,P.useRef)(null),l=(0,P.useRef)(null),u=(0,P.useCallback)(e=>{r(e),e&&(t.current=e.closest(`[data-slot="main"]`))},[]),d=(0,P.useCallback)(e=>{let n=t.current;if(!n)return;let r=l.current;r?r.scrollTo(e):n.scrollTop=e},[]),f=(0,P.useCallback)(()=>{let e=t.current;e&&d(e.scrollHeight-e.clientHeight)},[d]),p=(0,P.useCallback)(()=>{o.current&&f()},[f]),m=(0,P.useCallback)(()=>{let e=t.current;e&&(s.current=null,o.current=!0,e.scrollTo({top:e.scrollHeight-e.clientHeight,behavior:`smooth`}))},[]);return(0,P.useEffect)(()=>{let r=t.current,i=n;if(!r||!i)return;if(c.current!==e){c.current=e;let t=Je(e);t&&!t.atBottom?(o.current=!1,s.current=t.top,r.scrollTop=t.top):(o.current=!0,f())}let l=0,u=null,p=()=>{s.current=null,o.current=!1,l=0},m=()=>{l=Date.now()},h=e=>{e.deltaY<0?p():m()},g=e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)?p():[`ArrowDown`,`PageDown`,`End`].includes(e.key)&&m()},_=()=>{R(r,80)||(p(),m())},v=e=>{u=e.touches[0]?.clientY??null},y=e=>{let t=e.touches[0]?.clientY;t!==void 0&&(u!==null&&t>u+1?p():u!==null&&t<u-1&&m(),u=t)},b=()=>{let t=R(r,80);t&&s.current===null&&(o.current||Date.now()-l<2e3)&&(o.current=!0),a(!t),s.current===null&&qe(e,{top:r.scrollTop,atBottom:t})};r.addEventListener(`scroll`,b,{passive:!0}),r.addEventListener(`wheel`,h,{passive:!0}),r.addEventListener(`touchstart`,v,{passive:!0}),r.addEventListener(`touchmove`,y,{passive:!0}),r.addEventListener(`pointerdown`,_,{passive:!0}),r.addEventListener(`keydown`,g);let x;return typeof ResizeObserver<`u`&&(x=new ResizeObserver(()=>{let e=s.current;if(e!==null){let t=r.scrollHeight-r.clientHeight;d(Math.min(e,t)),t>=e&&(s.current=null)}else o.current&&f()}),x.observe(i)),()=>{r.removeEventListener(`scroll`,b),r.removeEventListener(`wheel`,h),r.removeEventListener(`touchstart`,v),r.removeEventListener(`touchmove`,y),r.removeEventListener(`pointerdown`,_),r.removeEventListener(`keydown`,g),x?.disconnect()}},[e,n,d,f]),{attachContent:u,scrollElRef:t,virtualizerRef:l,pillVisible:i,jumpToLatest:m,restickIfStuck:p}}function an({runId:e,rows:t,mode:n,controls:r}){return n===`virtual`?(0,F.jsx)(on,{runId:e,rows:t,controls:r}):(0,F.jsx)(`div`,{ref:r.attachContent,"data-slot":`thread-rows`,"data-virtualized":`false`,children:t.map(e=>(0,F.jsx)(`div`,{"data-slot":`thread-row`,className:`flex flex-col pb-3.5 [contain-intrinsic-block-size:auto_3rem] [content-visibility:auto]`,children:e.node},e.key))})}function on({runId:e,rows:t,controls:n}){let r=(0,P.useRef)(null),[i]=(0,P.useState)(()=>Ze(e,t.length)),a=(0,P.useRef)(t.length);a.current=t.length;let o=(0,P.useRef)(null),s=(0,P.useCallback)(t=>{n.virtualizerRef.current=t,t?o.current=t:o.current&&=(Xe(e,{rows:a.current,cache:o.current.cache}),null)},[e,n.virtualizerRef]),[c,l]=(0,P.useState)(0);return(0,P.useLayoutEffect)(()=>{let e=()=>{let e=r.current,t=n.scrollElRef.current;!e||!t||l(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[n.scrollElRef]),(0,F.jsx)(`div`,{ref:e=>{r.current=e,n.attachContent(e)},"data-slot":`thread-rows`,"data-virtualized":`true`,children:(0,F.jsx)(nn,{ref:s,scrollRef:n.scrollElRef,startMargin:c,...i===void 0?{}:{cache:i},children:t.map(e=>(0,F.jsx)(`div`,{"data-slot":`thread-row`,className:`flex flex-col pb-3.5`,children:e.node},e.key))})})}function sn({onJump:e}){return(0,F.jsxs)(`button`,{type:`button`,"data-slot":`jump-to-latest`,onClick:e,className:`pointer-events-auto inline-flex min-h-8 items-center gap-1.5 rounded-full border border-border bg-background px-3.5 text-xs font-medium text-muted-foreground shadow-modal hover:text-foreground`,children:[(0,F.jsx)(ge,{"aria-hidden":!0,className:`size-3.5`}),`Jump to latest`]})}var cn=120;function Y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function X(e){let t=e.replace(/\s+/g,` `).trim();return t.length>cn?`${t.slice(0,cn-1)}…`:t}function Z(e,...t){if(Y(e))for(let n of t){let t=e[n];if(typeof t==`string`&&t.trim()!==``)return X(t)}}function ln(e){if(!Y(e))return;let t=e.command;if(typeof t==`string`&&t.trim()!==``)return X(t);if(Array.isArray(t)){let e=t.filter(e=>typeof e==`string`);if(e.length>0)return X(e.join(` `))}}function un(e){if(!Y(e)||!Array.isArray(e.changes))return[];let t=[];for(let n of e.changes)Y(n)&&typeof n.path==`string`&&n.path.trim()!==``&&t.push(n.path);return t}function dn(e){return Z(e,`description`,`query`,`url`,`filePath`,`file_path`,`path`,`pattern`,`name`)}function Q(e,t){return t?`${e} ${t}`:e}function fn(e,t){let n=typeof e==`string`?e.toLowerCase():``;switch(n){case`bash`:case`commandexecution`:return{toolKind:`execute`,title:Q(`Ran`,ln(t)),subtitle:Z(t,`description`)};case`edit`:case`multiedit`:return{toolKind:`edit`,title:Q(`Edit`,Z(t,`file_path`,`filePath`,`path`))};case`write`:return{toolKind:`edit`,title:Q(`Write`,Z(t,`file_path`,`filePath`,`path`))};case`notebookedit`:return{toolKind:`edit`,title:Q(`Edit`,Z(t,`notebook_path`,`notebookPath`,`file_path`,`filePath`,`path`))};case`filechange`:{let e=un(t);return{toolKind:`edit`,title:Q(`Edit`,e.length===1?e[0]:e.length>1?`${e.length} files`:void 0)}}case`read`:return{toolKind:`read`,title:Q(`Read`,Z(t,`file_path`,`filePath`,`path`))};case`glob`:case`grep`:return{toolKind:`search`,title:Q(`Search`,Z(t,`pattern`,`query`)),subtitle:Z(t,`path`)};case`webfetch`:return{toolKind:`fetch`,title:Q(`Fetch`,Z(t,`url`))};case`websearch`:return{toolKind:`fetch`,title:Q(`Web search`,Z(t,`query`))};case`task`:{let e=Z(t,`description`,`prompt`);return{toolKind:`task`,title:e?`Task: ${e}`:`Task`,subtitle:Z(t,`subagent_type`,`subagentType`)}}case`todowrite`:case`todolist`:case`plan`:return{toolKind:`plan`,title:`Update plan`};case`mcptoolcall`:{let e=Z(t,`server`),n=Z(t,`tool`);return e&&n?{toolKind:`other`,title:`${e}.${n}`}:{toolKind:`other`,title:`MCP tool`,subtitle:dn(t)}}}if(n.startsWith(`mcp__`)){let t=e.split(`__`).filter(e=>e!==``);if(t.length>=3)return{toolKind:`other`,title:`${t[1]}.${t.slice(2).join(`__`)}`}}return{toolKind:`other`,title:typeof e==`string`&&e.trim()!==``?X(e):`Tool`,subtitle:dn(t)}}function pn(e){for(let t=e.turns.length-1;t>=0;--t){let n=e.turns[t].planEntries;if(n!==void 0)return n}}function mn(e){let t=[];for(let n of e.turns)for(let e of n.items)if(e.kind===`tool`){for(let n of e.locations??[])t.push(n.path);for(let n of e.diffs??[])t.push(n.path)}let n=[];for(let e=t.length-1;e>=0;--e)n.includes(t[e])||n.push(t[e]);return n}function hn(e,t){switch(e){case`waiting`:return{state:`waiting`};case`failed`:return{state:`closed`,tone:`danger`,label:t?`Session failed — ${t}`:`Session failed`};case`review`:return{state:`closed`,tone:`dim`,label:`Session closed — waiting for your review`};case`done`:case`cancelled`:return{state:`closed`,tone:`dim`,label:`Session closed`};default:return null}}function gn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $(e){return typeof e==`string`?e:void 0}function _n(e){return e.replace(/\s*CEZ:DONE\s*$/,``)}function vn(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e)}catch{return String(e)}}var yn=e=>e.kind===`message`||e.kind===`reasoning`||e.kind===`tool`,bn=new Set([`pending`,`in_progress`,`completed`]);function xn(e){if(!gn(e)||!Array.isArray(e.todos))return;let t=[];for(let n of e.todos){if(!gn(n)||typeof n.content!=`string`)return;t.push({content:n.content,status:bn.has(n.status)?n.status:`pending`,...typeof n.activeForm==`string`?{activeForm:n.activeForm}:{}})}return t}function Sn(e){let t=[],n=new Map,r,i=0,a=()=>{i+=1;let e={id:`turn-${i}`,entries:[],v2Items:!1};return t.push(e),e},o=()=>t.at(-1)??a(),s=(e,t)=>{let r={...t};if(!e.v2Items){e.v2Items=!0;for(let t of e.entries)t.origin===`v1`&&yn(t.entry)&&n.delete(t.entry.id);e.entries=e.entries.filter(e=>!(e.origin===`v1`&&yn(e.entry)))}let i=n.get(r.id);if(i&&i.turn===e){i.entry.entry=r,n.set(r.id,i);return}let a={origin:`v2`,entry:r};e.entries.push(a),n.set(r.id,{turn:e,entry:a})};for(let i of e)switch(i.type){case`user-message`:{let e=a();e.userMessage={text:$(i.text)??``,imageCount:typeof i.imageCount==`number`?i.imageCount:0,images:Array.isArray(i.images)?i.images.filter(e=>typeof e==`string`):[]};break}case`turn.started`:{let e=$(i.turnId),n=t.at(-1);n&&n.turnId===void 0&&!n.v2Items?n.turnId=e:a().turnId=e;break}case`turn.completed`:{let e=$(i.turnId),n;for(let r=t.length-1;r>=0&&!n;--r)t[r].turnId===e&&(n=t[r]);let r=n??t.at(-1);r&&(r.completed={stopReason:$(i.stopReason)??`end_turn`,...typeof i.costUsd==`number`?{costUsd:i.costUsd}:{}});break}case`item.started`:case`item.updated`:case`item.completed`:{if(!gn(i.item))break;let e=i.item.kind,t=i.item.id;if(e!==`message`&&e!==`reasoning`&&e!==`tool`||typeof t!=`string`||t===``)break;let r=i.item;s(n.get(r.id)?.turn??o(),r);break}case`item.delta`:{let e=n.get($(i.itemId)??``),t=$(i.delta)??``;if(!e||t===``||!yn(e.entry.entry))break;let r=e.entry.entry;i.field===`output`&&r.kind===`tool`?r.output=(r.output??``)+t:i.field!==`output`&&r.kind!==`tool`&&(r.text+=t);break}case`text`:{let e=o();if(e.v2Items)break;let t=$(i.text)??``;if(t===``)break;e.entries.push({origin:`v1`,entry:{kind:`message`,id:`v1:${i.seq}`,role:`assistant`,text:t}});break}case`tool-call`:{let e=o();if(e.v2Items)break;let t=$(i.tool)??`Tool`,r=fn(t,i.input);if(r.toolKind===`plan`){let t=xn(i.input);t!==void 0&&(e.planEntries=t)}let a={kind:`tool`,id:$(i.id)??`v1:${i.seq}`,name:t,toolKind:r.toolKind,title:r.title,status:`running`,input:i.input},s={origin:`v1`,entry:a};e.entries.push(s),n.set(a.id,{turn:e,entry:s});break}case`tool-result`:{let e=n.get($(i.toolCallId)??``);if(!e||e.turn.v2Items||e.entry.origin!==`v1`)break;let t=e.entry.entry;if(t.kind!==`tool`)break;t.status=`completed`,t.output=vn(i.result);break}case`note`:case`lifecycle`:{let e=$(i.message)??``;if(e===``)break;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v1:${i.seq}`,text:e,tone:`dim`}});break}case`error`:{let e=$(i.message)??``;if(e===``)break;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v1:${i.seq}`,text:e,tone:`danger`}});break}case`session.error`:{let e=$(i.message)??``;if(e===``)break;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v2:${i.seq}`,text:e,tone:`danger`}});break}case`step-end`:{if(i.status!==`failed`)break;let e=$(i.error)?` — ${$(i.error)}`:``;o().entries.push({origin:`meta`,entry:{kind:`note`,id:`v1:${i.seq}`,text:`step ${$(i.stepId)??`?`} failed${e}`,tone:`danger`}});break}case`check-output`:{let e=$(i.command)??`check`,t=typeof i.exitCode==`number`?i.exitCode:-1,n={kind:`tool`,id:`v1:${i.seq}`,name:`check`,toolKind:`execute`,title:`Ran ${e}`,status:t===0?`completed`:`failed`,output:$(i.text)??``,exitCode:t};o().entries.push({origin:`meta`,entry:n});break}case`image`:{let e=$(i.url);if(e===void 0)break;let t={kind:`image`,id:`v1:${i.seq}`,url:e},n=$(i.name);n!==void 0&&(t.name=n),o().entries.push({origin:`meta`,entry:t});break}case`plan.updated`:Array.isArray(i.entries)&&(o().planEntries=i.entries);break;case`session.ended`:r={reason:$(i.reason)??`end_turn`,...$(i.message)===void 0?{}:{message:$(i.message)}};break;case`step-start`:case`token-usage`:case`cost`:case`turn-end`:case`done`:case`session`:break;default:break}return{turns:t.map(e=>({id:e.id,...e.turnId===void 0?{}:{turnId:e.turnId},...e.userMessage===void 0?{}:{userMessage:e.userMessage},...e.planEntries===void 0?{}:{planEntries:e.planEntries},...e.completed===void 0?{}:{completed:e.completed},items:e.entries.map(({entry:e})=>e.kind===`message`&&e.role===`assistant`?{...e,text:_n(e.text)}:e)})),...r===void 0?{}:{sessionEnded:r}}}function Cn(){let{id:e}=o(),t=d(e),n=ke(e),r=(0,P.useMemo)(()=>Sn(n),[n]);if(t.isPending)return(0,F.jsx)(he,{});if(t.isError){let e=t.error instanceof f&&t.error.status===404;return(0,F.jsx)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:(0,F.jsx)(v,{icon:e?(0,F.jsx)(ie,{}):(0,F.jsx)(we,{}),tone:e?`neutral`:`danger`,title:e?`Task not found`:`Could not load this task`,subtitle:e?`No run has this id. It may have been deleted, or the link is from another machine.`:t.error.message,actions:(0,F.jsx)(p,{asChild:!0,variant:`outline`,children:(0,F.jsx)(a,{to:`/`,children:`Back to tasks`})})})})}return(0,F.jsx)(Tn,{run:t.data,thread:r})}function wn(e,t){let n=[];e.task&&n.push({key:`task`,node:(0,F.jsx)(z,{text:e.task,images:e.taskImages??[]})});for(let e of t.turns){e.userMessage&&n.push({key:`${e.id}:user`,node:(0,F.jsx)(z,{text:e.userMessage.text,imageCount:e.userMessage.imageCount,images:e.userMessage.images})});for(let t of Ve(e.items))n.push({key:`${e.id}:${t.id}`,node:(0,F.jsx)(On,{block:t,scope:e.id})})}return n}function Tn({run:e,thread:t}){let n=hn(e.status,e.error),r=pn(t),i=r!==void 0&&r.length>0?mt(r):void 0,a=e.status===`running`||e.status===`waiting`,o=c(e.id),s=(0,P.useMemo)(()=>wn(e,t),[e,t]),{search:l}=u(),d=Ge(l,s.length),f=rn(e.id);return Me(f.restickIfStuck),(0,F.jsxs)(`div`,{"data-route":`task-thread`,className:`flex min-h-full flex-col`,children:[(0,F.jsx)(D,{run:e,planTally:i}),(0,F.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[820px] flex-1 flex-col gap-3.5 px-4 py-5 md:px-6`,children:[(0,F.jsx)(We,{runId:e.id,children:(0,F.jsx)(an,{runId:e.id,rows:s,mode:d,controls:f})}),t.turns.length===0?e.status===`queued`?(0,F.jsx)(Dn,{run:e}):(0,F.jsx)(`p`,{"data-slot":`thread-empty`,className:`py-6 text-center text-xs text-soft-foreground`,children:`No session events yet.`}):null,n&&n.state===`closed`?(0,F.jsxs)(`div`,{"data-slot":`thread-footer`,"data-state":n.state,className:x(`mt-auto flex items-center gap-2 border-t border-border pt-3 text-xs`,n.tone===`danger`?`text-danger`:`text-soft-foreground`),children:[n.label,e.pullRequestUrl?(0,F.jsx)(`a`,{"data-slot":`pr-link`,href:e.pullRequestUrl,target:`_blank`,rel:`noopener noreferrer`,className:`font-medium text-foreground underline-offset-2 hover:underline`,children:`PR ↗`}):null]}):null,e.status===`review`?(0,F.jsx)(yt,{run:e}):null]}),(0,F.jsx)(wt,{status:e.status}),(0,F.jsxs)(`div`,{"data-slot":`thread-dock`,className:`sticky bottom-[var(--kb,0px)] z-10 bg-background px-4 pt-1.5 pb-3 max-md:border-t max-md:border-border md:px-6 md:pb-4`,children:[f.pillVisible?(0,F.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 -top-12 flex justify-center`,children:(0,F.jsx)(sn,{onJump:f.jumpToLatest})}):null,(0,F.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[820px] flex-col gap-2.5`,children:[r!==void 0&&r.length>0?(0,F.jsx)(gt,{runId:e.id,entries:r},e.id):null,e.status===`waiting`?(0,F.jsxs)(`div`,{"data-slot":`paused-hint`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,F.jsx)(_e,{tone:`pending`,pulse:!0}),`The agent is paused, waiting for your reply`]}):null,(0,F.jsx)(le,{onSubmit:(e,t)=>o.mutateAsync({text:e,images:t}),disabled:!a,disabledReason:`Session closed — Continue to reopen.`,disabledAction:(0,F.jsx)(En,{run:e}),placeholder:e.status===`waiting`?`Reply — / for skills, @ for files…`:`Message the agent — / for skills, @ for files…`,autocompleteSkills:!0,quickReplies:!0,getMentionCandidates:()=>mn(t)})]})]})]})}function En({run:e}){let t=y(),n=l({mutationFn:()=>_(e.id),onSuccess:()=>t.invalidateQueries({queryKey:i.runs.all}),onError:e=>g(e.message,{tone:`danger`})});return E(e).continueRun?(0,F.jsxs)(p,{type:`button`,variant:`outline`,size:`sm`,disabled:n.isPending,onClick:()=>n.mutate(),children:[(0,F.jsx)(pe,{"aria-hidden":`true`,className:`size-3.5`}),`Continue`]}):null}function Dn({run:e}){let t=w(s().data??[],e.id);return(0,F.jsxs)(`div`,{"data-slot":`queued-state`,className:`flex flex-col items-center gap-1.5 py-10 text-center`,children:[(0,F.jsx)(_e,{tone:`pending`,pulse:!0}),(0,F.jsxs)(`p`,{className:`text-[13px] font-medium`,children:[`Waiting for a free agent slot`,t===void 0?``:` — #${t} in queue`]}),(0,F.jsxs)(`p`,{className:`text-xs text-soft-foreground`,children:[e.workflow,` · starts automatically when a slot frees up`]})]})}function On({block:e,scope:t}){switch(e.kind){case`entry`:return(0,F.jsx)(kn,{entry:e.entry,scope:t});case`tool-card`:return(0,F.jsx)(B,{item:e.item,nested:e.children,cacheKey:`${t}:${e.id}`});case`context-group`:return(0,F.jsx)(lt,{group:e,scope:t});case`streak`:return(0,F.jsx)(ut,{count:e.count,children:e.blocks.map(e=>(0,F.jsx)(On,{block:e,scope:t},e.id))})}}function kn({entry:e,scope:t}){switch(e.kind){case`message`:return e.role===`assistant`?(0,F.jsx)(Qe,{text:e.text}):(0,F.jsx)(z,{text:e.text});case`reasoning`:return(0,F.jsx)(et,{text:e.text});case`tool`:return(0,F.jsx)(B,{item:e,cacheKey:`${t}:${e.id}`});case`note`:return(0,F.jsx)($e,{note:e});case`image`:return(0,F.jsx)(dt,{image:e})}}export{Cn as TaskThreadRoute};