Spaces:
Running
Running
Add agentic artifact tools and live diagnostics
Browse filesExecute HTML artifacts in an isolated iframe, return console diagnostics, support stable-ID inspect/update/retest loops, add chart and confirmed Wikipedia search tools, and expose a tool reference in the composer.
- dist/assets/{c-B6RpAeow.js → c-CIhTMkLp.js} +0 -0
- dist/assets/{cpp-CCs_wQuL.js → cpp-D8bhkdP_.js} +0 -0
- dist/assets/{graphql-HLLLiohK.js → graphql-VDmUmWgy.js} +1 -1
- dist/assets/index-Boafd7W2.js +0 -0
- dist/assets/{index-Bi-fjd8h.css → index-CFM0yVq3.css} +0 -0
- dist/assets/index-vXLRCcU6.js +0 -0
- dist/assets/{java-BYPHYPGE.js → java-BlrE5MjW.js} +1 -1
- dist/assets/{jsx-CdSNfqbg.js → jsx-Cd5m9Jhe.js} +0 -0
- dist/assets/{lua-TZDFJ1MC.js → lua-BRXWLiLu.js} +1 -1
- dist/assets/{nginx-CeAC-n3c.js → nginx-DbLfDlGw.js} +1 -1
- dist/assets/{perl-BF4pw_93.js → perl-CkwEZZwX.js} +1 -1
- dist/assets/{php-Ck6au63W.js → php-D7zCItky.js} +0 -0
- dist/assets/{ruby-MtT2q-YK.js → ruby-DS6OgOeT.js} +0 -0
- dist/assets/{tsx-DTec1eR3.js → tsx-SWHveV8v.js} +0 -0
- dist/assets/{typescript-DS_K7jZo.js → typescript-Dwr3H4Cg.js} +0 -0
- dist/assets/{xml-D1DXoeKX.js → xml-Cpvg3MKE.js} +1 -1
- dist/index.html +2 -2
- scripts/test-artifact-csp.mjs +121 -18
- src/app/App.test.ts +52 -0
- src/app/App.tsx +51 -15
- src/app/components/ArtifactCard.tsx +62 -3
- src/app/components/ChatSurface.test.tsx +8 -0
- src/app/components/ChatSurface.tsx +38 -8
- src/app/styles.css +234 -3
- src/lib/agent-tools.test.ts +14 -4
- src/lib/agent-tools.ts +280 -48
- src/lib/artifact-runtime.ts +340 -0
- src/lib/chart-tools.test.ts +28 -0
- src/lib/chart-tools.ts +116 -0
- src/lib/tool-routing.test.ts +11 -5
- src/lib/tool-routing.ts +2 -2
- src/lib/web-search.test.ts +37 -0
- src/lib/web-search.ts +83 -0
dist/assets/{c-B6RpAeow.js → c-CIhTMkLp.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{cpp-CCs_wQuL.js → cpp-D8bhkdP_.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{graphql-HLLLiohK.js → graphql-VDmUmWgy.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import e from"./javascript-BgS3c2Ky.js";import{t}from"./typescript-DS_K7jZo.js";import{t as n}from"./jsx-CdSNfqbg.js";import{t as r}from"./tsx-DTec1eR3.js";var i=Object.freeze(JSON.parse(`{"displayName":"GraphQL","fileTypes":["graphql","graphqls","gql","graphcool"],"name":"graphql","patterns":[{"include":"#graphql"}],"repository":{"graphql":{"patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-fragment-definition"},{"include":"#graphql-directive-definition"},{"include":"#graphql-type-interface"},{"include":"#graphql-enum"},{"include":"#graphql-scalar"},{"include":"#graphql-union"},{"include":"#graphql-schema"},{"include":"#graphql-operation-def"},{"include":"#literal-quasi-embedded"}]},"graphql-ampersand":{"captures":{"1":{"name":"keyword.operator.logical.graphql"}},"match":"\\\\s*(&)"},"graphql-arguments":{"begin":"\\\\s*(\\\\()","beginCaptures":{"1":{"name":"meta.brace.round.directive.graphql"}},"end":"\\\\s*(\\\\))","endCaptures":{"1":{"name":"meta.brace.round.directive.graphql"}},"name":"meta.arguments.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"begin":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*(:)","beginCaptures":{"1":{"name":"variable.parameter.graphql"},"2":{"name":"punctuation.colon.graphql"}},"end":"(?=\\\\s*(?:([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*(:)|\\\\)))|\\\\s*(,)","endCaptures":{"3":{"name":"punctuation.comma.graphql"}},"patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-value"},{"include":"#graphql-skip-newlines"}]},{"include":"#literal-quasi-embedded"}]},"graphql-boolean-value":{"captures":{"1":{"name":"constant.language.boolean.graphql"}},"match":"\\\\s*\\\\b(true|false)\\\\b"},"graphql-colon":{"captures":{"1":{"name":"punctuation.colon.graphql"}},"match":"\\\\s*(:)"},"graphql-comma":{"captures":{"1":{"name":"punctuation.comma.graphql"}},"match":"\\\\s*(,)"},"graphql-comment":{"patterns":[{"captures":{"1":{"name":"punctuation.whitespace.comment.leading.graphql"}},"match":"(\\\\s*)(#).*","name":"comment.line.graphql.js"},{"begin":"(\\"\\"\\")","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.graphql"}},"end":"(\\"\\"\\")","name":"comment.line.graphql.js"},{"begin":"(\\")","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.graphql"}},"end":"(\\")","name":"comment.line.graphql.js"}]},"graphql-description-docstring":{"begin":"\\"\\"\\"","end":"\\"\\"\\"","name":"comment.block.graphql"},"graphql-description-singleline":{"match":"#(?=([^\\"]*\\"[^\\"]*\\")*[^\\"]*$).*$","name":"comment.line.number-sign.graphql"},"graphql-directive":{"applyEndPatternLast":1,"begin":"\\\\s*((@)\\\\s*([A-Z_a-z][0-9A-Z_a-z]*))","beginCaptures":{"1":{"name":"entity.name.function.directive.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-arguments"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-skip-newlines"}]},"graphql-directive-definition":{"applyEndPatternLast":1,"begin":"\\\\s*\\\\b(directive)\\\\b\\\\s*(@[A-Z_a-z][0-9A-Z_a-z]*)","beginCaptures":{"1":{"name":"keyword.directive.graphql"},"2":{"name":"entity.name.function.directive.graphql"},"3":{"name":"keyword.on.graphql"},"4":{"name":"support.type.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-variable-definitions"},{"applyEndPatternLast":1,"begin":"\\\\s*\\\\b(on)\\\\b\\\\s*([A-Z_a-z]*)","beginCaptures":{"1":{"name":"keyword.on.graphql"},"2":{"name":"support.type.location.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-skip-newlines"},{"include":"#graphql-comment"},{"include":"#literal-quasi-embedded"},{"captures":{"2":{"name":"support.type.location.graphql"}},"match":"\\\\s*(\\\\|)\\\\s*([A-Z_a-z]*)"}]},{"include":"#graphql-skip-newlines"},{"include":"#graphql-comment"},{"include":"#literal-quasi-embedded"}]},"graphql-enum":{"begin":"\\\\s*+\\\\b(enum)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)","beginCaptures":{"1":{"name":"keyword.enum.graphql"},"2":{"name":"support.type.enum.graphql"}},"end":"(?<=})","name":"meta.enum.graphql","patterns":[{"begin":"\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"punctuation.operation.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"punctuation.operation.graphql"}},"name":"meta.type.object.graphql","patterns":[{"include":"#graphql-object-type"},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-enum-value"},{"include":"#literal-quasi-embedded"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"}]},"graphql-enum-value":{"match":"\\\\s*(?!=\\\\b(true|false|null)\\\\b)([A-Z_a-z][0-9A-Z_a-z]*)","name":"constant.character.enum.graphql"},"graphql-field":{"patterns":[{"captures":{"1":{"name":"string.unquoted.alias.graphql"},"2":{"name":"punctuation.colon.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*(:)"},{"captures":{"1":{"name":"variable.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},{"include":"#graphql-arguments"},{"include":"#graphql-directive"},{"include":"#graphql-selection-set"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-skip-newlines"}]},"graphql-float-value":{"captures":{"1":{"name":"constant.numeric.float.graphql"}},"match":"\\\\s*(-?(0|[1-9][0-9]*)(\\\\.[0-9]+)?(([Ee])([-+])?[0-9]+)?)"},"graphql-fragment-definition":{"begin":"\\\\s*\\\\b(fragment)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)?\\\\s*\\\\b(on)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)","captures":{"1":{"name":"keyword.fragment.graphql"},"2":{"name":"entity.name.fragment.graphql"},"3":{"name":"keyword.on.graphql"},"4":{"name":"support.type.graphql"}},"end":"(?<=})","name":"meta.fragment.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-selection-set"},{"include":"#graphql-directive"},{"include":"#graphql-skip-newlines"},{"include":"#literal-quasi-embedded"}]},"graphql-fragment-spread":{"applyEndPatternLast":1,"begin":"\\\\s*(\\\\.\\\\.\\\\.)\\\\s*(?!\\\\bon\\\\b)([A-Z_a-z][0-9A-Z_a-z]*)","captures":{"1":{"name":"keyword.operator.spread.graphql"},"2":{"name":"variable.fragment.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-selection-set"},{"include":"#graphql-directive"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-skip-newlines"}]},"graphql-ignore-spaces":{"match":"\\\\s*"},"graphql-inline-fragment":{"applyEndPatternLast":1,"begin":"\\\\s*(\\\\.\\\\.\\\\.)\\\\s*(?:\\\\b(on)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*))?","captures":{"1":{"name":"keyword.operator.spread.graphql"},"2":{"name":"keyword.on.graphql"},"3":{"name":"support.type.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-selection-set"},{"include":"#graphql-directive"},{"include":"#graphql-skip-newlines"},{"include":"#literal-quasi-embedded"}]},"graphql-input-types":{"patterns":[{"include":"#graphql-scalar-type"},{"captures":{"1":{"name":"support.type.graphql"},"2":{"name":"keyword.operator.nulltype.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)(?:\\\\s*(!))?"},{"begin":"\\\\s*(\\\\[)","captures":{"1":{"name":"meta.brace.square.graphql"},"2":{"name":"keyword.operator.nulltype.graphql"}},"end":"\\\\s*(])(?:\\\\s*(!))?","name":"meta.type.list.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-input-types"},{"include":"#graphql-comma"},{"include":"#literal-quasi-embedded"}]}]},"graphql-list-value":{"patterns":[{"begin":"\\\\s*+(\\\\[)","beginCaptures":{"1":{"name":"meta.brace.square.graphql"}},"end":"\\\\s*(])","endCaptures":{"1":{"name":"meta.brace.square.graphql"}},"name":"meta.listvalues.graphql","patterns":[{"include":"#graphql-value"}]}]},"graphql-name":{"captures":{"1":{"name":"entity.name.function.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},"graphql-null-value":{"captures":{"1":{"name":"constant.language.null.graphql"}},"match":"\\\\s*\\\\b(null)\\\\b"},"graphql-object-field":{"captures":{"1":{"name":"constant.object.key.graphql"},"2":{"name":"string.unquoted.graphql"},"3":{"name":"punctuation.graphql"}},"match":"\\\\s*(([A-Z_a-z][0-9A-Z_a-z]*))\\\\s*(:)"},"graphql-object-value":{"patterns":[{"begin":"\\\\s*+(\\\\{)","beginCaptures":{"1":{"name":"meta.brace.curly.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"meta.brace.curly.graphql"}},"name":"meta.objectvalues.graphql","patterns":[{"include":"#graphql-object-field"},{"include":"#graphql-value"}]}]},"graphql-operation-def":{"patterns":[{"include":"#graphql-query-mutation"},{"include":"#graphql-name"},{"include":"#graphql-variable-definitions"},{"include":"#graphql-directive"},{"include":"#graphql-selection-set"}]},"graphql-query-mutation":{"captures":{"1":{"name":"keyword.operation.graphql"}},"match":"\\\\s*\\\\b(query|mutation)\\\\b"},"graphql-scalar":{"captures":{"1":{"name":"keyword.scalar.graphql"},"2":{"name":"entity.scalar.graphql"}},"match":"\\\\s*\\\\b(scalar)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},"graphql-scalar-type":{"captures":{"1":{"name":"support.type.builtin.graphql"},"2":{"name":"keyword.operator.nulltype.graphql"}},"match":"\\\\s*\\\\b(Int|Float|String|Boolean|ID)\\\\b(?:\\\\s*(!))?"},"graphql-schema":{"begin":"\\\\s*\\\\b(schema)\\\\b","beginCaptures":{"1":{"name":"keyword.schema.graphql"}},"end":"(?<=})","patterns":[{"begin":"\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"punctuation.operation.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"punctuation.operation.graphql"}},"patterns":[{"begin":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)(?=\\\\s*\\\\(|:)","beginCaptures":{"1":{"name":"variable.arguments.graphql"}},"end":"(?=\\\\s*(([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*([(:])|(})))|\\\\s*(,)","endCaptures":{"5":{"name":"punctuation.comma.graphql"}},"patterns":[{"captures":{"1":{"name":"support.type.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-colon"},{"include":"#graphql-skip-newlines"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-skip-newlines"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-skip-newlines"}]},"graphql-selection-set":{"begin":"\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"punctuation.operation.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"punctuation.operation.graphql"}},"name":"meta.selectionset.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-field"},{"include":"#graphql-fragment-spread"},{"include":"#graphql-inline-fragment"},{"include":"#graphql-comma"},{"include":"#native-interpolation"},{"include":"#literal-quasi-embedded"}]},"graphql-skip-newlines":{"match":"\\\\s*\\\\n"},"graphql-string-content":{"patterns":[{"match":"\\\\\\\\[\\"'/\\\\\\\\bfnrt]","name":"constant.character.escape.graphql"},{"match":"\\\\\\\\u(\\\\h{4})","name":"constant.character.escape.graphql"}]},"graphql-string-value":{"begin":"\\\\s*+((\\"))","beginCaptures":{"1":{"name":"string.quoted.double.graphql"},"2":{"name":"punctuation.definition.string.begin.graphql"}},"contentName":"string.quoted.double.graphql","end":"\\\\s*+(?:((\\"))|(\\\\n))","endCaptures":{"1":{"name":"string.quoted.double.graphql"},"2":{"name":"punctuation.definition.string.end.graphql"},"3":{"name":"invalid.illegal.newline.graphql"}},"patterns":[{"include":"#graphql-string-content"},{"include":"#literal-quasi-embedded"}]},"graphql-type-definition":{"begin":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)(?=\\\\s*\\\\(|:)","beginCaptures":{"1":{"name":"variable.graphql"}},"end":"(?=\\\\s*(([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*([(:])|(})))|\\\\s*(,)","endCaptures":{"5":{"name":"punctuation.comma.graphql"}},"patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-variable-definitions"},{"include":"#graphql-type-object"},{"include":"#graphql-colon"},{"include":"#graphql-input-types"},{"include":"#literal-quasi-embedded"}]},"graphql-type-interface":{"applyEndPatternLast":1,"begin":"\\\\s*\\\\b(?:(extends?)?\\\\b\\\\s*\\\\b(type)|(interface)|(input))\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)?","captures":{"1":{"name":"keyword.type.graphql"},"2":{"name":"keyword.type.graphql"},"3":{"name":"keyword.interface.graphql"},"4":{"name":"keyword.input.graphql"},"5":{"name":"support.type.graphql"}},"end":"(?=.)","name":"meta.type.interface.graphql","patterns":[{"begin":"\\\\s*\\\\b(implements)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.implements.graphql"}},"end":"\\\\s*(?=\\\\{)","patterns":[{"captures":{"1":{"name":"support.type.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-ampersand"},{"include":"#graphql-comma"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-type-object"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-ignore-spaces"}]},"graphql-type-object":{"begin":"\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"punctuation.operation.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"punctuation.operation.graphql"}},"name":"meta.type.object.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-object-type"},{"include":"#graphql-type-definition"},{"include":"#literal-quasi-embedded"}]},"graphql-union":{"applyEndPatternLast":1,"begin":"\\\\s*\\\\b(union)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)","captures":{"1":{"name":"keyword.union.graphql"},"2":{"name":"support.type.graphql"}},"end":"(?=.)","patterns":[{"applyEndPatternLast":1,"begin":"\\\\s*(=)\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)","captures":{"1":{"name":"punctuation.assignment.graphql"},"2":{"name":"support.type.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-skip-newlines"},{"include":"#literal-quasi-embedded"},{"captures":{"1":{"name":"punctuation.or.graphql"},"2":{"name":"support.type.graphql"}},"match":"\\\\s*(\\\\|)\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-skip-newlines"},{"include":"#literal-quasi-embedded"}]},"graphql-union-mark":{"captures":{"1":{"name":"punctuation.union.graphql"}},"match":"\\\\s*(\\\\|)"},"graphql-value":{"patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-variable-name"},{"include":"#graphql-float-value"},{"include":"#graphql-string-value"},{"include":"#graphql-boolean-value"},{"include":"#graphql-null-value"},{"include":"#graphql-enum-value"},{"include":"#graphql-list-value"},{"include":"#graphql-object-value"},{"include":"#literal-quasi-embedded"}]},"graphql-variable-assignment":{"applyEndPatternLast":1,"begin":"\\\\s(=)","beginCaptures":{"1":{"name":"punctuation.assignment.graphql"}},"end":"(?=[\\\\n),])","patterns":[{"include":"#graphql-value"}]},"graphql-variable-definition":{"begin":"\\\\s*(\\\\$?[A-Z_a-z][0-9A-Z_a-z]*)(?=\\\\s*\\\\(|:)","beginCaptures":{"1":{"name":"variable.parameter.graphql"}},"end":"(?=\\\\s*((\\\\$?[A-Z_a-z][0-9A-Z_a-z]*)\\\\s*([(:])|([)}])))|\\\\s*(,)","endCaptures":{"5":{"name":"punctuation.comma.graphql"}},"name":"meta.variables.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-colon"},{"include":"#graphql-input-types"},{"include":"#graphql-variable-assignment"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-skip-newlines"}]},"graphql-variable-definitions":{"begin":"\\\\s*(\\\\()","captures":{"1":{"name":"meta.brace.round.graphql"}},"end":"\\\\s*(\\\\))","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-variable-definition"},{"include":"#literal-quasi-embedded"}]},"graphql-variable-name":{"captures":{"1":{"name":"variable.graphql"}},"match":"\\\\s*(\\\\$[A-Z_a-z][0-9A-Z_a-z]*)"},"native-interpolation":{"begin":"\\\\s*(\\\\$\\\\{)","beginCaptures":{"1":{"name":"keyword.other.substitution.begin"}},"end":"(})","endCaptures":{"1":{"name":"keyword.other.substitution.end"}},"name":"native.interpolation","patterns":[{"include":"source.js"},{"include":"source.ts"},{"include":"source.js.jsx"},{"include":"source.tsx"}]}},"scopeName":"source.graphql","embeddedLangs":["javascript","typescript","jsx","tsx"],"aliases":["gql"]}`)),a=[...e,...t,...n,...r,i];export{a as default};
|
|
|
|
| 1 |
+
import e from"./javascript-BgS3c2Ky.js";import{t}from"./typescript-Dwr3H4Cg.js";import{t as n}from"./jsx-Cd5m9Jhe.js";import{t as r}from"./tsx-SWHveV8v.js";var i=Object.freeze(JSON.parse(`{"displayName":"GraphQL","fileTypes":["graphql","graphqls","gql","graphcool"],"name":"graphql","patterns":[{"include":"#graphql"}],"repository":{"graphql":{"patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-fragment-definition"},{"include":"#graphql-directive-definition"},{"include":"#graphql-type-interface"},{"include":"#graphql-enum"},{"include":"#graphql-scalar"},{"include":"#graphql-union"},{"include":"#graphql-schema"},{"include":"#graphql-operation-def"},{"include":"#literal-quasi-embedded"}]},"graphql-ampersand":{"captures":{"1":{"name":"keyword.operator.logical.graphql"}},"match":"\\\\s*(&)"},"graphql-arguments":{"begin":"\\\\s*(\\\\()","beginCaptures":{"1":{"name":"meta.brace.round.directive.graphql"}},"end":"\\\\s*(\\\\))","endCaptures":{"1":{"name":"meta.brace.round.directive.graphql"}},"name":"meta.arguments.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"begin":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*(:)","beginCaptures":{"1":{"name":"variable.parameter.graphql"},"2":{"name":"punctuation.colon.graphql"}},"end":"(?=\\\\s*(?:([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*(:)|\\\\)))|\\\\s*(,)","endCaptures":{"3":{"name":"punctuation.comma.graphql"}},"patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-value"},{"include":"#graphql-skip-newlines"}]},{"include":"#literal-quasi-embedded"}]},"graphql-boolean-value":{"captures":{"1":{"name":"constant.language.boolean.graphql"}},"match":"\\\\s*\\\\b(true|false)\\\\b"},"graphql-colon":{"captures":{"1":{"name":"punctuation.colon.graphql"}},"match":"\\\\s*(:)"},"graphql-comma":{"captures":{"1":{"name":"punctuation.comma.graphql"}},"match":"\\\\s*(,)"},"graphql-comment":{"patterns":[{"captures":{"1":{"name":"punctuation.whitespace.comment.leading.graphql"}},"match":"(\\\\s*)(#).*","name":"comment.line.graphql.js"},{"begin":"(\\"\\"\\")","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.graphql"}},"end":"(\\"\\"\\")","name":"comment.line.graphql.js"},{"begin":"(\\")","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.graphql"}},"end":"(\\")","name":"comment.line.graphql.js"}]},"graphql-description-docstring":{"begin":"\\"\\"\\"","end":"\\"\\"\\"","name":"comment.block.graphql"},"graphql-description-singleline":{"match":"#(?=([^\\"]*\\"[^\\"]*\\")*[^\\"]*$).*$","name":"comment.line.number-sign.graphql"},"graphql-directive":{"applyEndPatternLast":1,"begin":"\\\\s*((@)\\\\s*([A-Z_a-z][0-9A-Z_a-z]*))","beginCaptures":{"1":{"name":"entity.name.function.directive.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-arguments"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-skip-newlines"}]},"graphql-directive-definition":{"applyEndPatternLast":1,"begin":"\\\\s*\\\\b(directive)\\\\b\\\\s*(@[A-Z_a-z][0-9A-Z_a-z]*)","beginCaptures":{"1":{"name":"keyword.directive.graphql"},"2":{"name":"entity.name.function.directive.graphql"},"3":{"name":"keyword.on.graphql"},"4":{"name":"support.type.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-variable-definitions"},{"applyEndPatternLast":1,"begin":"\\\\s*\\\\b(on)\\\\b\\\\s*([A-Z_a-z]*)","beginCaptures":{"1":{"name":"keyword.on.graphql"},"2":{"name":"support.type.location.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-skip-newlines"},{"include":"#graphql-comment"},{"include":"#literal-quasi-embedded"},{"captures":{"2":{"name":"support.type.location.graphql"}},"match":"\\\\s*(\\\\|)\\\\s*([A-Z_a-z]*)"}]},{"include":"#graphql-skip-newlines"},{"include":"#graphql-comment"},{"include":"#literal-quasi-embedded"}]},"graphql-enum":{"begin":"\\\\s*+\\\\b(enum)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)","beginCaptures":{"1":{"name":"keyword.enum.graphql"},"2":{"name":"support.type.enum.graphql"}},"end":"(?<=})","name":"meta.enum.graphql","patterns":[{"begin":"\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"punctuation.operation.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"punctuation.operation.graphql"}},"name":"meta.type.object.graphql","patterns":[{"include":"#graphql-object-type"},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-enum-value"},{"include":"#literal-quasi-embedded"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"}]},"graphql-enum-value":{"match":"\\\\s*(?!=\\\\b(true|false|null)\\\\b)([A-Z_a-z][0-9A-Z_a-z]*)","name":"constant.character.enum.graphql"},"graphql-field":{"patterns":[{"captures":{"1":{"name":"string.unquoted.alias.graphql"},"2":{"name":"punctuation.colon.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*(:)"},{"captures":{"1":{"name":"variable.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},{"include":"#graphql-arguments"},{"include":"#graphql-directive"},{"include":"#graphql-selection-set"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-skip-newlines"}]},"graphql-float-value":{"captures":{"1":{"name":"constant.numeric.float.graphql"}},"match":"\\\\s*(-?(0|[1-9][0-9]*)(\\\\.[0-9]+)?(([Ee])([-+])?[0-9]+)?)"},"graphql-fragment-definition":{"begin":"\\\\s*\\\\b(fragment)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)?\\\\s*\\\\b(on)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)","captures":{"1":{"name":"keyword.fragment.graphql"},"2":{"name":"entity.name.fragment.graphql"},"3":{"name":"keyword.on.graphql"},"4":{"name":"support.type.graphql"}},"end":"(?<=})","name":"meta.fragment.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-selection-set"},{"include":"#graphql-directive"},{"include":"#graphql-skip-newlines"},{"include":"#literal-quasi-embedded"}]},"graphql-fragment-spread":{"applyEndPatternLast":1,"begin":"\\\\s*(\\\\.\\\\.\\\\.)\\\\s*(?!\\\\bon\\\\b)([A-Z_a-z][0-9A-Z_a-z]*)","captures":{"1":{"name":"keyword.operator.spread.graphql"},"2":{"name":"variable.fragment.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-selection-set"},{"include":"#graphql-directive"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-skip-newlines"}]},"graphql-ignore-spaces":{"match":"\\\\s*"},"graphql-inline-fragment":{"applyEndPatternLast":1,"begin":"\\\\s*(\\\\.\\\\.\\\\.)\\\\s*(?:\\\\b(on)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*))?","captures":{"1":{"name":"keyword.operator.spread.graphql"},"2":{"name":"keyword.on.graphql"},"3":{"name":"support.type.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-selection-set"},{"include":"#graphql-directive"},{"include":"#graphql-skip-newlines"},{"include":"#literal-quasi-embedded"}]},"graphql-input-types":{"patterns":[{"include":"#graphql-scalar-type"},{"captures":{"1":{"name":"support.type.graphql"},"2":{"name":"keyword.operator.nulltype.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)(?:\\\\s*(!))?"},{"begin":"\\\\s*(\\\\[)","captures":{"1":{"name":"meta.brace.square.graphql"},"2":{"name":"keyword.operator.nulltype.graphql"}},"end":"\\\\s*(])(?:\\\\s*(!))?","name":"meta.type.list.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-input-types"},{"include":"#graphql-comma"},{"include":"#literal-quasi-embedded"}]}]},"graphql-list-value":{"patterns":[{"begin":"\\\\s*+(\\\\[)","beginCaptures":{"1":{"name":"meta.brace.square.graphql"}},"end":"\\\\s*(])","endCaptures":{"1":{"name":"meta.brace.square.graphql"}},"name":"meta.listvalues.graphql","patterns":[{"include":"#graphql-value"}]}]},"graphql-name":{"captures":{"1":{"name":"entity.name.function.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},"graphql-null-value":{"captures":{"1":{"name":"constant.language.null.graphql"}},"match":"\\\\s*\\\\b(null)\\\\b"},"graphql-object-field":{"captures":{"1":{"name":"constant.object.key.graphql"},"2":{"name":"string.unquoted.graphql"},"3":{"name":"punctuation.graphql"}},"match":"\\\\s*(([A-Z_a-z][0-9A-Z_a-z]*))\\\\s*(:)"},"graphql-object-value":{"patterns":[{"begin":"\\\\s*+(\\\\{)","beginCaptures":{"1":{"name":"meta.brace.curly.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"meta.brace.curly.graphql"}},"name":"meta.objectvalues.graphql","patterns":[{"include":"#graphql-object-field"},{"include":"#graphql-value"}]}]},"graphql-operation-def":{"patterns":[{"include":"#graphql-query-mutation"},{"include":"#graphql-name"},{"include":"#graphql-variable-definitions"},{"include":"#graphql-directive"},{"include":"#graphql-selection-set"}]},"graphql-query-mutation":{"captures":{"1":{"name":"keyword.operation.graphql"}},"match":"\\\\s*\\\\b(query|mutation)\\\\b"},"graphql-scalar":{"captures":{"1":{"name":"keyword.scalar.graphql"},"2":{"name":"entity.scalar.graphql"}},"match":"\\\\s*\\\\b(scalar)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},"graphql-scalar-type":{"captures":{"1":{"name":"support.type.builtin.graphql"},"2":{"name":"keyword.operator.nulltype.graphql"}},"match":"\\\\s*\\\\b(Int|Float|String|Boolean|ID)\\\\b(?:\\\\s*(!))?"},"graphql-schema":{"begin":"\\\\s*\\\\b(schema)\\\\b","beginCaptures":{"1":{"name":"keyword.schema.graphql"}},"end":"(?<=})","patterns":[{"begin":"\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"punctuation.operation.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"punctuation.operation.graphql"}},"patterns":[{"begin":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)(?=\\\\s*\\\\(|:)","beginCaptures":{"1":{"name":"variable.arguments.graphql"}},"end":"(?=\\\\s*(([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*([(:])|(})))|\\\\s*(,)","endCaptures":{"5":{"name":"punctuation.comma.graphql"}},"patterns":[{"captures":{"1":{"name":"support.type.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-colon"},{"include":"#graphql-skip-newlines"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-skip-newlines"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-skip-newlines"}]},"graphql-selection-set":{"begin":"\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"punctuation.operation.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"punctuation.operation.graphql"}},"name":"meta.selectionset.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-field"},{"include":"#graphql-fragment-spread"},{"include":"#graphql-inline-fragment"},{"include":"#graphql-comma"},{"include":"#native-interpolation"},{"include":"#literal-quasi-embedded"}]},"graphql-skip-newlines":{"match":"\\\\s*\\\\n"},"graphql-string-content":{"patterns":[{"match":"\\\\\\\\[\\"'/\\\\\\\\bfnrt]","name":"constant.character.escape.graphql"},{"match":"\\\\\\\\u(\\\\h{4})","name":"constant.character.escape.graphql"}]},"graphql-string-value":{"begin":"\\\\s*+((\\"))","beginCaptures":{"1":{"name":"string.quoted.double.graphql"},"2":{"name":"punctuation.definition.string.begin.graphql"}},"contentName":"string.quoted.double.graphql","end":"\\\\s*+(?:((\\"))|(\\\\n))","endCaptures":{"1":{"name":"string.quoted.double.graphql"},"2":{"name":"punctuation.definition.string.end.graphql"},"3":{"name":"invalid.illegal.newline.graphql"}},"patterns":[{"include":"#graphql-string-content"},{"include":"#literal-quasi-embedded"}]},"graphql-type-definition":{"begin":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)(?=\\\\s*\\\\(|:)","beginCaptures":{"1":{"name":"variable.graphql"}},"end":"(?=\\\\s*(([A-Z_a-z][0-9A-Z_a-z]*)\\\\s*([(:])|(})))|\\\\s*(,)","endCaptures":{"5":{"name":"punctuation.comma.graphql"}},"patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-variable-definitions"},{"include":"#graphql-type-object"},{"include":"#graphql-colon"},{"include":"#graphql-input-types"},{"include":"#literal-quasi-embedded"}]},"graphql-type-interface":{"applyEndPatternLast":1,"begin":"\\\\s*\\\\b(?:(extends?)?\\\\b\\\\s*\\\\b(type)|(interface)|(input))\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)?","captures":{"1":{"name":"keyword.type.graphql"},"2":{"name":"keyword.type.graphql"},"3":{"name":"keyword.interface.graphql"},"4":{"name":"keyword.input.graphql"},"5":{"name":"support.type.graphql"}},"end":"(?=.)","name":"meta.type.interface.graphql","patterns":[{"begin":"\\\\s*\\\\b(implements)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.implements.graphql"}},"end":"\\\\s*(?=\\\\{)","patterns":[{"captures":{"1":{"name":"support.type.graphql"}},"match":"\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-ampersand"},{"include":"#graphql-comma"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-type-object"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-ignore-spaces"}]},"graphql-type-object":{"begin":"\\\\s*(\\\\{)","beginCaptures":{"1":{"name":"punctuation.operation.graphql"}},"end":"\\\\s*(})","endCaptures":{"1":{"name":"punctuation.operation.graphql"}},"name":"meta.type.object.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-object-type"},{"include":"#graphql-type-definition"},{"include":"#literal-quasi-embedded"}]},"graphql-union":{"applyEndPatternLast":1,"begin":"\\\\s*\\\\b(union)\\\\b\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)","captures":{"1":{"name":"keyword.union.graphql"},"2":{"name":"support.type.graphql"}},"end":"(?=.)","patterns":[{"applyEndPatternLast":1,"begin":"\\\\s*(=)\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)","captures":{"1":{"name":"punctuation.assignment.graphql"},"2":{"name":"support.type.graphql"}},"end":"(?=.)","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-skip-newlines"},{"include":"#literal-quasi-embedded"},{"captures":{"1":{"name":"punctuation.or.graphql"},"2":{"name":"support.type.graphql"}},"match":"\\\\s*(\\\\|)\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"}]},{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-skip-newlines"},{"include":"#literal-quasi-embedded"}]},"graphql-union-mark":{"captures":{"1":{"name":"punctuation.union.graphql"}},"match":"\\\\s*(\\\\|)"},"graphql-value":{"patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-variable-name"},{"include":"#graphql-float-value"},{"include":"#graphql-string-value"},{"include":"#graphql-boolean-value"},{"include":"#graphql-null-value"},{"include":"#graphql-enum-value"},{"include":"#graphql-list-value"},{"include":"#graphql-object-value"},{"include":"#literal-quasi-embedded"}]},"graphql-variable-assignment":{"applyEndPatternLast":1,"begin":"\\\\s(=)","beginCaptures":{"1":{"name":"punctuation.assignment.graphql"}},"end":"(?=[\\\\n),])","patterns":[{"include":"#graphql-value"}]},"graphql-variable-definition":{"begin":"\\\\s*(\\\\$?[A-Z_a-z][0-9A-Z_a-z]*)(?=\\\\s*\\\\(|:)","beginCaptures":{"1":{"name":"variable.parameter.graphql"}},"end":"(?=\\\\s*((\\\\$?[A-Z_a-z][0-9A-Z_a-z]*)\\\\s*([(:])|([)}])))|\\\\s*(,)","endCaptures":{"5":{"name":"punctuation.comma.graphql"}},"name":"meta.variables.graphql","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-directive"},{"include":"#graphql-colon"},{"include":"#graphql-input-types"},{"include":"#graphql-variable-assignment"},{"include":"#literal-quasi-embedded"},{"include":"#graphql-skip-newlines"}]},"graphql-variable-definitions":{"begin":"\\\\s*(\\\\()","captures":{"1":{"name":"meta.brace.round.graphql"}},"end":"\\\\s*(\\\\))","patterns":[{"include":"#graphql-comment"},{"include":"#graphql-description-docstring"},{"include":"#graphql-description-singleline"},{"include":"#graphql-variable-definition"},{"include":"#literal-quasi-embedded"}]},"graphql-variable-name":{"captures":{"1":{"name":"variable.graphql"}},"match":"\\\\s*(\\\\$[A-Z_a-z][0-9A-Z_a-z]*)"},"native-interpolation":{"begin":"\\\\s*(\\\\$\\\\{)","beginCaptures":{"1":{"name":"keyword.other.substitution.begin"}},"end":"(})","endCaptures":{"1":{"name":"keyword.other.substitution.end"}},"name":"native.interpolation","patterns":[{"include":"source.js"},{"include":"source.ts"},{"include":"source.js.jsx"},{"include":"source.tsx"}]}},"scopeName":"source.graphql","embeddedLangs":["javascript","typescript","jsx","tsx"],"aliases":["gql"]}`)),a=[...e,...t,...n,...r,i];export{a as default};
|
dist/assets/index-Boafd7W2.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{index-Bi-fjd8h.css → index-CFM0yVq3.css}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/index-vXLRCcU6.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{java-BYPHYPGE.js → java-BlrE5MjW.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{t as e}from"./index-Boafd7W2.js";var t=e({default:()=>n}),n=[Object.freeze(JSON.parse(`{"displayName":"Java","name":"java","patterns":[{"begin":"\\\\b(package)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.other.package.java"}},"contentName":"storage.modifier.package.java","end":"\\\\s*(;)","endCaptures":{"1":{"name":"punctuation.terminator.java"}},"name":"meta.package.java","patterns":[{"include":"#comments"},{"match":"(?<=\\\\.)\\\\s*\\\\.|\\\\.(?=\\\\s*;)","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"(?<!_)_(?=\\\\s*([.;]))|\\\\b\\\\d+|-+","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"[A-Z]+","name":"invalid.deprecated.package_name_not_lowercase.java"},{"match":"\\\\b(?<!\\\\$)(abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|non-sealed|package|permits|private|protected|public|return|sealed|short|static|strictfp|super|switch|syncronized|this|throws??|transient|try|void|volatile|while|yield|true|false|null)\\\\b","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"\\\\.","name":"punctuation.separator.java"}]},{"begin":"\\\\b(import)\\\\b\\\\s*\\\\b(static)?\\\\b\\\\s","beginCaptures":{"1":{"name":"keyword.other.import.java"},"2":{"name":"storage.modifier.java"}},"contentName":"storage.modifier.import.java","end":"\\\\s*(;)","endCaptures":{"1":{"name":"punctuation.terminator.java"}},"name":"meta.import.java","patterns":[{"include":"#comments"},{"match":"(?<=\\\\.)\\\\s*\\\\.|\\\\.(?=\\\\s*;)","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"(?<!\\\\.)\\\\s*\\\\*","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"(?<!_)_(?=\\\\s*([.;]))|\\\\b\\\\d+|-+","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"\\\\b(?<!\\\\$)(abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|non-sealed|package|permits|private|protected|public|return|sealed|short|static|strictfp|super|switch|syncronized|this|throws??|transient|try|void|volatile|while|yield|true|false|null)\\\\b","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"\\\\.","name":"punctuation.separator.java"},{"match":"\\\\*","name":"variable.language.wildcard.java"}]},{"include":"#comments-javadoc"},{"include":"#code"},{"include":"#module"}],"repository":{"all-types":{"patterns":[{"include":"#primitive-arrays"},{"include":"#primitive-types"},{"include":"#object-types"}]},"annotations":{"patterns":[{"begin":"((@)\\\\s*([^(\\\\s]+))(\\\\()","beginCaptures":{"2":{"name":"punctuation.definition.annotation.java"},"3":{"name":"storage.type.annotation.java"},"4":{"name":"punctuation.definition.annotation-arguments.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.annotation-arguments.end.bracket.round.java"}},"name":"meta.declaration.annotation.java","patterns":[{"captures":{"1":{"name":"constant.other.key.java"},"2":{"name":"keyword.operator.assignment.java"}},"match":"(\\\\w*)\\\\s*(=)"},{"include":"#code"}]},{"captures":{"1":{"name":"punctuation.definition.annotation.java"},"2":{"name":"storage.modifier.java"},"3":{"name":"storage.type.annotation.java"},"5":{"name":"punctuation.definition.annotation.java"},"6":{"name":"storage.type.annotation.java"}},"match":"(@)(interface)\\\\s+(\\\\w*)|((@)\\\\s*(\\\\w+))","name":"meta.declaration.annotation.java"}]},"anonymous-block-and-instance-initializer":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.block.begin.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.java"}},"patterns":[{"include":"#code"}]},"anonymous-classes-and-new":{"begin":"\\\\bnew\\\\b","beginCaptures":{"0":{"name":"keyword.control.new.java"}},"end":"(?=[])-.:;?}]|/(?![*/])|[!%\\\\&=^|])","patterns":[{"include":"#comments"},{"include":"#function-call"},{"include":"#all-types"},{"begin":"(?<=\\\\))","end":"(?=[])-.:;?}]|/(?![*/])|[!%\\\\&=^|])","patterns":[{"include":"#comments"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.inner-class.begin.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.inner-class.end.bracket.curly.java"}},"name":"meta.inner-class.java","patterns":[{"include":"#class-body"}]}]},{"begin":"(?<=])","end":"(?=[])-.:;?}]|/(?![*/])|[!%\\\\&=^|])","patterns":[{"include":"#comments"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.array-initializer.begin.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.array-initializer.end.bracket.curly.java"}},"name":"meta.array-initializer.java","patterns":[{"include":"#code"}]}]},{"include":"#parens"}]},"assertions":{"patterns":[{"begin":"\\\\b(assert)\\\\s","beginCaptures":{"1":{"name":"keyword.control.assert.java"}},"end":"$","name":"meta.declaration.assertion.java","patterns":[{"match":":","name":"keyword.operator.assert.expression-separator.java"},{"include":"#code"}]}]},"class":{"begin":"(?=\\\\w?[-\\\\w\\\\s]*\\\\b(?:class|(?<!@)interface|enum)\\\\s+[$\\\\w]+)","end":"}","endCaptures":{"0":{"name":"punctuation.section.class.end.bracket.curly.java"}},"name":"meta.class.java","patterns":[{"include":"#storage-modifiers"},{"include":"#generics"},{"include":"#comments"},{"captures":{"1":{"name":"storage.modifier.java"},"2":{"name":"entity.name.type.class.java"}},"match":"(class|(?<!@)interface|enum)\\\\s+([$\\\\w]+)","name":"meta.class.identifier.java"},{"begin":"extends","beginCaptures":{"0":{"name":"storage.modifier.extends.java"}},"end":"(?=\\\\{|implements|permits)","name":"meta.definition.class.inherited.classes.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"(implements)\\\\s","beginCaptures":{"1":{"name":"storage.modifier.implements.java"}},"end":"(?=\\\\s*extends|permits|\\\\{)","name":"meta.definition.class.implemented.interfaces.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"(permits)\\\\s","beginCaptures":{"1":{"name":"storage.modifier.permits.java"}},"end":"(?=\\\\s*extends|implements|\\\\{)","name":"meta.definition.class.permits.classes.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.class.begin.bracket.curly.java"}},"contentName":"meta.class.body.java","end":"(?=})","patterns":[{"include":"#class-body"}]}]},"class-body":{"patterns":[{"include":"#comments-javadoc"},{"include":"#comments"},{"include":"#enums"},{"include":"#class"},{"include":"#generics"},{"include":"#static-initializer"},{"include":"#class-fields-and-methods"},{"include":"#annotations"},{"include":"#storage-modifiers"},{"include":"#member-variables"},{"include":"#code"}]},"class-fields-and-methods":{"patterns":[{"begin":"(?==)","end":"(?=;)","patterns":[{"include":"#code"}]},{"include":"#methods"}]},"code":{"patterns":[{"include":"#annotations"},{"include":"#comments"},{"include":"#enums"},{"include":"#class"},{"include":"#record"},{"include":"#anonymous-block-and-instance-initializer"},{"include":"#try-catch-finally"},{"include":"#assertions"},{"include":"#parens"},{"include":"#constants-and-special-vars"},{"include":"#numbers"},{"include":"#anonymous-classes-and-new"},{"include":"#lambda-expression"},{"include":"#keywords"},{"include":"#storage-modifiers"},{"include":"#method-call"},{"include":"#function-call"},{"include":"#variables"},{"include":"#variables-local"},{"include":"#objects"},{"include":"#properties"},{"include":"#strings"},{"include":"#all-types"},{"match":",","name":"punctuation.separator.delimiter.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"},{"match":";","name":"punctuation.terminator.java"}]},"comments":{"patterns":[{"captures":{"0":{"name":"punctuation.definition.comment.java"}},"match":"/\\\\*\\\\*/","name":"comment.block.empty.java"},{"include":"#comments-inline"}]},"comments-inline":{"patterns":[{"begin":"/\\\\*","captures":{"0":{"name":"punctuation.definition.comment.java"}},"end":"\\\\*/","name":"comment.block.java"},{"begin":"(^[\\\\t ]+)?(?=//)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.java"}},"end":"(?!\\\\G)","patterns":[{"begin":"//","beginCaptures":{"0":{"name":"punctuation.definition.comment.java"}},"end":"\\\\n","name":"comment.line.double-slash.java"}]}]},"comments-javadoc":{"patterns":[{"begin":"^\\\\s*(/\\\\*\\\\*)(?!/)","beginCaptures":{"1":{"name":"punctuation.definition.comment.java"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.java"}},"name":"comment.block.javadoc.java","patterns":[{"match":"@(author|deprecated|return|see|serial|since|version)\\\\b","name":"keyword.other.documentation.javadoc.java"},{"captures":{"1":{"name":"keyword.other.documentation.javadoc.java"},"2":{"name":"variable.parameter.java"}},"match":"(@param)\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"keyword.other.documentation.javadoc.java"},"2":{"name":"entity.name.type.class.java"}},"match":"(@(?:exception|throws))\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"keyword.other.documentation.javadoc.java"},"2":{"name":"entity.name.type.class.java"},"3":{"name":"variable.parameter.java"}},"match":"\\\\{(@link)\\\\s+(\\\\S+)?#([$\\\\w]+\\\\s*\\\\([^()]*\\\\)).*?}"}]}]},"constants-and-special-vars":{"patterns":[{"match":"\\\\b(true|false|null)\\\\b","name":"constant.language.java"},{"match":"\\\\bthis\\\\b","name":"variable.language.this.java"},{"match":"\\\\bsuper\\\\b","name":"variable.language.java"}]},"enums":{"begin":"^\\\\s*([\\\\w\\\\s]*)(enum)\\\\s+(\\\\w+)","beginCaptures":{"1":{"patterns":[{"include":"#storage-modifiers"}]},"2":{"name":"storage.modifier.java"},"3":{"name":"entity.name.type.enum.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.enum.end.bracket.curly.java"}},"name":"meta.enum.java","patterns":[{"begin":"\\\\b(extends)\\\\b","beginCaptures":{"1":{"name":"storage.modifier.extends.java"}},"end":"(?=\\\\{|\\\\bimplements\\\\b)","name":"meta.definition.class.inherited.classes.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"\\\\b(implements)\\\\b","beginCaptures":{"1":{"name":"storage.modifier.implements.java"}},"end":"(?=\\\\{|\\\\bextends\\\\b)","name":"meta.definition.class.implemented.interfaces.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.enum.begin.bracket.curly.java"}},"end":"(?=})","patterns":[{"begin":"(?<=\\\\{)","end":"(?=[;}])","patterns":[{"include":"#comments-javadoc"},{"include":"#comments"},{"begin":"\\\\b(\\\\w+)\\\\b","beginCaptures":{"1":{"name":"constant.other.enum.java"}},"end":"(,)|(?=[;}])","endCaptures":{"1":{"name":"punctuation.separator.delimiter.java"}},"patterns":[{"include":"#comments-javadoc"},{"include":"#comments"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.bracket.round.java"}},"patterns":[{"include":"#code"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.bracket.curly.java"}},"patterns":[{"include":"#class-body"}]}]}]},{"include":"#class-body"}]}]},"function-call":{"begin":"([$A-Z_a-z][$\\\\w]*)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.java"},"2":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.function-call.java","patterns":[{"include":"#code"}]},"generics":{"begin":"<","beginCaptures":{"0":{"name":"punctuation.bracket.angle.java"}},"end":">","endCaptures":{"0":{"name":"punctuation.bracket.angle.java"}},"patterns":[{"match":"\\\\b(extends|super)\\\\b","name":"storage.modifier.$1.java"},{"captures":{"1":{"name":"storage.type.java"}},"match":"(?<!\\\\.)([$A-Z_a-z][$0-9A-Z_a-z]*)(?=\\\\s*<)"},{"include":"#primitive-arrays"},{"match":"[$A-Z_a-z][$0-9A-Z_a-z]*","name":"storage.type.generic.java"},{"match":"\\\\?","name":"storage.type.generic.wildcard.java"},{"match":"&","name":"punctuation.separator.types.java"},{"match":",","name":"punctuation.separator.delimiter.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"},{"include":"#parens"},{"include":"#generics"},{"include":"#comments"}]},"keywords":{"patterns":[{"match":"\\\\bthrow\\\\b","name":"keyword.control.throw.java"},{"match":"[:?]","name":"keyword.control.ternary.java"},{"match":"\\\\b(return|yield|break|case|continue|default|do|while|for|switch|if|else)\\\\b","name":"keyword.control.java"},{"match":"\\\\b(instanceof)\\\\b","name":"keyword.operator.instanceof.java"},{"match":"(<<|>>>?|[\\\\^~])","name":"keyword.operator.bitwise.java"},{"match":"(([\\\\&^|]|<<|>>>?)=)","name":"keyword.operator.assignment.bitwise.java"},{"match":"(===?|!=|<=|>=|<>|[<>])","name":"keyword.operator.comparison.java"},{"match":"([-%*+/]=)","name":"keyword.operator.assignment.arithmetic.java"},{"match":"(=)","name":"keyword.operator.assignment.java"},{"match":"(--|\\\\+\\\\+)","name":"keyword.operator.increment-decrement.java"},{"match":"([-%*+/])","name":"keyword.operator.arithmetic.java"},{"match":"(!|&&|\\\\|\\\\|)","name":"keyword.operator.logical.java"},{"match":"([\\\\&|])","name":"keyword.operator.bitwise.java"},{"match":"\\\\b(const|goto)\\\\b","name":"keyword.reserved.java"}]},"lambda-expression":{"patterns":[{"match":"->","name":"storage.type.function.arrow.java"}]},"member-variables":{"begin":"(?=private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final)","end":"(?=[;=])","patterns":[{"include":"#storage-modifiers"},{"include":"#variables"},{"include":"#primitive-arrays"},{"include":"#object-types"}]},"method-call":{"begin":"(\\\\.)\\\\s*([$A-Z_a-z][$\\\\w]*)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"entity.name.function.java"},"3":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.method-call.java","patterns":[{"include":"#code"}]},"methods":{"begin":"(?!new)(?=[<\\\\w].*\\\\s+)(?=([^/=]|/(?!/))+\\\\()","end":"(})|(?=;)","endCaptures":{"1":{"name":"punctuation.section.method.end.bracket.curly.java"}},"name":"meta.method.java","patterns":[{"include":"#storage-modifiers"},{"begin":"(\\\\w+)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.java"},"2":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.method.identifier.java","patterns":[{"include":"#parameters"},{"include":"#parens"},{"include":"#comments"}]},{"include":"#generics"},{"begin":"(?=\\\\w.*\\\\s+\\\\w+\\\\s*\\\\()","end":"(?=\\\\s+\\\\w+\\\\s*\\\\()","name":"meta.method.return-type.java","patterns":[{"include":"#all-types"},{"include":"#parens"},{"include":"#comments"}]},{"include":"#throws"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.method.begin.bracket.curly.java"}},"contentName":"meta.method.body.java","end":"(?=})","patterns":[{"include":"#code"}]},{"include":"#comments"}]},"module":{"begin":"((open)\\\\s)?(module)\\\\s+(\\\\w+)","beginCaptures":{"1":{"name":"storage.modifier.java"},"3":{"name":"storage.modifier.java"},"4":{"name":"entity.name.type.module.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.module.end.bracket.curly.java"}},"name":"meta.module.java","patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.module.begin.bracket.curly.java"}},"contentName":"meta.module.body.java","end":"(?=})","patterns":[{"include":"#comments"},{"include":"#comments-javadoc"},{"match":"\\\\b(requires|transitive|exports|opens|to|uses|provides|with)\\\\b","name":"keyword.module.java"}]}]},"numbers":{"patterns":[{"match":"\\\\b(?<!\\\\$)0([Xx])((?<!\\\\.)\\\\h([_\\\\h]*\\\\h)?[Ll]?(?!\\\\.)|(\\\\h([_\\\\h]*\\\\h)?\\\\.?|(\\\\h([_\\\\h]*\\\\h)?)?\\\\.\\\\h([_\\\\h]*\\\\h)?)[Pp][-+]?[0-9]([0-9_]*[0-9])?[DFdf]?)\\\\b(?!\\\\$)","name":"constant.numeric.hex.java"},{"match":"\\\\b(?<!\\\\$)0([Bb])[01]([01_]*[01])?[Ll]?\\\\b(?!\\\\$)","name":"constant.numeric.binary.java"},{"match":"\\\\b(?<!\\\\$)0[0-7]([0-7_]*[0-7])?[Ll]?\\\\b(?!\\\\$)","name":"constant.numeric.octal.java"},{"match":"(?<!\\\\$)(\\\\b[0-9]([0-9_]*[0-9])?\\\\.\\\\B(?!\\\\.)|\\\\b[0-9]([0-9_]*[0-9])?\\\\.([Ee][-+]?[0-9]([0-9_]*[0-9])?)[DFdf]?\\\\b|\\\\b[0-9]([0-9_]*[0-9])?\\\\.([Ee][-+]?[0-9]([0-9_]*[0-9])?)?[DFdf]\\\\b|\\\\b[0-9]([0-9_]*[0-9])?\\\\.([0-9]([0-9_]*[0-9])?)([Ee][-+]?[0-9]([0-9_]*[0-9])?)?[DFdf]?\\\\b|(?<!\\\\.)\\\\B\\\\.[0-9]([0-9_]*[0-9])?([Ee][-+]?[0-9]([0-9_]*[0-9])?)?[DFdf]?\\\\b|\\\\b[0-9]([0-9_]*[0-9])?([Ee][-+]?[0-9]([0-9_]*[0-9])?)[DFdf]?\\\\b|\\\\b[0-9]([0-9_]*[0-9])?([Ee][-+]?[0-9]([0-9_]*[0-9])?)?[DFdf]\\\\b|\\\\b(0|[1-9]([0-9_]*[0-9])?)(?!\\\\.)[Ll]?\\\\b)(?!\\\\$)","name":"constant.numeric.decimal.java"}]},"object-types":{"patterns":[{"include":"#generics"},{"begin":"\\\\b((?:[A-Z_a-z]\\\\w*\\\\s*\\\\.\\\\s*)*)([A-Z_]\\\\w*)\\\\s*(?=\\\\[)","beginCaptures":{"1":{"patterns":[{"match":"[A-Z_a-z]\\\\w*","name":"storage.type.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"}]},"2":{"name":"storage.type.object.array.java"}},"end":"(?!\\\\s*\\\\[)","patterns":[{"include":"#comments"},{"include":"#parens"}]},{"captures":{"1":{"patterns":[{"match":"[A-Z_a-z]\\\\w*","name":"storage.type.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"}]}},"match":"\\\\b((?:[A-Z_a-z]\\\\w*\\\\s*\\\\.\\\\s*)*[A-Z_]\\\\w*)\\\\s*(?=<)"},{"captures":{"1":{"patterns":[{"match":"[A-Z_a-z]\\\\w*","name":"storage.type.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"}]}},"match":"\\\\b((?:[A-Z_a-z]\\\\w*\\\\s*\\\\.\\\\s*)*[A-Z_]\\\\w*)\\\\b((?=\\\\s*[\\\\n$A-Z_a-z])|(?=\\\\s*\\\\.\\\\.\\\\.))"}]},"object-types-inherited":{"patterns":[{"include":"#generics"},{"captures":{"1":{"name":"punctuation.separator.period.java"}},"match":"\\\\b(?:[A-Z]\\\\w*\\\\s*(\\\\.)\\\\s*)*[A-Z]\\\\w*\\\\b","name":"entity.other.inherited-class.java"},{"match":",","name":"punctuation.separator.delimiter.java"}]},"objects":{"match":"(?<![$\\\\w])[$A-Z_a-z][$\\\\w]*(?=\\\\s*\\\\.\\\\s*[$\\\\w]+)","name":"variable.other.object.java"},"parameters":{"patterns":[{"match":"\\\\bfinal\\\\b","name":"storage.modifier.java"},{"include":"#annotations"},{"include":"#all-types"},{"include":"#strings"},{"match":"\\\\w+","name":"variable.parameter.java"},{"match":",","name":"punctuation.separator.delimiter.java"},{"match":"\\\\.\\\\.\\\\.","name":"punctuation.definition.parameters.varargs.java"}]},"parens":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.bracket.round.java"}},"patterns":[{"include":"#code"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.bracket.square.java"}},"end":"]","endCaptures":{"0":{"name":"punctuation.bracket.square.java"}},"patterns":[{"include":"#code"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.bracket.curly.java"}},"patterns":[{"include":"#code"}]}]},"primitive-arrays":{"patterns":[{"begin":"\\\\b(void|boolean|byte|char|short|int|float|long|double)\\\\b\\\\s*(?=\\\\[)","beginCaptures":{"1":{"name":"storage.type.primitive.array.java"}},"end":"(?!\\\\s*\\\\[)","patterns":[{"include":"#comments"},{"include":"#parens"}]}]},"primitive-types":{"match":"\\\\b(void|boolean|byte|char|short|int|float|long|double)\\\\b","name":"storage.type.primitive.java"},"properties":{"patterns":[{"captures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"keyword.control.new.java"}},"match":"(\\\\.)\\\\s*(new)"},{"captures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"variable.other.object.property.java"}},"match":"(\\\\.)\\\\s*([$A-Z_a-z][$\\\\w]*)(?=\\\\s*\\\\.\\\\s*[$A-Z_a-z][$\\\\w]*)"},{"captures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"variable.other.object.property.java"}},"match":"(\\\\.)\\\\s*([$A-Z_a-z][$\\\\w]*)"},{"captures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"invalid.illegal.identifier.java"}},"match":"(\\\\.)\\\\s*([0-9][$\\\\w]*)"}]},"record":{"begin":"(?=\\\\w?[\\\\w\\\\s]*\\\\brecord\\\\s+[$\\\\w]+)","end":"}","endCaptures":{"0":{"name":"punctuation.section.class.end.bracket.curly.java"}},"name":"meta.record.java","patterns":[{"include":"#storage-modifiers"},{"include":"#generics"},{"include":"#comments"},{"begin":"(record)\\\\s+([$\\\\w]+)(<[$\\\\w]+>)?(\\\\()","beginCaptures":{"1":{"name":"storage.modifier.java"},"2":{"name":"entity.name.type.record.java"},"3":{"patterns":[{"include":"#generics"}]},"4":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.record.identifier.java","patterns":[{"include":"#code"}]},{"begin":"(implements)\\\\s","beginCaptures":{"1":{"name":"storage.modifier.implements.java"}},"end":"(?=\\\\s*\\\\{)","name":"meta.definition.class.implemented.interfaces.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"include":"#record-body"}]},"record-body":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.class.begin.bracket.curly.java"}},"end":"(?=})","name":"meta.record.body.java","patterns":[{"include":"#record-constructor"},{"include":"#class-body"}]},"record-constructor":{"begin":"(?!new)(?=[<\\\\w].*\\\\s+)(?=([^(/=]|/(?!/))+(?=\\\\{))","end":"(})|(?=;)","endCaptures":{"1":{"name":"punctuation.section.method.end.bracket.curly.java"}},"name":"meta.method.java","patterns":[{"include":"#storage-modifiers"},{"begin":"(\\\\w+)","beginCaptures":{"1":{"name":"entity.name.function.java"}},"end":"(?=\\\\s*\\\\{)","name":"meta.method.identifier.java","patterns":[{"include":"#comments"}]},{"include":"#comments"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.method.begin.bracket.curly.java"}},"contentName":"meta.method.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]},"static-initializer":{"patterns":[{"include":"#anonymous-block-and-instance-initializer"},{"match":"static","name":"storage.modifier.java"}]},"storage-modifiers":{"match":"\\\\b(public|private|protected|static|final|native|synchronized|abstract|threadsafe|transient|volatile|default|strictfp|sealed|non-sealed)\\\\b","name":"storage.modifier.java"},"strings":{"patterns":[{"begin":"\\"\\"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.java"}},"end":"\\"\\"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.java"}},"name":"string.quoted.triple.java","patterns":[{"match":"(\\\\\\\\\\"\\"\\")(?!\\")|(\\\\\\\\.)","name":"constant.character.escape.java"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.java"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.java"}},"name":"string.quoted.double.java","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.java"}]},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.java"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.java"}},"name":"string.quoted.single.java","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.java"}]}]},"throws":{"begin":"throws","beginCaptures":{"0":{"name":"storage.modifier.java"}},"end":"(?=[;{])","name":"meta.throwables.java","patterns":[{"match":",","name":"punctuation.separator.delimiter.java"},{"match":"[$A-Z_a-z][$.0-9A-Z_a-z]*","name":"storage.type.java"},{"include":"#comments"}]},"try-catch-finally":{"patterns":[{"begin":"\\\\btry\\\\b","beginCaptures":{"0":{"name":"keyword.control.try.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.try.end.bracket.curly.java"}},"name":"meta.try.java","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.try.resources.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.try.resources.end.bracket.round.java"}},"name":"meta.try.resources.java","patterns":[{"include":"#code"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.try.begin.bracket.curly.java"}},"contentName":"meta.try.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]},{"begin":"\\\\b(catch)\\\\b","beginCaptures":{"1":{"name":"keyword.control.catch.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.catch.end.bracket.curly.java"}},"name":"meta.catch.java","patterns":[{"include":"#comments"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"contentName":"meta.catch.parameters.java","end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"patterns":[{"include":"#comments"},{"include":"#storage-modifiers"},{"begin":"[$A-Z_a-z][$.0-9A-Z_a-z]*","beginCaptures":{"0":{"name":"storage.type.java"}},"end":"(\\\\|)|(?=\\\\))","endCaptures":{"1":{"name":"punctuation.catch.separator.java"}},"patterns":[{"include":"#comments"},{"captures":{"0":{"name":"variable.parameter.java"}},"match":"\\\\w+"}]}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.catch.begin.bracket.curly.java"}},"contentName":"meta.catch.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]},{"begin":"\\\\bfinally\\\\b","beginCaptures":{"0":{"name":"keyword.control.finally.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.finally.end.bracket.curly.java"}},"name":"meta.finally.java","patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.finally.begin.bracket.curly.java"}},"contentName":"meta.finally.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]}]},"variables":{"begin":"(?=\\\\b((void|boolean|byte|char|short|int|float|long|double)|(?>(\\\\w+\\\\.)*[A-Z_]+\\\\w*))\\\\b\\\\s*(<[],.<>?\\\\[\\\\w\\\\s]*>)?\\\\s*((\\\\[])*)?\\\\s+[$A-Z_a-z][$\\\\w]*([]$,\\\\[\\\\w][],\\\\[\\\\w\\\\s]*)?\\\\s*([:;=]))","end":"(?=[:;=])","name":"meta.definition.variable.java","patterns":[{"captures":{"1":{"name":"variable.other.definition.java"}},"match":"([$A-Z_a-z][$\\\\w]*)(?=\\\\s*(\\\\[])*\\\\s*([,:;=]))"},{"include":"#all-types"},{"include":"#code"}]},"variables-local":{"begin":"(?=\\\\b(var)\\\\b\\\\s+[$A-Z_a-z][$\\\\w]*\\\\s*([:;=]))","end":"(?=[:;=])","name":"meta.definition.variable.local.java","patterns":[{"match":"\\\\bvar\\\\b","name":"storage.type.local.java"},{"captures":{"1":{"name":"variable.other.definition.java"}},"match":"([$A-Z_a-z][$\\\\w]*)(?=\\\\s*(\\\\[])*\\\\s*([:;=]))"},{"include":"#code"}]}},"scopeName":"source.java"}`))];export{t as n,n as t};
|
|
|
|
| 1 |
+
import{t as e}from"./index-vXLRCcU6.js";var t=e({default:()=>n}),n=[Object.freeze(JSON.parse(`{"displayName":"Java","name":"java","patterns":[{"begin":"\\\\b(package)\\\\b\\\\s*","beginCaptures":{"1":{"name":"keyword.other.package.java"}},"contentName":"storage.modifier.package.java","end":"\\\\s*(;)","endCaptures":{"1":{"name":"punctuation.terminator.java"}},"name":"meta.package.java","patterns":[{"include":"#comments"},{"match":"(?<=\\\\.)\\\\s*\\\\.|\\\\.(?=\\\\s*;)","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"(?<!_)_(?=\\\\s*([.;]))|\\\\b\\\\d+|-+","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"[A-Z]+","name":"invalid.deprecated.package_name_not_lowercase.java"},{"match":"\\\\b(?<!\\\\$)(abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|non-sealed|package|permits|private|protected|public|return|sealed|short|static|strictfp|super|switch|syncronized|this|throws??|transient|try|void|volatile|while|yield|true|false|null)\\\\b","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"\\\\.","name":"punctuation.separator.java"}]},{"begin":"\\\\b(import)\\\\b\\\\s*\\\\b(static)?\\\\b\\\\s","beginCaptures":{"1":{"name":"keyword.other.import.java"},"2":{"name":"storage.modifier.java"}},"contentName":"storage.modifier.import.java","end":"\\\\s*(;)","endCaptures":{"1":{"name":"punctuation.terminator.java"}},"name":"meta.import.java","patterns":[{"include":"#comments"},{"match":"(?<=\\\\.)\\\\s*\\\\.|\\\\.(?=\\\\s*;)","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"(?<!\\\\.)\\\\s*\\\\*","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"(?<!_)_(?=\\\\s*([.;]))|\\\\b\\\\d+|-+","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"\\\\b(?<!\\\\$)(abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|non-sealed|package|permits|private|protected|public|return|sealed|short|static|strictfp|super|switch|syncronized|this|throws??|transient|try|void|volatile|while|yield|true|false|null)\\\\b","name":"invalid.illegal.character_not_allowed_here.java"},{"match":"\\\\.","name":"punctuation.separator.java"},{"match":"\\\\*","name":"variable.language.wildcard.java"}]},{"include":"#comments-javadoc"},{"include":"#code"},{"include":"#module"}],"repository":{"all-types":{"patterns":[{"include":"#primitive-arrays"},{"include":"#primitive-types"},{"include":"#object-types"}]},"annotations":{"patterns":[{"begin":"((@)\\\\s*([^(\\\\s]+))(\\\\()","beginCaptures":{"2":{"name":"punctuation.definition.annotation.java"},"3":{"name":"storage.type.annotation.java"},"4":{"name":"punctuation.definition.annotation-arguments.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.annotation-arguments.end.bracket.round.java"}},"name":"meta.declaration.annotation.java","patterns":[{"captures":{"1":{"name":"constant.other.key.java"},"2":{"name":"keyword.operator.assignment.java"}},"match":"(\\\\w*)\\\\s*(=)"},{"include":"#code"}]},{"captures":{"1":{"name":"punctuation.definition.annotation.java"},"2":{"name":"storage.modifier.java"},"3":{"name":"storage.type.annotation.java"},"5":{"name":"punctuation.definition.annotation.java"},"6":{"name":"storage.type.annotation.java"}},"match":"(@)(interface)\\\\s+(\\\\w*)|((@)\\\\s*(\\\\w+))","name":"meta.declaration.annotation.java"}]},"anonymous-block-and-instance-initializer":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.block.begin.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.block.end.bracket.curly.java"}},"patterns":[{"include":"#code"}]},"anonymous-classes-and-new":{"begin":"\\\\bnew\\\\b","beginCaptures":{"0":{"name":"keyword.control.new.java"}},"end":"(?=[])-.:;?}]|/(?![*/])|[!%\\\\&=^|])","patterns":[{"include":"#comments"},{"include":"#function-call"},{"include":"#all-types"},{"begin":"(?<=\\\\))","end":"(?=[])-.:;?}]|/(?![*/])|[!%\\\\&=^|])","patterns":[{"include":"#comments"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.inner-class.begin.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.inner-class.end.bracket.curly.java"}},"name":"meta.inner-class.java","patterns":[{"include":"#class-body"}]}]},{"begin":"(?<=])","end":"(?=[])-.:;?}]|/(?![*/])|[!%\\\\&=^|])","patterns":[{"include":"#comments"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.array-initializer.begin.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.array-initializer.end.bracket.curly.java"}},"name":"meta.array-initializer.java","patterns":[{"include":"#code"}]}]},{"include":"#parens"}]},"assertions":{"patterns":[{"begin":"\\\\b(assert)\\\\s","beginCaptures":{"1":{"name":"keyword.control.assert.java"}},"end":"$","name":"meta.declaration.assertion.java","patterns":[{"match":":","name":"keyword.operator.assert.expression-separator.java"},{"include":"#code"}]}]},"class":{"begin":"(?=\\\\w?[-\\\\w\\\\s]*\\\\b(?:class|(?<!@)interface|enum)\\\\s+[$\\\\w]+)","end":"}","endCaptures":{"0":{"name":"punctuation.section.class.end.bracket.curly.java"}},"name":"meta.class.java","patterns":[{"include":"#storage-modifiers"},{"include":"#generics"},{"include":"#comments"},{"captures":{"1":{"name":"storage.modifier.java"},"2":{"name":"entity.name.type.class.java"}},"match":"(class|(?<!@)interface|enum)\\\\s+([$\\\\w]+)","name":"meta.class.identifier.java"},{"begin":"extends","beginCaptures":{"0":{"name":"storage.modifier.extends.java"}},"end":"(?=\\\\{|implements|permits)","name":"meta.definition.class.inherited.classes.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"(implements)\\\\s","beginCaptures":{"1":{"name":"storage.modifier.implements.java"}},"end":"(?=\\\\s*extends|permits|\\\\{)","name":"meta.definition.class.implemented.interfaces.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"(permits)\\\\s","beginCaptures":{"1":{"name":"storage.modifier.permits.java"}},"end":"(?=\\\\s*extends|implements|\\\\{)","name":"meta.definition.class.permits.classes.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.class.begin.bracket.curly.java"}},"contentName":"meta.class.body.java","end":"(?=})","patterns":[{"include":"#class-body"}]}]},"class-body":{"patterns":[{"include":"#comments-javadoc"},{"include":"#comments"},{"include":"#enums"},{"include":"#class"},{"include":"#generics"},{"include":"#static-initializer"},{"include":"#class-fields-and-methods"},{"include":"#annotations"},{"include":"#storage-modifiers"},{"include":"#member-variables"},{"include":"#code"}]},"class-fields-and-methods":{"patterns":[{"begin":"(?==)","end":"(?=;)","patterns":[{"include":"#code"}]},{"include":"#methods"}]},"code":{"patterns":[{"include":"#annotations"},{"include":"#comments"},{"include":"#enums"},{"include":"#class"},{"include":"#record"},{"include":"#anonymous-block-and-instance-initializer"},{"include":"#try-catch-finally"},{"include":"#assertions"},{"include":"#parens"},{"include":"#constants-and-special-vars"},{"include":"#numbers"},{"include":"#anonymous-classes-and-new"},{"include":"#lambda-expression"},{"include":"#keywords"},{"include":"#storage-modifiers"},{"include":"#method-call"},{"include":"#function-call"},{"include":"#variables"},{"include":"#variables-local"},{"include":"#objects"},{"include":"#properties"},{"include":"#strings"},{"include":"#all-types"},{"match":",","name":"punctuation.separator.delimiter.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"},{"match":";","name":"punctuation.terminator.java"}]},"comments":{"patterns":[{"captures":{"0":{"name":"punctuation.definition.comment.java"}},"match":"/\\\\*\\\\*/","name":"comment.block.empty.java"},{"include":"#comments-inline"}]},"comments-inline":{"patterns":[{"begin":"/\\\\*","captures":{"0":{"name":"punctuation.definition.comment.java"}},"end":"\\\\*/","name":"comment.block.java"},{"begin":"(^[\\\\t ]+)?(?=//)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.java"}},"end":"(?!\\\\G)","patterns":[{"begin":"//","beginCaptures":{"0":{"name":"punctuation.definition.comment.java"}},"end":"\\\\n","name":"comment.line.double-slash.java"}]}]},"comments-javadoc":{"patterns":[{"begin":"^\\\\s*(/\\\\*\\\\*)(?!/)","beginCaptures":{"1":{"name":"punctuation.definition.comment.java"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.java"}},"name":"comment.block.javadoc.java","patterns":[{"match":"@(author|deprecated|return|see|serial|since|version)\\\\b","name":"keyword.other.documentation.javadoc.java"},{"captures":{"1":{"name":"keyword.other.documentation.javadoc.java"},"2":{"name":"variable.parameter.java"}},"match":"(@param)\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"keyword.other.documentation.javadoc.java"},"2":{"name":"entity.name.type.class.java"}},"match":"(@(?:exception|throws))\\\\s+(\\\\S+)"},{"captures":{"1":{"name":"keyword.other.documentation.javadoc.java"},"2":{"name":"entity.name.type.class.java"},"3":{"name":"variable.parameter.java"}},"match":"\\\\{(@link)\\\\s+(\\\\S+)?#([$\\\\w]+\\\\s*\\\\([^()]*\\\\)).*?}"}]}]},"constants-and-special-vars":{"patterns":[{"match":"\\\\b(true|false|null)\\\\b","name":"constant.language.java"},{"match":"\\\\bthis\\\\b","name":"variable.language.this.java"},{"match":"\\\\bsuper\\\\b","name":"variable.language.java"}]},"enums":{"begin":"^\\\\s*([\\\\w\\\\s]*)(enum)\\\\s+(\\\\w+)","beginCaptures":{"1":{"patterns":[{"include":"#storage-modifiers"}]},"2":{"name":"storage.modifier.java"},"3":{"name":"entity.name.type.enum.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.enum.end.bracket.curly.java"}},"name":"meta.enum.java","patterns":[{"begin":"\\\\b(extends)\\\\b","beginCaptures":{"1":{"name":"storage.modifier.extends.java"}},"end":"(?=\\\\{|\\\\bimplements\\\\b)","name":"meta.definition.class.inherited.classes.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"\\\\b(implements)\\\\b","beginCaptures":{"1":{"name":"storage.modifier.implements.java"}},"end":"(?=\\\\{|\\\\bextends\\\\b)","name":"meta.definition.class.implemented.interfaces.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.enum.begin.bracket.curly.java"}},"end":"(?=})","patterns":[{"begin":"(?<=\\\\{)","end":"(?=[;}])","patterns":[{"include":"#comments-javadoc"},{"include":"#comments"},{"begin":"\\\\b(\\\\w+)\\\\b","beginCaptures":{"1":{"name":"constant.other.enum.java"}},"end":"(,)|(?=[;}])","endCaptures":{"1":{"name":"punctuation.separator.delimiter.java"}},"patterns":[{"include":"#comments-javadoc"},{"include":"#comments"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.bracket.round.java"}},"patterns":[{"include":"#code"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.bracket.curly.java"}},"patterns":[{"include":"#class-body"}]}]}]},{"include":"#class-body"}]}]},"function-call":{"begin":"([$A-Z_a-z][$\\\\w]*)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.java"},"2":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.function-call.java","patterns":[{"include":"#code"}]},"generics":{"begin":"<","beginCaptures":{"0":{"name":"punctuation.bracket.angle.java"}},"end":">","endCaptures":{"0":{"name":"punctuation.bracket.angle.java"}},"patterns":[{"match":"\\\\b(extends|super)\\\\b","name":"storage.modifier.$1.java"},{"captures":{"1":{"name":"storage.type.java"}},"match":"(?<!\\\\.)([$A-Z_a-z][$0-9A-Z_a-z]*)(?=\\\\s*<)"},{"include":"#primitive-arrays"},{"match":"[$A-Z_a-z][$0-9A-Z_a-z]*","name":"storage.type.generic.java"},{"match":"\\\\?","name":"storage.type.generic.wildcard.java"},{"match":"&","name":"punctuation.separator.types.java"},{"match":",","name":"punctuation.separator.delimiter.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"},{"include":"#parens"},{"include":"#generics"},{"include":"#comments"}]},"keywords":{"patterns":[{"match":"\\\\bthrow\\\\b","name":"keyword.control.throw.java"},{"match":"[:?]","name":"keyword.control.ternary.java"},{"match":"\\\\b(return|yield|break|case|continue|default|do|while|for|switch|if|else)\\\\b","name":"keyword.control.java"},{"match":"\\\\b(instanceof)\\\\b","name":"keyword.operator.instanceof.java"},{"match":"(<<|>>>?|[\\\\^~])","name":"keyword.operator.bitwise.java"},{"match":"(([\\\\&^|]|<<|>>>?)=)","name":"keyword.operator.assignment.bitwise.java"},{"match":"(===?|!=|<=|>=|<>|[<>])","name":"keyword.operator.comparison.java"},{"match":"([-%*+/]=)","name":"keyword.operator.assignment.arithmetic.java"},{"match":"(=)","name":"keyword.operator.assignment.java"},{"match":"(--|\\\\+\\\\+)","name":"keyword.operator.increment-decrement.java"},{"match":"([-%*+/])","name":"keyword.operator.arithmetic.java"},{"match":"(!|&&|\\\\|\\\\|)","name":"keyword.operator.logical.java"},{"match":"([\\\\&|])","name":"keyword.operator.bitwise.java"},{"match":"\\\\b(const|goto)\\\\b","name":"keyword.reserved.java"}]},"lambda-expression":{"patterns":[{"match":"->","name":"storage.type.function.arrow.java"}]},"member-variables":{"begin":"(?=private|protected|public|native|synchronized|abstract|threadsafe|transient|static|final)","end":"(?=[;=])","patterns":[{"include":"#storage-modifiers"},{"include":"#variables"},{"include":"#primitive-arrays"},{"include":"#object-types"}]},"method-call":{"begin":"(\\\\.)\\\\s*([$A-Z_a-z][$\\\\w]*)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"entity.name.function.java"},"3":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.method-call.java","patterns":[{"include":"#code"}]},"methods":{"begin":"(?!new)(?=[<\\\\w].*\\\\s+)(?=([^/=]|/(?!/))+\\\\()","end":"(})|(?=;)","endCaptures":{"1":{"name":"punctuation.section.method.end.bracket.curly.java"}},"name":"meta.method.java","patterns":[{"include":"#storage-modifiers"},{"begin":"(\\\\w+)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"entity.name.function.java"},"2":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.method.identifier.java","patterns":[{"include":"#parameters"},{"include":"#parens"},{"include":"#comments"}]},{"include":"#generics"},{"begin":"(?=\\\\w.*\\\\s+\\\\w+\\\\s*\\\\()","end":"(?=\\\\s+\\\\w+\\\\s*\\\\()","name":"meta.method.return-type.java","patterns":[{"include":"#all-types"},{"include":"#parens"},{"include":"#comments"}]},{"include":"#throws"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.method.begin.bracket.curly.java"}},"contentName":"meta.method.body.java","end":"(?=})","patterns":[{"include":"#code"}]},{"include":"#comments"}]},"module":{"begin":"((open)\\\\s)?(module)\\\\s+(\\\\w+)","beginCaptures":{"1":{"name":"storage.modifier.java"},"3":{"name":"storage.modifier.java"},"4":{"name":"entity.name.type.module.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.module.end.bracket.curly.java"}},"name":"meta.module.java","patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.module.begin.bracket.curly.java"}},"contentName":"meta.module.body.java","end":"(?=})","patterns":[{"include":"#comments"},{"include":"#comments-javadoc"},{"match":"\\\\b(requires|transitive|exports|opens|to|uses|provides|with)\\\\b","name":"keyword.module.java"}]}]},"numbers":{"patterns":[{"match":"\\\\b(?<!\\\\$)0([Xx])((?<!\\\\.)\\\\h([_\\\\h]*\\\\h)?[Ll]?(?!\\\\.)|(\\\\h([_\\\\h]*\\\\h)?\\\\.?|(\\\\h([_\\\\h]*\\\\h)?)?\\\\.\\\\h([_\\\\h]*\\\\h)?)[Pp][-+]?[0-9]([0-9_]*[0-9])?[DFdf]?)\\\\b(?!\\\\$)","name":"constant.numeric.hex.java"},{"match":"\\\\b(?<!\\\\$)0([Bb])[01]([01_]*[01])?[Ll]?\\\\b(?!\\\\$)","name":"constant.numeric.binary.java"},{"match":"\\\\b(?<!\\\\$)0[0-7]([0-7_]*[0-7])?[Ll]?\\\\b(?!\\\\$)","name":"constant.numeric.octal.java"},{"match":"(?<!\\\\$)(\\\\b[0-9]([0-9_]*[0-9])?\\\\.\\\\B(?!\\\\.)|\\\\b[0-9]([0-9_]*[0-9])?\\\\.([Ee][-+]?[0-9]([0-9_]*[0-9])?)[DFdf]?\\\\b|\\\\b[0-9]([0-9_]*[0-9])?\\\\.([Ee][-+]?[0-9]([0-9_]*[0-9])?)?[DFdf]\\\\b|\\\\b[0-9]([0-9_]*[0-9])?\\\\.([0-9]([0-9_]*[0-9])?)([Ee][-+]?[0-9]([0-9_]*[0-9])?)?[DFdf]?\\\\b|(?<!\\\\.)\\\\B\\\\.[0-9]([0-9_]*[0-9])?([Ee][-+]?[0-9]([0-9_]*[0-9])?)?[DFdf]?\\\\b|\\\\b[0-9]([0-9_]*[0-9])?([Ee][-+]?[0-9]([0-9_]*[0-9])?)[DFdf]?\\\\b|\\\\b[0-9]([0-9_]*[0-9])?([Ee][-+]?[0-9]([0-9_]*[0-9])?)?[DFdf]\\\\b|\\\\b(0|[1-9]([0-9_]*[0-9])?)(?!\\\\.)[Ll]?\\\\b)(?!\\\\$)","name":"constant.numeric.decimal.java"}]},"object-types":{"patterns":[{"include":"#generics"},{"begin":"\\\\b((?:[A-Z_a-z]\\\\w*\\\\s*\\\\.\\\\s*)*)([A-Z_]\\\\w*)\\\\s*(?=\\\\[)","beginCaptures":{"1":{"patterns":[{"match":"[A-Z_a-z]\\\\w*","name":"storage.type.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"}]},"2":{"name":"storage.type.object.array.java"}},"end":"(?!\\\\s*\\\\[)","patterns":[{"include":"#comments"},{"include":"#parens"}]},{"captures":{"1":{"patterns":[{"match":"[A-Z_a-z]\\\\w*","name":"storage.type.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"}]}},"match":"\\\\b((?:[A-Z_a-z]\\\\w*\\\\s*\\\\.\\\\s*)*[A-Z_]\\\\w*)\\\\s*(?=<)"},{"captures":{"1":{"patterns":[{"match":"[A-Z_a-z]\\\\w*","name":"storage.type.java"},{"match":"\\\\.","name":"punctuation.separator.period.java"}]}},"match":"\\\\b((?:[A-Z_a-z]\\\\w*\\\\s*\\\\.\\\\s*)*[A-Z_]\\\\w*)\\\\b((?=\\\\s*[\\\\n$A-Z_a-z])|(?=\\\\s*\\\\.\\\\.\\\\.))"}]},"object-types-inherited":{"patterns":[{"include":"#generics"},{"captures":{"1":{"name":"punctuation.separator.period.java"}},"match":"\\\\b(?:[A-Z]\\\\w*\\\\s*(\\\\.)\\\\s*)*[A-Z]\\\\w*\\\\b","name":"entity.other.inherited-class.java"},{"match":",","name":"punctuation.separator.delimiter.java"}]},"objects":{"match":"(?<![$\\\\w])[$A-Z_a-z][$\\\\w]*(?=\\\\s*\\\\.\\\\s*[$\\\\w]+)","name":"variable.other.object.java"},"parameters":{"patterns":[{"match":"\\\\bfinal\\\\b","name":"storage.modifier.java"},{"include":"#annotations"},{"include":"#all-types"},{"include":"#strings"},{"match":"\\\\w+","name":"variable.parameter.java"},{"match":",","name":"punctuation.separator.delimiter.java"},{"match":"\\\\.\\\\.\\\\.","name":"punctuation.definition.parameters.varargs.java"}]},"parens":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.bracket.round.java"}},"patterns":[{"include":"#code"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.bracket.square.java"}},"end":"]","endCaptures":{"0":{"name":"punctuation.bracket.square.java"}},"patterns":[{"include":"#code"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.bracket.curly.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.bracket.curly.java"}},"patterns":[{"include":"#code"}]}]},"primitive-arrays":{"patterns":[{"begin":"\\\\b(void|boolean|byte|char|short|int|float|long|double)\\\\b\\\\s*(?=\\\\[)","beginCaptures":{"1":{"name":"storage.type.primitive.array.java"}},"end":"(?!\\\\s*\\\\[)","patterns":[{"include":"#comments"},{"include":"#parens"}]}]},"primitive-types":{"match":"\\\\b(void|boolean|byte|char|short|int|float|long|double)\\\\b","name":"storage.type.primitive.java"},"properties":{"patterns":[{"captures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"keyword.control.new.java"}},"match":"(\\\\.)\\\\s*(new)"},{"captures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"variable.other.object.property.java"}},"match":"(\\\\.)\\\\s*([$A-Z_a-z][$\\\\w]*)(?=\\\\s*\\\\.\\\\s*[$A-Z_a-z][$\\\\w]*)"},{"captures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"variable.other.object.property.java"}},"match":"(\\\\.)\\\\s*([$A-Z_a-z][$\\\\w]*)"},{"captures":{"1":{"name":"punctuation.separator.period.java"},"2":{"name":"invalid.illegal.identifier.java"}},"match":"(\\\\.)\\\\s*([0-9][$\\\\w]*)"}]},"record":{"begin":"(?=\\\\w?[\\\\w\\\\s]*\\\\brecord\\\\s+[$\\\\w]+)","end":"}","endCaptures":{"0":{"name":"punctuation.section.class.end.bracket.curly.java"}},"name":"meta.record.java","patterns":[{"include":"#storage-modifiers"},{"include":"#generics"},{"include":"#comments"},{"begin":"(record)\\\\s+([$\\\\w]+)(<[$\\\\w]+>)?(\\\\()","beginCaptures":{"1":{"name":"storage.modifier.java"},"2":{"name":"entity.name.type.record.java"},"3":{"patterns":[{"include":"#generics"}]},"4":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"name":"meta.record.identifier.java","patterns":[{"include":"#code"}]},{"begin":"(implements)\\\\s","beginCaptures":{"1":{"name":"storage.modifier.implements.java"}},"end":"(?=\\\\s*\\\\{)","name":"meta.definition.class.implemented.interfaces.java","patterns":[{"include":"#object-types-inherited"},{"include":"#comments"}]},{"include":"#record-body"}]},"record-body":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.class.begin.bracket.curly.java"}},"end":"(?=})","name":"meta.record.body.java","patterns":[{"include":"#record-constructor"},{"include":"#class-body"}]},"record-constructor":{"begin":"(?!new)(?=[<\\\\w].*\\\\s+)(?=([^(/=]|/(?!/))+(?=\\\\{))","end":"(})|(?=;)","endCaptures":{"1":{"name":"punctuation.section.method.end.bracket.curly.java"}},"name":"meta.method.java","patterns":[{"include":"#storage-modifiers"},{"begin":"(\\\\w+)","beginCaptures":{"1":{"name":"entity.name.function.java"}},"end":"(?=\\\\s*\\\\{)","name":"meta.method.identifier.java","patterns":[{"include":"#comments"}]},{"include":"#comments"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.method.begin.bracket.curly.java"}},"contentName":"meta.method.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]},"static-initializer":{"patterns":[{"include":"#anonymous-block-and-instance-initializer"},{"match":"static","name":"storage.modifier.java"}]},"storage-modifiers":{"match":"\\\\b(public|private|protected|static|final|native|synchronized|abstract|threadsafe|transient|volatile|default|strictfp|sealed|non-sealed)\\\\b","name":"storage.modifier.java"},"strings":{"patterns":[{"begin":"\\"\\"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.java"}},"end":"\\"\\"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.java"}},"name":"string.quoted.triple.java","patterns":[{"match":"(\\\\\\\\\\"\\"\\")(?!\\")|(\\\\\\\\.)","name":"constant.character.escape.java"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.java"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.java"}},"name":"string.quoted.double.java","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.java"}]},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.java"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.java"}},"name":"string.quoted.single.java","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.java"}]}]},"throws":{"begin":"throws","beginCaptures":{"0":{"name":"storage.modifier.java"}},"end":"(?=[;{])","name":"meta.throwables.java","patterns":[{"match":",","name":"punctuation.separator.delimiter.java"},{"match":"[$A-Z_a-z][$.0-9A-Z_a-z]*","name":"storage.type.java"},{"include":"#comments"}]},"try-catch-finally":{"patterns":[{"begin":"\\\\btry\\\\b","beginCaptures":{"0":{"name":"keyword.control.try.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.try.end.bracket.curly.java"}},"name":"meta.try.java","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.try.resources.begin.bracket.round.java"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.try.resources.end.bracket.round.java"}},"name":"meta.try.resources.java","patterns":[{"include":"#code"}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.try.begin.bracket.curly.java"}},"contentName":"meta.try.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]},{"begin":"\\\\b(catch)\\\\b","beginCaptures":{"1":{"name":"keyword.control.catch.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.catch.end.bracket.curly.java"}},"name":"meta.catch.java","patterns":[{"include":"#comments"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.parameters.begin.bracket.round.java"}},"contentName":"meta.catch.parameters.java","end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.parameters.end.bracket.round.java"}},"patterns":[{"include":"#comments"},{"include":"#storage-modifiers"},{"begin":"[$A-Z_a-z][$.0-9A-Z_a-z]*","beginCaptures":{"0":{"name":"storage.type.java"}},"end":"(\\\\|)|(?=\\\\))","endCaptures":{"1":{"name":"punctuation.catch.separator.java"}},"patterns":[{"include":"#comments"},{"captures":{"0":{"name":"variable.parameter.java"}},"match":"\\\\w+"}]}]},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.catch.begin.bracket.curly.java"}},"contentName":"meta.catch.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]},{"begin":"\\\\bfinally\\\\b","beginCaptures":{"0":{"name":"keyword.control.finally.java"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.finally.end.bracket.curly.java"}},"name":"meta.finally.java","patterns":[{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.finally.begin.bracket.curly.java"}},"contentName":"meta.finally.body.java","end":"(?=})","patterns":[{"include":"#code"}]}]}]},"variables":{"begin":"(?=\\\\b((void|boolean|byte|char|short|int|float|long|double)|(?>(\\\\w+\\\\.)*[A-Z_]+\\\\w*))\\\\b\\\\s*(<[],.<>?\\\\[\\\\w\\\\s]*>)?\\\\s*((\\\\[])*)?\\\\s+[$A-Z_a-z][$\\\\w]*([]$,\\\\[\\\\w][],\\\\[\\\\w\\\\s]*)?\\\\s*([:;=]))","end":"(?=[:;=])","name":"meta.definition.variable.java","patterns":[{"captures":{"1":{"name":"variable.other.definition.java"}},"match":"([$A-Z_a-z][$\\\\w]*)(?=\\\\s*(\\\\[])*\\\\s*([,:;=]))"},{"include":"#all-types"},{"include":"#code"}]},"variables-local":{"begin":"(?=\\\\b(var)\\\\b\\\\s+[$A-Z_a-z][$\\\\w]*\\\\s*([:;=]))","end":"(?=[:;=])","name":"meta.definition.variable.local.java","patterns":[{"match":"\\\\bvar\\\\b","name":"storage.type.local.java"},{"captures":{"1":{"name":"variable.other.definition.java"}},"match":"([$A-Z_a-z][$\\\\w]*)(?=\\\\s*(\\\\[])*\\\\s*([:;=]))"},{"include":"#code"}]}},"scopeName":"source.java"}`))];export{t as n,n as t};
|
dist/assets/{jsx-CdSNfqbg.js → jsx-Cd5m9Jhe.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{lua-TZDFJ1MC.js → lua-BRXWLiLu.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{t as e}from"./c-B6RpAeow.js";var t=Object.freeze(JSON.parse(`{"displayName":"Lua","name":"lua","patterns":[{"begin":"\\\\b(?:(local)\\\\s+)?(function)\\\\b(?![,:])","beginCaptures":{"1":{"name":"keyword.local.lua"},"2":{"name":"keyword.control.lua"}},"end":"(?<=[-\\\\]\\"')\\\\[{}])","name":"meta.function.lua","patterns":[{"include":"#comment"},{"begin":"(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.parameters.begin.lua"}},"end":"(\\\\))|(?=[-\\\\]\\"'\\\\[{}])|(?<!\\\\.)\\\\.(?!\\\\.)","endCaptures":{"1":{"name":"punctuation.definition.parameters.finish.lua"}},"name":"meta.parameter.lua","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"constant.language.lua"},"2":{"name":"variable.parameter.function.lua"}},"match":"(\\\\.{3})\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},{"match":"[A-Z_a-z][0-9A-Z_a-z]*","name":"variable.parameter.function.lua"},{"match":",","name":"punctuation.separator.arguments.lua"},{"begin":":","beginCaptures":{"0":{"name":"punctuation.separator.arguments.lua"}},"end":"(?=[),])","patterns":[{"include":"#emmydoc.type"}]}]},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b\\\\s*(?=:)","name":"entity.name.class.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b","name":"entity.name.function.lua"}]},{"match":"(?<![.\\\\w\\\\d])0[Xx]\\\\h+(\\\\.\\\\h*)?([Ee]-?\\\\d*)?([Pp][-+]\\\\d+)?","name":"constant.numeric.float.hexadecimal.lua"},{"match":"(?<![.\\\\w\\\\d])0[Xx]\\\\.\\\\h+([Ee]-?\\\\d*)?([Pp][-+]\\\\d+)?","name":"constant.numeric.float.hexadecimal.lua"},{"match":"(?<![.\\\\w\\\\d])0[Xx]\\\\h+(?![.0-9EPep])","name":"constant.numeric.integer.hexadecimal.lua"},{"match":"(?<![.\\\\w\\\\d])\\\\d+(\\\\.\\\\d*)?([Ee]-?\\\\d*)?","name":"constant.numeric.float.lua"},{"match":"(?<![.\\\\w\\\\d])\\\\.\\\\d+([Ee]-?\\\\d*)?","name":"constant.numeric.float.lua"},{"match":"(?<![.\\\\w\\\\d])\\\\d+(?![.0-9EPep])","name":"constant.numeric.integer.lua"},{"include":"#string"},{"captures":{"1":{"name":"punctuation.definition.comment.lua"}},"match":"\\\\A(#!).*$\\\\n?","name":"comment.line.shebang.lua"},{"include":"#comment"},{"captures":{"1":{"name":"keyword.control.goto.lua"},"2":{"name":"string.tag.lua"}},"match":"\\\\b(goto)\\\\s+([A-Z_a-z][0-9A-Z_a-z]*)"},{"captures":{"1":{"name":"punctuation.section.embedded.begin.lua"},"2":{"name":"punctuation.section.embedded.end.lua"}},"match":"(::)\\\\s*[A-Z_a-z][0-9A-Z_a-z]*\\\\s*(::)","name":"string.tag.lua"},{"captures":{"0":{"name":"storage.type.attribute.lua"}},"match":"<\\\\s*(c(?:onst|lose))\\\\s*>"},{"match":"<[*A-Z_a-z][-*.0-9A-Z_a-z]*>","name":"storage.type.generic.lua"},{"match":"\\\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|in)\\\\b","name":"keyword.control.lua"},{"match":"\\\\b(local)\\\\b","name":"keyword.local.lua"},{"captures":{"1":{"name":"keyword.global.lua"}},"match":"^\\\\s*(global)\\\\b(?!\\\\s*=)"},{"match":"\\\\b(function)\\\\b(?![,:])","name":"keyword.control.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(false|nil(?!:)|true|_ENV|_G|_VERSION|math\\\\.(pi|huge|maxinteger|mininteger)|utf8\\\\.charpattern|io\\\\.(std(?:in|out|err))|package\\\\.(config|cpath|loaded|loaders|path|preload|searchers))\\\\b|(?<!\\\\.)\\\\.{3}(?!\\\\.)","name":"constant.language.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(self)\\\\b","name":"variable.language.self.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\\\b(?!\\\\s*=(?!=))","name":"support.function.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(async)\\\\b(?!\\\\s*=(?!=))","name":"entity.name.tag.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(coroutine\\\\.(create|isyieldable|close|resume|running|status|wrap|yield)|string\\\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)|table\\\\.(concat|create|insert|maxn|move|pack|remove|sort|unpack)|math\\\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?|tointeger|type)|io\\\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\\\.(loadlib|seeall|searchpath)|debug\\\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|[gs]etuservalue|set[Cc]stacklimit|traceback|upvalueid|upvaluejoin)|bit32\\\\.(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)|utf8\\\\.(char|codes|codepoint|len|offset))\\\\b(?!\\\\s*=(?!=))","name":"support.function.library.lua"},{"match":"\\\\b(\\\\|\\\\||&&|!)\\\\b","name":"keyword.operator.lua"},{"match":"\\\\b(and|or|not)\\\\b","name":"keyword.operator.logical.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?=\\\\s*(?:[\\"'({]|\\\\[\\\\[))","name":"support.function.any-method.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?=\\\\s*\\\\??:)","name":"entity.name.class.lua"},{"match":"(?<=[^.]\\\\.|:)\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?!\\\\s*=\\\\s*\\\\b(function)\\\\b)","name":"entity.other.attribute.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?!\\\\s*=\\\\s*\\\\b(function)\\\\b)","name":"variable.other.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?=\\\\s*=\\\\s*\\\\b(function)\\\\b)","name":"entity.name.function.lua"},{"match":"[-#%*+/^]|==?|~=|!=|<=?|>=?|(?<!\\\\.)\\\\.{2}(?!\\\\.)","name":"keyword.operator.lua"}],"repository":{"comment":{"patterns":[{"begin":"(^[\\\\t ]+)?(?=--)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.lua"}},"end":"(?!\\\\G)((?!^)[\\\\t ]+\\\\n)?","endCaptures":{"1":{"name":"punctuation.whitespace.comment.trailing.lua"}},"patterns":[{"begin":"--\\\\[(=*)\\\\[@@@","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.lua"}},"end":"(--)?]\\\\1]","endCaptures":{"0":{"name":"punctuation.definition.comment.end.lua"}},"name":"","patterns":[{"include":"source.lua"}]},{"begin":"--\\\\[(=*)\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.lua"}},"end":"(--)?]\\\\1]","endCaptures":{"0":{"name":"punctuation.definition.comment.end.lua"}},"name":"comment.block.lua","patterns":[{"include":"#emmydoc"},{"include":"#ldoc_tag"}]},{"begin":"----","beginCaptures":{"0":{"name":"punctuation.definition.comment.lua"}},"end":"\\\\n","name":"comment.line.double-dash.lua"},{"begin":"---","beginCaptures":{"0":{"name":"punctuation.definition.comment.lua"}},"end":"\\\\n","name":"comment.line.double-dash.documentation.lua","patterns":[{"include":"#emmydoc"},{"include":"#ldoc_tag"}]},{"begin":"--","beginCaptures":{"0":{"name":"punctuation.definition.comment.lua"}},"end":"\\\\n","name":"comment.line.double-dash.lua","patterns":[{"include":"#ldoc_tag"}]}]},{"begin":"/\\\\*","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.lua"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.lua"}},"name":"comment.block.lua","patterns":[{"include":"#emmydoc"},{"include":"#ldoc_tag"}]}]},"emmydoc":{"patterns":[{"begin":"(?<=---)[\\\\t ]*@class","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"match":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","name":"support.class.lua"},{"match":"[,:]","name":"keyword.operator.lua"}]},{"begin":"(?<=---)[\\\\t ]*@enum","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","beginCaptures":{"0":{"name":"variable.lua"}},"end":"(?=\\\\n)"}]},{"begin":"(?<=---)[\\\\t ]*@type","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@alias","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","beginCaptures":{"0":{"name":"variable.lua"}},"end":"(?=[\\\\n#])","patterns":[{"include":"#emmydoc.type"}]}]},{"begin":"(?<=---)[\\\\t ]*(@operator)\\\\s*(\\\\b[a-z]+)?","beginCaptures":{"1":{"name":"storage.type.annotation.lua"},"2":{"name":"support.function.library.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@cast","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","beginCaptures":{"0":{"name":"variable.other.lua"}},"end":"(?=\\\\n)","patterns":[{"include":"#emmydoc.type"},{"match":"([+-|])","name":"keyword.operator.lua"}]}]},{"begin":"(?<=---)[\\\\t ]*@param","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(\\\\??)","beginCaptures":{"1":{"name":"entity.name.variable.lua"},"2":{"name":"keyword.operator.lua"}},"end":"(?=[\\\\n#])","patterns":[{"include":"#emmydoc.type"}]}]},{"begin":"(?<=---)[\\\\t ]*@return","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"match":"\\\\?","name":"keyword.operator.lua"},{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@field","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"(\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b|(\\\\[))(\\\\??)","beginCaptures":{"2":{"name":"entity.name.variable.lua"},"3":{"name":"keyword.operator.lua"}},"end":"(?=[\\\\n#])","patterns":[{"include":"#string"},{"include":"#emmydoc.type"},{"match":"]","name":"keyword.operator.lua"}]}]},{"begin":"(?<=---)[\\\\t ]*@generic","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b","beginCaptures":{"0":{"name":"storage.type.generic.lua"}},"end":"(?=\\\\n)|(,)","endCaptures":{"0":{"name":"keyword.operator.lua"}},"patterns":[{"match":":","name":"keyword.operator.lua"},{"include":"#emmydoc.type"}]}]},{"begin":"(?<=---)[\\\\t ]*@vararg","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@overload","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@deprecated","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@meta","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@private","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@protected","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@package","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@version","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"match":"\\\\b(5\\\\.1|5\\\\.2|5\\\\.3|5\\\\.4|JIT)\\\\b","name":"support.class.lua"},{"match":"[,<>]","name":"keyword.operator.lua"}]},{"begin":"(?<=---)[\\\\t ]*@see","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"match":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","name":"support.class.lua"},{"match":"#","name":"keyword.operator.lua"}]},{"begin":"(?<=---)[\\\\t ]*@diagnostic","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"([-0-9A-Z_a-z]+)[\\\\t ]*(:)?","beginCaptures":{"1":{"name":"keyword.other.unit"},"2":{"name":"keyword.operator.unit"}},"end":"(?=\\\\n)","patterns":[{"match":"\\\\b([*A-Z_a-z][-0-9A-Z_a-z]*)","name":"support.class.lua"},{"match":",","name":"keyword.operator.lua"}]}]},{"begin":"(?<=---)[\\\\t ]*@module","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#string"}]},{"match":"(?<=---)[\\\\t ]*@(async|nodiscard)","name":"storage.type.annotation.lua"},{"begin":"(?<=---)\\\\|\\\\s*[+>]?","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#string"}]}]},"emmydoc.type":{"patterns":[{"begin":"\\\\bfun\\\\b","beginCaptures":{"0":{"name":"keyword.control.lua"}},"end":"(?=[#\\\\s])","patterns":[{"match":"[](),:<>?\\\\[][\\\\t ]*","name":"keyword.operator.lua"},{"match":"([A-Z_a-z][-*.0-9A-Z_a-z]*)(?<!,)[\\\\t ]*(?=\\\\??:)","name":"entity.name.variable.lua"},{"include":"#emmydoc.type"},{"include":"#string"}]},{"match":"<[*A-Z_a-z][-*.0-9A-Z_a-z]*>","name":"storage.type.generic.lua"},{"match":"\\\\basync\\\\b","name":"entity.name.tag.lua"},{"match":"[,:?\`{|}][\\\\t ]*","name":"keyword.operator.lua"},{"begin":"(?=[\\"'*.A-\\\\[_a-z])","end":"(?=[#),:?|}\\\\s])","patterns":[{"match":"([-\\\\]*,.0-9<>A-\\\\[_a-z]+)(?<!,)[\\\\t ]*","name":"support.type.lua"},{"match":"(\\\\.\\\\.\\\\.)[\\\\t ]*","name":"constant.language.lua"},{"include":"#string"}]}]},"escaped_char":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"'\\\\\\\\abfnrtv]","name":"constant.character.escape.lua"},{"match":"\\\\\\\\z[\\\\t\\\\n ]*","name":"constant.character.escape.lua"},{"match":"\\\\\\\\\\\\d{1,3}","name":"constant.character.escape.byte.lua"},{"match":"\\\\\\\\x\\\\h\\\\h","name":"constant.character.escape.byte.lua"},{"match":"\\\\\\\\u\\\\{\\\\h+}","name":"constant.character.escape.unicode.lua"},{"match":"\\\\\\\\.","name":"invalid.illegal.character.escape.lua"}]},"ldoc_tag":{"captures":{"1":{"name":"punctuation.definition.block.tag.ldoc"},"2":{"name":"storage.type.class.ldoc"}},"match":"\\\\G[\\\\t ]*(@)(alias|annotation|author|charset|class|classmod|comment|constructor|copyright|description|example|export|factory|field|file|fixme|function|include|lfunction|license|local|module|name|param|pragma|private|raise|release|return|script|section|see|set|static|submodule|summary|tfield|thread|tparam|treturn|todo|topic|type|usage|warning|within)\\\\b"},"string":{"patterns":[{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.lua"}},"end":"'[\\\\t ]*|(?=\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.lua"}},"name":"string.quoted.single.lua","patterns":[{"include":"#escaped_char"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.lua"}},"end":"\\"[\\\\t ]*|(?=\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.lua"}},"name":"string.quoted.double.lua","patterns":[{"include":"#escaped_char"}]},{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.lua"}},"end":"\`[\\\\t ]*|(?=\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.lua"}},"name":"string.quoted.double.lua"},{"begin":"(?<=\\\\.cdef)\\\\s*(\\\\[(=*)\\\\[)","beginCaptures":{"0":{"name":"string.quoted.other.multiline.lua"},"1":{"name":"punctuation.definition.string.begin.lua"}},"contentName":"meta.embedded.lua","end":"(]\\\\2])[\\\\t ]*","endCaptures":{"0":{"name":"string.quoted.other.multiline.lua"},"1":{"name":"punctuation.definition.string.end.lua"}},"patterns":[{"include":"source.c"}]},{"begin":"(?<!--)\\\\[(=*)\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.lua"}},"end":"]\\\\1][\\\\t ]*","endCaptures":{"0":{"name":"punctuation.definition.string.end.lua"}},"name":"string.quoted.other.multiline.lua"}]}},"scopeName":"source.lua","embeddedLangs":["c"]}`)),n=[...e,t];export{n as default};
|
|
|
|
| 1 |
+
import{t as e}from"./c-CIhTMkLp.js";var t=Object.freeze(JSON.parse(`{"displayName":"Lua","name":"lua","patterns":[{"begin":"\\\\b(?:(local)\\\\s+)?(function)\\\\b(?![,:])","beginCaptures":{"1":{"name":"keyword.local.lua"},"2":{"name":"keyword.control.lua"}},"end":"(?<=[-\\\\]\\"')\\\\[{}])","name":"meta.function.lua","patterns":[{"include":"#comment"},{"begin":"(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.parameters.begin.lua"}},"end":"(\\\\))|(?=[-\\\\]\\"'\\\\[{}])|(?<!\\\\.)\\\\.(?!\\\\.)","endCaptures":{"1":{"name":"punctuation.definition.parameters.finish.lua"}},"name":"meta.parameter.lua","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"constant.language.lua"},"2":{"name":"variable.parameter.function.lua"}},"match":"(\\\\.{3})\\\\s*([A-Z_a-z][0-9A-Z_a-z]*)"},{"match":"[A-Z_a-z][0-9A-Z_a-z]*","name":"variable.parameter.function.lua"},{"match":",","name":"punctuation.separator.arguments.lua"},{"begin":":","beginCaptures":{"0":{"name":"punctuation.separator.arguments.lua"}},"end":"(?=[),])","patterns":[{"include":"#emmydoc.type"}]}]},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b\\\\s*(?=:)","name":"entity.name.class.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b","name":"entity.name.function.lua"}]},{"match":"(?<![.\\\\w\\\\d])0[Xx]\\\\h+(\\\\.\\\\h*)?([Ee]-?\\\\d*)?([Pp][-+]\\\\d+)?","name":"constant.numeric.float.hexadecimal.lua"},{"match":"(?<![.\\\\w\\\\d])0[Xx]\\\\.\\\\h+([Ee]-?\\\\d*)?([Pp][-+]\\\\d+)?","name":"constant.numeric.float.hexadecimal.lua"},{"match":"(?<![.\\\\w\\\\d])0[Xx]\\\\h+(?![.0-9EPep])","name":"constant.numeric.integer.hexadecimal.lua"},{"match":"(?<![.\\\\w\\\\d])\\\\d+(\\\\.\\\\d*)?([Ee]-?\\\\d*)?","name":"constant.numeric.float.lua"},{"match":"(?<![.\\\\w\\\\d])\\\\.\\\\d+([Ee]-?\\\\d*)?","name":"constant.numeric.float.lua"},{"match":"(?<![.\\\\w\\\\d])\\\\d+(?![.0-9EPep])","name":"constant.numeric.integer.lua"},{"include":"#string"},{"captures":{"1":{"name":"punctuation.definition.comment.lua"}},"match":"\\\\A(#!).*$\\\\n?","name":"comment.line.shebang.lua"},{"include":"#comment"},{"captures":{"1":{"name":"keyword.control.goto.lua"},"2":{"name":"string.tag.lua"}},"match":"\\\\b(goto)\\\\s+([A-Z_a-z][0-9A-Z_a-z]*)"},{"captures":{"1":{"name":"punctuation.section.embedded.begin.lua"},"2":{"name":"punctuation.section.embedded.end.lua"}},"match":"(::)\\\\s*[A-Z_a-z][0-9A-Z_a-z]*\\\\s*(::)","name":"string.tag.lua"},{"captures":{"0":{"name":"storage.type.attribute.lua"}},"match":"<\\\\s*(c(?:onst|lose))\\\\s*>"},{"match":"<[*A-Z_a-z][-*.0-9A-Z_a-z]*>","name":"storage.type.generic.lua"},{"match":"\\\\b(break|do|else|for|if|elseif|goto|return|then|repeat|while|until|end|in)\\\\b","name":"keyword.control.lua"},{"match":"\\\\b(local)\\\\b","name":"keyword.local.lua"},{"captures":{"1":{"name":"keyword.global.lua"}},"match":"^\\\\s*(global)\\\\b(?!\\\\s*=)"},{"match":"\\\\b(function)\\\\b(?![,:])","name":"keyword.control.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(false|nil(?!:)|true|_ENV|_G|_VERSION|math\\\\.(pi|huge|maxinteger|mininteger)|utf8\\\\.charpattern|io\\\\.(std(?:in|out|err))|package\\\\.(config|cpath|loaded|loaders|path|preload|searchers))\\\\b|(?<!\\\\.)\\\\.{3}(?!\\\\.)","name":"constant.language.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(self)\\\\b","name":"variable.language.self.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\\\b(?!\\\\s*=(?!=))","name":"support.function.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(async)\\\\b(?!\\\\s*=(?!=))","name":"entity.name.tag.lua"},{"match":"(?<![^.]\\\\.|:)\\\\b(coroutine\\\\.(create|isyieldable|close|resume|running|status|wrap|yield)|string\\\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|pack|packsize|rep|reverse|sub|unpack|upper)|table\\\\.(concat|create|insert|maxn|move|pack|remove|sort|unpack)|math\\\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?|tointeger|type)|io\\\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\\\.(loadlib|seeall|searchpath)|debug\\\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|[gs]etuservalue|set[Cc]stacklimit|traceback|upvalueid|upvaluejoin)|bit32\\\\.(arshift|band|bnot|bor|btest|bxor|extract|replace|lrotate|lshift|rrotate|rshift)|utf8\\\\.(char|codes|codepoint|len|offset))\\\\b(?!\\\\s*=(?!=))","name":"support.function.library.lua"},{"match":"\\\\b(\\\\|\\\\||&&|!)\\\\b","name":"keyword.operator.lua"},{"match":"\\\\b(and|or|not)\\\\b","name":"keyword.operator.logical.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?=\\\\s*(?:[\\"'({]|\\\\[\\\\[))","name":"support.function.any-method.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?=\\\\s*\\\\??:)","name":"entity.name.class.lua"},{"match":"(?<=[^.]\\\\.|:)\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?!\\\\s*=\\\\s*\\\\b(function)\\\\b)","name":"entity.other.attribute.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?!\\\\s*=\\\\s*\\\\b(function)\\\\b)","name":"variable.other.lua"},{"match":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(?=\\\\s*=\\\\s*\\\\b(function)\\\\b)","name":"entity.name.function.lua"},{"match":"[-#%*+/^]|==?|~=|!=|<=?|>=?|(?<!\\\\.)\\\\.{2}(?!\\\\.)","name":"keyword.operator.lua"}],"repository":{"comment":{"patterns":[{"begin":"(^[\\\\t ]+)?(?=--)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.lua"}},"end":"(?!\\\\G)((?!^)[\\\\t ]+\\\\n)?","endCaptures":{"1":{"name":"punctuation.whitespace.comment.trailing.lua"}},"patterns":[{"begin":"--\\\\[(=*)\\\\[@@@","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.lua"}},"end":"(--)?]\\\\1]","endCaptures":{"0":{"name":"punctuation.definition.comment.end.lua"}},"name":"","patterns":[{"include":"source.lua"}]},{"begin":"--\\\\[(=*)\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.lua"}},"end":"(--)?]\\\\1]","endCaptures":{"0":{"name":"punctuation.definition.comment.end.lua"}},"name":"comment.block.lua","patterns":[{"include":"#emmydoc"},{"include":"#ldoc_tag"}]},{"begin":"----","beginCaptures":{"0":{"name":"punctuation.definition.comment.lua"}},"end":"\\\\n","name":"comment.line.double-dash.lua"},{"begin":"---","beginCaptures":{"0":{"name":"punctuation.definition.comment.lua"}},"end":"\\\\n","name":"comment.line.double-dash.documentation.lua","patterns":[{"include":"#emmydoc"},{"include":"#ldoc_tag"}]},{"begin":"--","beginCaptures":{"0":{"name":"punctuation.definition.comment.lua"}},"end":"\\\\n","name":"comment.line.double-dash.lua","patterns":[{"include":"#ldoc_tag"}]}]},{"begin":"/\\\\*","beginCaptures":{"0":{"name":"punctuation.definition.comment.begin.lua"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.lua"}},"name":"comment.block.lua","patterns":[{"include":"#emmydoc"},{"include":"#ldoc_tag"}]}]},"emmydoc":{"patterns":[{"begin":"(?<=---)[\\\\t ]*@class","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"match":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","name":"support.class.lua"},{"match":"[,:]","name":"keyword.operator.lua"}]},{"begin":"(?<=---)[\\\\t ]*@enum","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","beginCaptures":{"0":{"name":"variable.lua"}},"end":"(?=\\\\n)"}]},{"begin":"(?<=---)[\\\\t ]*@type","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@alias","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","beginCaptures":{"0":{"name":"variable.lua"}},"end":"(?=[\\\\n#])","patterns":[{"include":"#emmydoc.type"}]}]},{"begin":"(?<=---)[\\\\t ]*(@operator)\\\\s*(\\\\b[a-z]+)?","beginCaptures":{"1":{"name":"storage.type.annotation.lua"},"2":{"name":"support.function.library.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@cast","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","beginCaptures":{"0":{"name":"variable.other.lua"}},"end":"(?=\\\\n)","patterns":[{"include":"#emmydoc.type"},{"match":"([+-|])","name":"keyword.operator.lua"}]}]},{"begin":"(?<=---)[\\\\t ]*@param","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b(\\\\??)","beginCaptures":{"1":{"name":"entity.name.variable.lua"},"2":{"name":"keyword.operator.lua"}},"end":"(?=[\\\\n#])","patterns":[{"include":"#emmydoc.type"}]}]},{"begin":"(?<=---)[\\\\t ]*@return","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"match":"\\\\?","name":"keyword.operator.lua"},{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@field","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"(\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b|(\\\\[))(\\\\??)","beginCaptures":{"2":{"name":"entity.name.variable.lua"},"3":{"name":"keyword.operator.lua"}},"end":"(?=[\\\\n#])","patterns":[{"include":"#string"},{"include":"#emmydoc.type"},{"match":"]","name":"keyword.operator.lua"}]}]},{"begin":"(?<=---)[\\\\t ]*@generic","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"\\\\b([A-Z_a-z][0-9A-Z_a-z]*)\\\\b","beginCaptures":{"0":{"name":"storage.type.generic.lua"}},"end":"(?=\\\\n)|(,)","endCaptures":{"0":{"name":"keyword.operator.lua"}},"patterns":[{"match":":","name":"keyword.operator.lua"},{"include":"#emmydoc.type"}]}]},{"begin":"(?<=---)[\\\\t ]*@vararg","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@overload","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#emmydoc.type"}]},{"begin":"(?<=---)[\\\\t ]*@deprecated","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@meta","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@private","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@protected","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@package","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])"},{"begin":"(?<=---)[\\\\t ]*@version","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"match":"\\\\b(5\\\\.1|5\\\\.2|5\\\\.3|5\\\\.4|JIT)\\\\b","name":"support.class.lua"},{"match":"[,<>]","name":"keyword.operator.lua"}]},{"begin":"(?<=---)[\\\\t ]*@see","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"match":"\\\\b([*A-Z_a-z][-*.0-9A-Z_a-z]*)","name":"support.class.lua"},{"match":"#","name":"keyword.operator.lua"}]},{"begin":"(?<=---)[\\\\t ]*@diagnostic","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"begin":"([-0-9A-Z_a-z]+)[\\\\t ]*(:)?","beginCaptures":{"1":{"name":"keyword.other.unit"},"2":{"name":"keyword.operator.unit"}},"end":"(?=\\\\n)","patterns":[{"match":"\\\\b([*A-Z_a-z][-0-9A-Z_a-z]*)","name":"support.class.lua"},{"match":",","name":"keyword.operator.lua"}]}]},{"begin":"(?<=---)[\\\\t ]*@module","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#string"}]},{"match":"(?<=---)[\\\\t ]*@(async|nodiscard)","name":"storage.type.annotation.lua"},{"begin":"(?<=---)\\\\|\\\\s*[+>]?","beginCaptures":{"0":{"name":"storage.type.annotation.lua"}},"end":"(?=[\\\\n#@])","patterns":[{"include":"#string"}]}]},"emmydoc.type":{"patterns":[{"begin":"\\\\bfun\\\\b","beginCaptures":{"0":{"name":"keyword.control.lua"}},"end":"(?=[#\\\\s])","patterns":[{"match":"[](),:<>?\\\\[][\\\\t ]*","name":"keyword.operator.lua"},{"match":"([A-Z_a-z][-*.0-9A-Z_a-z]*)(?<!,)[\\\\t ]*(?=\\\\??:)","name":"entity.name.variable.lua"},{"include":"#emmydoc.type"},{"include":"#string"}]},{"match":"<[*A-Z_a-z][-*.0-9A-Z_a-z]*>","name":"storage.type.generic.lua"},{"match":"\\\\basync\\\\b","name":"entity.name.tag.lua"},{"match":"[,:?\`{|}][\\\\t ]*","name":"keyword.operator.lua"},{"begin":"(?=[\\"'*.A-\\\\[_a-z])","end":"(?=[#),:?|}\\\\s])","patterns":[{"match":"([-\\\\]*,.0-9<>A-\\\\[_a-z]+)(?<!,)[\\\\t ]*","name":"support.type.lua"},{"match":"(\\\\.\\\\.\\\\.)[\\\\t ]*","name":"constant.language.lua"},{"include":"#string"}]}]},"escaped_char":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"'\\\\\\\\abfnrtv]","name":"constant.character.escape.lua"},{"match":"\\\\\\\\z[\\\\t\\\\n ]*","name":"constant.character.escape.lua"},{"match":"\\\\\\\\\\\\d{1,3}","name":"constant.character.escape.byte.lua"},{"match":"\\\\\\\\x\\\\h\\\\h","name":"constant.character.escape.byte.lua"},{"match":"\\\\\\\\u\\\\{\\\\h+}","name":"constant.character.escape.unicode.lua"},{"match":"\\\\\\\\.","name":"invalid.illegal.character.escape.lua"}]},"ldoc_tag":{"captures":{"1":{"name":"punctuation.definition.block.tag.ldoc"},"2":{"name":"storage.type.class.ldoc"}},"match":"\\\\G[\\\\t ]*(@)(alias|annotation|author|charset|class|classmod|comment|constructor|copyright|description|example|export|factory|field|file|fixme|function|include|lfunction|license|local|module|name|param|pragma|private|raise|release|return|script|section|see|set|static|submodule|summary|tfield|thread|tparam|treturn|todo|topic|type|usage|warning|within)\\\\b"},"string":{"patterns":[{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.lua"}},"end":"'[\\\\t ]*|(?=\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.lua"}},"name":"string.quoted.single.lua","patterns":[{"include":"#escaped_char"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.lua"}},"end":"\\"[\\\\t ]*|(?=\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.lua"}},"name":"string.quoted.double.lua","patterns":[{"include":"#escaped_char"}]},{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.lua"}},"end":"\`[\\\\t ]*|(?=\\\\n)","endCaptures":{"0":{"name":"punctuation.definition.string.end.lua"}},"name":"string.quoted.double.lua"},{"begin":"(?<=\\\\.cdef)\\\\s*(\\\\[(=*)\\\\[)","beginCaptures":{"0":{"name":"string.quoted.other.multiline.lua"},"1":{"name":"punctuation.definition.string.begin.lua"}},"contentName":"meta.embedded.lua","end":"(]\\\\2])[\\\\t ]*","endCaptures":{"0":{"name":"string.quoted.other.multiline.lua"},"1":{"name":"punctuation.definition.string.end.lua"}},"patterns":[{"include":"source.c"}]},{"begin":"(?<!--)\\\\[(=*)\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.lua"}},"end":"]\\\\1][\\\\t ]*","endCaptures":{"0":{"name":"punctuation.definition.string.end.lua"}},"name":"string.quoted.other.multiline.lua"}]}},"scopeName":"source.lua","embeddedLangs":["c"]}`)),n=[...e,t];export{n as default};
|
dist/assets/{nginx-CeAC-n3c.js → nginx-DbLfDlGw.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import e from"./lua-TZDFJ1MC.js";var t=Object.freeze(JSON.parse(`{"displayName":"Nginx","fileTypes":["conf.erb","conf","ngx","nginx.conf","mime.types","fastcgi_params","scgi_params","uwsgi_params"],"foldingStartMarker":"\\\\{\\\\s*$","foldingStopMarker":"^\\\\s*}","name":"nginx","patterns":[{"match":"#.*","name":"comment.line.number-sign"},{"begin":"\\\\b((?:content|rewrite|access|init_worker|init|set|log|balancer|ssl_(?:client_hello|session_fetch|certificate))_by_lua(?:_block)?)\\\\s*\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"contentName":"meta.embedded.block.lua","end":"}","name":"meta.context.lua.nginx","patterns":[{"include":"source.lua"}]},{"begin":"\\\\b((?:content|rewrite|access|init_worker|init|set|log|balancer|ssl_(?:client_hello|session_fetch|certificate))_by_lua)\\\\s*'","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"contentName":"meta.embedded.block.lua","end":"'","name":"meta.context.lua.nginx","patterns":[{"include":"source.lua"}]},{"begin":"\\\\b(events) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.events.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(http) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.http.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(mail) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.mail.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(stream) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.stream.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(server) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.server.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(location) +(\\\\^?~\\\\*?|=) +(.*?)\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"},"2":{"name":"keyword.operator.nginx"},"3":{"name":"string.regexp.nginx"}},"end":"}","name":"meta.context.location.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(location) +(.*?)\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"},"2":{"name":"entity.name.context.location.nginx"}},"end":"}","name":"meta.context.location.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(limit_except) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.limit_except.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(if) +\\\\(","beginCaptures":{"1":{"name":"keyword.control.nginx"}},"end":"\\\\)","name":"meta.context.if.nginx","patterns":[{"include":"#if_condition"}]},{"begin":"\\\\b(upstream) +(.*?)\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"},"2":{"name":"entity.name.context.location.nginx"}},"end":"}","name":"meta.context.upstream.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(types) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.types.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(map) +(\\\\$)([0-9A-Z_a-z]+) +(\\\\$)([0-9A-Z_a-z]+) *\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"},"2":{"name":"punctuation.definition.variable.nginx"},"3":{"name":"variable.parameter.nginx"},"4":{"name":"punctuation.definition.variable.nginx"},"5":{"name":"variable.other.nginx"}},"end":"}","name":"meta.context.map.nginx","patterns":[{"include":"#values"},{"match":";","name":"punctuation.terminator.nginx"},{"match":"#.*","name":"comment.line.number-sign"}]},{"begin":"\\\\{","end":"}","name":"meta.block.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(return)\\\\b","beginCaptures":{"1":{"name":"keyword.control.nginx"}},"end":";","patterns":[{"include":"#values"}]},{"begin":"\\\\b(rewrite)\\\\s+","beginCaptures":{"1":{"name":"keyword.directive.nginx"}},"end":"(last|break|redirect|permanent)?(;)","endCaptures":{"1":{"name":"keyword.other.nginx"},"2":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"\\\\b(server)\\\\s+","beginCaptures":{"1":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"1":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#server_parameters"}]},{"begin":"\\\\b(internal|empty_gif|f4f|flv|hls|mp4|break|status|stub_status|ip_hash|ntlm|least_conn|upstream_conf|least_conn|zone_sync)\\\\b","beginCaptures":{"1":{"name":"keyword.directive.nginx"}},"end":"(;|$)","endCaptures":{"1":{"name":"punctuation.terminator.nginx"}}},{"begin":"([\\"'\\\\s]|^)(accept_)(mutex(?:|_delay))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(debug_)(connection|points)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(error_)(log|page)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(ssl_)(engine|buffer_size|certificate|certificate_key|ciphers|client_certificate|conf_command|crl|dhparam|early_data|ecdh_curve|ocsp|ocsp_cache|ocsp_responder|password_file|prefer_server_ciphers|protocols|reject_handshake|session_cache|session_ticket_key|session_tickets|session_timeout|stapling|stapling_file|stapling_responder|stapling_verify|trusted_certificate|verify_client|verify_depth|alpn|handshake_timeout|preread)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(worker_)(aio_requests|connections|cpu_affinity|priority|processes|rlimit_core|rlimit_nofile|shutdown_timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(auth_)(delay|basic|basic_user_file|jwt|jwt_claim_set|jwt_header_set|jwt_key_cache|jwt_key_file|jwt_key_request|jwt_leeway|jwt_type|jwt_require|request|request_set|http|http_header|http_pass_client_cert|http_timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(client_)(body_buffer_size|body_in_file_only|body_in_single_buffer|body_temp_path|body_timeout|header_buffer_size|header_timeout|max_body_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(keepalive_)(disable|requests|time|timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(limit_)(rate|rate_after|conn|conn_dry_run|conn_log_level|conn_status|conn_zone|zone|req|req_dry_run|req_log_level|req_status|req_zone)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(lingering_)(close|time|timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(log_)(not_found|subrequest|format)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(max_)(ranges|errors)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(msie_)(padding|refresh)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(open_)(file_cache|file_cache_errors|file_cache_min_uses|file_cache_valid|log_file_cache)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(send_)(lowat|timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(server_)(name|name_in_redirect|names_hash_bucket_size|names_hash_max_size|tokens)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(tcp_)(no(?:delay|push))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(types_)(hash_(?:bucket|max)_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(variables_)(hash_(?:bucket|max)_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(add_)(before_body|after_body|header|trailer)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(status_)(zone|format)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(autoindex_)(exact_size|format|localtime)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(ancient_)(browser(?:|_value))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(modern_)(browser(?:|_value))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(charset_)(map|types)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(dav_)(access|methods)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(fastcgi_)(bind|buffer_size|buffering|buffers|busy_buffers_size|cache|cache_background_update|cache_bypass|cache_key|cache_lock|cache_lock_age|cache_lock_timeout|cache_max_range_offset|cache_methods|cache_min_uses|cache_path|cache_purge|cache_revalidate|cache_use_stale|cache_valid|catch_stderr|connect_timeout|force_ranges|hide_header|ignore_client_abort|ignore_headers|index|intercept_errors|keep_conn|limit_rate|max_temp_file_size|next_upstream|next_upstream_timeout|next_upstream_tries|no_cache|param|pass|pass_header|pass_request_body|pass_request_headers|read_timeout|request_buffering|send_lowat|send_timeout|socket_keepalive|split_path_info|store|store_access|temp_file_write_size|temp_path)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(geoip_)(country|city|org|proxy|proxy_recursive)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(grpc_)(bind|buffer_size|connect_timeout|hide_header|ignore_headers|intercept_errors|next_upstream|next_upstream_timeout|next_upstream_tries|pass|pass_header|read_timeout|send_timeout|set_header|socket_keepalive|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_conf_command|ssl_crl|ssl_name|ssl_password_file|ssl_protocols|ssl_server_name|ssl_session_reuse|ssl_trusted_certificate|ssl_verify|ssl_verify_depth)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(gzip_)(buffers|comp_level|disable|http_version|min_length|proxied|types|vary|static)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(hls_)(buffers|forward_args|fragment|mp4_buffer_size|mp4_max_buffer_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(image_)(filter(?:|_buffer|_interlace|_jpeg_quality|_sharpen|_transparency|_webp_quality))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(map_)(hash_(?:bucket|max)_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(memcached_)(bind|buffer_size|connect_timeout|gzip_flag|next_upstream|next_upstream_timeout|next_upstream_tries|pass|read_timeout|send_timeout|socket_keepalive)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(mp4_)(buffer_size|max_buffer_size|limit_rate|limit_rate_after|start_key_frame)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(perl_)(modules|require|set)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(proxy_)(bind|buffer_size|buffering|buffers|busy_buffers_size|cache|cache_background_update|cache_bypass|cache_convert_head|cache_key|cache_lock|cache_lock_age|cache_lock_timeout|cache_max_range_offset|cache_methods|cache_min_uses|cache_path|cache_purge|cache_revalidate|cache_use_stale|cache_valid|connect_timeout|cookie_domain|cookie_flags|cookie_path|force_ranges|headers_hash_bucket_size|headers_hash_max_size|hide_header|http_version|ignore_client_abort|ignore_headers|intercept_errors|limit_rate|max_temp_file_size|method|next_upstream|next_upstream_timeout|next_upstream_tries|no_cache|pass|pass_header|pass_request_body|pass_request_headers|read_timeout|redirect|request_buffering|send_lowat|send_timeout|set_body|set_header|socket_keepalive|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_conf_command|ssl_crl|ssl_name|ssl_password_file|ssl_protocols|ssl_server_name|ssl_session_reuse|ssl_trusted_certificate|ssl_verify|ssl_verify_depth|store|store_access|temp_file_write_size|temp_path|buffer|pass_error_message|protocol|smtp_auth|timeout|protocol_timeout|download_rate|half_close|requests|responses|session_drop|ssl|upload_rate)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(real_)(ip_(?:header|recursive))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(referer_)(hash_(?:bucket|max)_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(scgi_)(bind|buffer_size|buffering|buffers|busy_buffers_size|cache|cache_background_update|cache_bypass|cache_key|cache_lock|cache_lock_age|cache_lock_timeout|cache_max_range_offset|cache_methods|cache_min_uses|cache_path|cache_purge|cache_revalidate|cache_use_stale|cache_valid|connect_timeout|force_ranges|hide_header|ignore_client_abort|ignore_headers|intercept_errors|limit_rate|max_temp_file_size|next_upstream|next_upstream_timeout|next_upstream_tries|no_cache|param|pass|pass_header|pass_request_body|pass_request_headers|read_timeout|request_buffering|send_timeout|socket_keepalive|store|store_access|temp_file_write_size|temp_path)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(secure_)(link(?:|_md5|_secret))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(session_)(log(?:|_format|_zone))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(ssi_)(last_modified|min_file_chunk|silent_errors|types|value_length)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(sub_)(filter(?:|_last_modified|_once|_types))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(health_)(check(?:|_timeout))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(userid_)(domain|expires|flags|mark|name|p3p|path|service)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(uwsgi_)(bind|buffer_size|buffering|buffers|busy_buffers_size|cache|cache_background_update|cache_bypass|cache_key|cache_lock|cache_lock_age|cache_lock_timeout|cache_max_range_offset|cache_methods|cache_min_uses|cache_path|cache_purge|cache_revalidate|cache_use_stale|cache_valid|connect_timeout|force_ranges|hide_header|ignore_client_abort|ignore_headers|intercept_errors|limit_rate|max_temp_file_size|modifier1|modifier2|next_upstream|next_upstream_timeout|next_upstream_tries|no_cache|param|pass|pass_header|pass_request_body|pass_request_headers|read_timeout|request_buffering|send_timeout|socket_keepalive|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_conf_command|ssl_crl|ssl_name|ssl_password_file|ssl_protocols|ssl_server_name|ssl_session_reuse|ssl_trusted_certificate|ssl_verify|ssl_verify_depth|store|store_access|temp_file_write_size|temp_path)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(http2_)(body_preread_size|chunk_size|idle_timeout|max_concurrent_pushes|max_concurrent_streams|max_field_size|max_header_size|max_requests|push|push_preload|recv_buffer_size|recv_timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(http3_)(hq|max_concurrent_streams|stream_buffer_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(quic_)(active_connection_id_limit|bpf|gso|host_key|retry)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(xslt_)(last_modified|param|string_param|stylesheet|types)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(imap_)(auth|capabilities|client_buffer)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(pop3_)(auth|capabilities)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(smtp_)(auth|capabilities|client_buffer|greeting_delay)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(preread_)(buffer_size|timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(mqtt_)(preread|buffers|rewrite_buffer_size|set_connect)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(zone_)(sync_(?:buffers|connect_retry_interval|connect_timeout|interval|recv_buffer_size|server|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_conf_command|ssl_crl|ssl_name|ssl_password_file|ssl_protocols|ssl_server_name|ssl_trusted_certificate|ssl_verify|ssl_verify_depth|timeout))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(otel_)(exporter|service_name|trace|trace_context|span_name|span_attr)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(js_)(body_filter|content|fetch_buffer_size|fetch_ciphers|fetch_max_response_buffer_size|fetch_protocols|fetch_timeout|fetch_trusted_certificate|fetch_verify|fetch_verify_depth|header_filter|import|include|path|periodic|preload_object|set|shared_dict_zone|var|access|filter|preread)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(daemon|env|include|pid|user??|aio|alias|directio|etag|listen|resolver|root|satisfy|sendfile|allow|deny|api|autoindex|charset|geo|gunzip|gzip|expires|index|keyval|mirror|perl|set|slice|ssi|ssl|zone|state|hash|keepalive|queue|random|sticky|match|userid|http2|http3|protocol|timeout|xclient|starttls|mqtt|load_module|lock_file|master_process|multi_accept|pcre_jit|thread_pool|timer_resolution|working_directory|absolute_redirect|aio_write|chunked_transfer_encoding|connection_pool_size|default_type|directio_alignment|disable_symlinks|if_modified_since|ignore_invalid_headers|large_client_header_buffers|merge_slashes|output_buffers|port_in_redirect|postpone_output|read_ahead|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver_timeout|sendfile_max_chunk|subrequest_output_buffer_size|try_files|underscores_in_headers|addition_types|override_charset|source_charset|create_full_put_path|min_delete_depth|f4f_buffer_size|gunzip_buffers|internal_redirect|keyval_zone|access_log|mirror_request_body|random_index|set_real_ip_from|valid_referers|rewrite_log|uninitialized_variable_warn|split_clients|least_time|sticky_cookie_insert|xml_entities|google_perftools_profiles)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"\\\\b([0-9A-Z_a-z]+)\\\\s+","beginCaptures":{"1":{"name":"keyword.directive.unknown.nginx"}},"end":"(;|$)","endCaptures":{"1":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"\\\\b([a-z]+/[-+.0-9A-Za-z]+)\\\\b","beginCaptures":{"1":{"name":"constant.other.mediatype.nginx"}},"end":"(;)","endCaptures":{"1":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]}],"repository":{"if_condition":{"patterns":[{"include":"#variables"},{"match":"!?~\\\\*?\\\\s","name":"keyword.operator.nginx"},{"match":"!?-[defx]\\\\s","name":"keyword.operator.nginx"},{"match":"!?=[^=]","name":"keyword.operator.nginx"},{"include":"#regexp_and_string"}]},"regexp_and_string":{"patterns":[{"match":"\\\\^.*?\\\\$","name":"string.regexp.nginx"},{"begin":"\\"","end":"\\"","name":"string.quoted.double.nginx","patterns":[{"match":"\\\\\\\\[\\"'\\\\\\\\nt]","name":"constant.character.escape.nginx"},{"include":"#variables"}]},{"begin":"'","end":"'","name":"string.quoted.single.nginx","patterns":[{"match":"\\\\\\\\[\\"'\\\\\\\\nt]","name":"constant.character.escape.nginx"},{"include":"#variables"}]}]},"server_parameters":{"patterns":[{"captures":{"1":{"name":"variable.parameter.nginx"},"2":{"name":"keyword.operator.nginx"},"3":{"name":"constant.numeric.nginx"}},"match":"(?:^|\\\\s)(weight|max_conn|max_fails|fail_timeout|slow_start)(=)(\\\\d[.\\\\d]*[BDGHKMSTbdghkmst]?)(?:[;\\\\s]|$)"},{"include":"#values"}]},"values":{"patterns":[{"include":"#variables"},{"match":"#.*","name":"comment.line.number-sign"},{"captures":{"1":{"name":"constant.numeric.nginx"}},"match":"(?<=\\\\G|\\\\s)(=?[0-9][.0-9]*[BDGHKMSTbdghkmst]?)(?=[\\\\t ;])"},{"match":"(?<=\\\\G|\\\\s)(on|off|true|false)(?=[\\\\t ;])","name":"constant.language.nginx"},{"match":"(?<=\\\\G|\\\\s)(kqueue|rtsig|epoll|/dev/poll|select|poll|eventport|max|all|default_server|default|main|crit|error|debug|warn|notice|last)(?=[\\\\t ;])","name":"constant.language.nginx"},{"match":"\\\\\\\\.* |~\\\\*?|!~\\\\*?","name":"keyword.operator.nginx"},{"include":"#regexp_and_string"}]},"variables":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.nginx"},"2":{"name":"variable.other.nginx"}},"match":"(\\\\$)([0-9A-Z_a-z]+)\\\\b"},{"captures":{"1":{"name":"punctuation.definition.variable.nginx"},"2":{"name":"variable.other.nginx"},"3":{"name":"punctuation.definition.variable.nginx"}},"match":"(\\\\$\\\\{)([0-9A-Z_a-z]+)(})"}]}},"scopeName":"source.nginx","embeddedLangs":["lua"]}`)),n=[...e,t];export{n as default};
|
|
|
|
| 1 |
+
import e from"./lua-BRXWLiLu.js";var t=Object.freeze(JSON.parse(`{"displayName":"Nginx","fileTypes":["conf.erb","conf","ngx","nginx.conf","mime.types","fastcgi_params","scgi_params","uwsgi_params"],"foldingStartMarker":"\\\\{\\\\s*$","foldingStopMarker":"^\\\\s*}","name":"nginx","patterns":[{"match":"#.*","name":"comment.line.number-sign"},{"begin":"\\\\b((?:content|rewrite|access|init_worker|init|set|log|balancer|ssl_(?:client_hello|session_fetch|certificate))_by_lua(?:_block)?)\\\\s*\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"contentName":"meta.embedded.block.lua","end":"}","name":"meta.context.lua.nginx","patterns":[{"include":"source.lua"}]},{"begin":"\\\\b((?:content|rewrite|access|init_worker|init|set|log|balancer|ssl_(?:client_hello|session_fetch|certificate))_by_lua)\\\\s*'","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"contentName":"meta.embedded.block.lua","end":"'","name":"meta.context.lua.nginx","patterns":[{"include":"source.lua"}]},{"begin":"\\\\b(events) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.events.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(http) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.http.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(mail) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.mail.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(stream) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.stream.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(server) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.server.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(location) +(\\\\^?~\\\\*?|=) +(.*?)\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"},"2":{"name":"keyword.operator.nginx"},"3":{"name":"string.regexp.nginx"}},"end":"}","name":"meta.context.location.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(location) +(.*?)\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"},"2":{"name":"entity.name.context.location.nginx"}},"end":"}","name":"meta.context.location.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(limit_except) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.limit_except.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(if) +\\\\(","beginCaptures":{"1":{"name":"keyword.control.nginx"}},"end":"\\\\)","name":"meta.context.if.nginx","patterns":[{"include":"#if_condition"}]},{"begin":"\\\\b(upstream) +(.*?)\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"},"2":{"name":"entity.name.context.location.nginx"}},"end":"}","name":"meta.context.upstream.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(types) +\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"}},"end":"}","name":"meta.context.types.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(map) +(\\\\$)([0-9A-Z_a-z]+) +(\\\\$)([0-9A-Z_a-z]+) *\\\\{","beginCaptures":{"1":{"name":"storage.type.directive.context.nginx"},"2":{"name":"punctuation.definition.variable.nginx"},"3":{"name":"variable.parameter.nginx"},"4":{"name":"punctuation.definition.variable.nginx"},"5":{"name":"variable.other.nginx"}},"end":"}","name":"meta.context.map.nginx","patterns":[{"include":"#values"},{"match":";","name":"punctuation.terminator.nginx"},{"match":"#.*","name":"comment.line.number-sign"}]},{"begin":"\\\\{","end":"}","name":"meta.block.nginx","patterns":[{"include":"$self"}]},{"begin":"\\\\b(return)\\\\b","beginCaptures":{"1":{"name":"keyword.control.nginx"}},"end":";","patterns":[{"include":"#values"}]},{"begin":"\\\\b(rewrite)\\\\s+","beginCaptures":{"1":{"name":"keyword.directive.nginx"}},"end":"(last|break|redirect|permanent)?(;)","endCaptures":{"1":{"name":"keyword.other.nginx"},"2":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"\\\\b(server)\\\\s+","beginCaptures":{"1":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"1":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#server_parameters"}]},{"begin":"\\\\b(internal|empty_gif|f4f|flv|hls|mp4|break|status|stub_status|ip_hash|ntlm|least_conn|upstream_conf|least_conn|zone_sync)\\\\b","beginCaptures":{"1":{"name":"keyword.directive.nginx"}},"end":"(;|$)","endCaptures":{"1":{"name":"punctuation.terminator.nginx"}}},{"begin":"([\\"'\\\\s]|^)(accept_)(mutex(?:|_delay))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(debug_)(connection|points)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(error_)(log|page)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(ssl_)(engine|buffer_size|certificate|certificate_key|ciphers|client_certificate|conf_command|crl|dhparam|early_data|ecdh_curve|ocsp|ocsp_cache|ocsp_responder|password_file|prefer_server_ciphers|protocols|reject_handshake|session_cache|session_ticket_key|session_tickets|session_timeout|stapling|stapling_file|stapling_responder|stapling_verify|trusted_certificate|verify_client|verify_depth|alpn|handshake_timeout|preread)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(worker_)(aio_requests|connections|cpu_affinity|priority|processes|rlimit_core|rlimit_nofile|shutdown_timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(auth_)(delay|basic|basic_user_file|jwt|jwt_claim_set|jwt_header_set|jwt_key_cache|jwt_key_file|jwt_key_request|jwt_leeway|jwt_type|jwt_require|request|request_set|http|http_header|http_pass_client_cert|http_timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(client_)(body_buffer_size|body_in_file_only|body_in_single_buffer|body_temp_path|body_timeout|header_buffer_size|header_timeout|max_body_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(keepalive_)(disable|requests|time|timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(limit_)(rate|rate_after|conn|conn_dry_run|conn_log_level|conn_status|conn_zone|zone|req|req_dry_run|req_log_level|req_status|req_zone)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(lingering_)(close|time|timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(log_)(not_found|subrequest|format)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(max_)(ranges|errors)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(msie_)(padding|refresh)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(open_)(file_cache|file_cache_errors|file_cache_min_uses|file_cache_valid|log_file_cache)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(send_)(lowat|timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(server_)(name|name_in_redirect|names_hash_bucket_size|names_hash_max_size|tokens)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(tcp_)(no(?:delay|push))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(types_)(hash_(?:bucket|max)_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(variables_)(hash_(?:bucket|max)_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(add_)(before_body|after_body|header|trailer)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(status_)(zone|format)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(autoindex_)(exact_size|format|localtime)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(ancient_)(browser(?:|_value))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(modern_)(browser(?:|_value))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(charset_)(map|types)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(dav_)(access|methods)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(fastcgi_)(bind|buffer_size|buffering|buffers|busy_buffers_size|cache|cache_background_update|cache_bypass|cache_key|cache_lock|cache_lock_age|cache_lock_timeout|cache_max_range_offset|cache_methods|cache_min_uses|cache_path|cache_purge|cache_revalidate|cache_use_stale|cache_valid|catch_stderr|connect_timeout|force_ranges|hide_header|ignore_client_abort|ignore_headers|index|intercept_errors|keep_conn|limit_rate|max_temp_file_size|next_upstream|next_upstream_timeout|next_upstream_tries|no_cache|param|pass|pass_header|pass_request_body|pass_request_headers|read_timeout|request_buffering|send_lowat|send_timeout|socket_keepalive|split_path_info|store|store_access|temp_file_write_size|temp_path)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(geoip_)(country|city|org|proxy|proxy_recursive)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(grpc_)(bind|buffer_size|connect_timeout|hide_header|ignore_headers|intercept_errors|next_upstream|next_upstream_timeout|next_upstream_tries|pass|pass_header|read_timeout|send_timeout|set_header|socket_keepalive|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_conf_command|ssl_crl|ssl_name|ssl_password_file|ssl_protocols|ssl_server_name|ssl_session_reuse|ssl_trusted_certificate|ssl_verify|ssl_verify_depth)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(gzip_)(buffers|comp_level|disable|http_version|min_length|proxied|types|vary|static)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(hls_)(buffers|forward_args|fragment|mp4_buffer_size|mp4_max_buffer_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(image_)(filter(?:|_buffer|_interlace|_jpeg_quality|_sharpen|_transparency|_webp_quality))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(map_)(hash_(?:bucket|max)_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(memcached_)(bind|buffer_size|connect_timeout|gzip_flag|next_upstream|next_upstream_timeout|next_upstream_tries|pass|read_timeout|send_timeout|socket_keepalive)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(mp4_)(buffer_size|max_buffer_size|limit_rate|limit_rate_after|start_key_frame)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(perl_)(modules|require|set)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(proxy_)(bind|buffer_size|buffering|buffers|busy_buffers_size|cache|cache_background_update|cache_bypass|cache_convert_head|cache_key|cache_lock|cache_lock_age|cache_lock_timeout|cache_max_range_offset|cache_methods|cache_min_uses|cache_path|cache_purge|cache_revalidate|cache_use_stale|cache_valid|connect_timeout|cookie_domain|cookie_flags|cookie_path|force_ranges|headers_hash_bucket_size|headers_hash_max_size|hide_header|http_version|ignore_client_abort|ignore_headers|intercept_errors|limit_rate|max_temp_file_size|method|next_upstream|next_upstream_timeout|next_upstream_tries|no_cache|pass|pass_header|pass_request_body|pass_request_headers|read_timeout|redirect|request_buffering|send_lowat|send_timeout|set_body|set_header|socket_keepalive|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_conf_command|ssl_crl|ssl_name|ssl_password_file|ssl_protocols|ssl_server_name|ssl_session_reuse|ssl_trusted_certificate|ssl_verify|ssl_verify_depth|store|store_access|temp_file_write_size|temp_path|buffer|pass_error_message|protocol|smtp_auth|timeout|protocol_timeout|download_rate|half_close|requests|responses|session_drop|ssl|upload_rate)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(real_)(ip_(?:header|recursive))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(referer_)(hash_(?:bucket|max)_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(scgi_)(bind|buffer_size|buffering|buffers|busy_buffers_size|cache|cache_background_update|cache_bypass|cache_key|cache_lock|cache_lock_age|cache_lock_timeout|cache_max_range_offset|cache_methods|cache_min_uses|cache_path|cache_purge|cache_revalidate|cache_use_stale|cache_valid|connect_timeout|force_ranges|hide_header|ignore_client_abort|ignore_headers|intercept_errors|limit_rate|max_temp_file_size|next_upstream|next_upstream_timeout|next_upstream_tries|no_cache|param|pass|pass_header|pass_request_body|pass_request_headers|read_timeout|request_buffering|send_timeout|socket_keepalive|store|store_access|temp_file_write_size|temp_path)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(secure_)(link(?:|_md5|_secret))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(session_)(log(?:|_format|_zone))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(ssi_)(last_modified|min_file_chunk|silent_errors|types|value_length)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(sub_)(filter(?:|_last_modified|_once|_types))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(health_)(check(?:|_timeout))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(userid_)(domain|expires|flags|mark|name|p3p|path|service)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(uwsgi_)(bind|buffer_size|buffering|buffers|busy_buffers_size|cache|cache_background_update|cache_bypass|cache_key|cache_lock|cache_lock_age|cache_lock_timeout|cache_max_range_offset|cache_methods|cache_min_uses|cache_path|cache_purge|cache_revalidate|cache_use_stale|cache_valid|connect_timeout|force_ranges|hide_header|ignore_client_abort|ignore_headers|intercept_errors|limit_rate|max_temp_file_size|modifier1|modifier2|next_upstream|next_upstream_timeout|next_upstream_tries|no_cache|param|pass|pass_header|pass_request_body|pass_request_headers|read_timeout|request_buffering|send_timeout|socket_keepalive|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_conf_command|ssl_crl|ssl_name|ssl_password_file|ssl_protocols|ssl_server_name|ssl_session_reuse|ssl_trusted_certificate|ssl_verify|ssl_verify_depth|store|store_access|temp_file_write_size|temp_path)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(http2_)(body_preread_size|chunk_size|idle_timeout|max_concurrent_pushes|max_concurrent_streams|max_field_size|max_header_size|max_requests|push|push_preload|recv_buffer_size|recv_timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(http3_)(hq|max_concurrent_streams|stream_buffer_size)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(quic_)(active_connection_id_limit|bpf|gso|host_key|retry)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(xslt_)(last_modified|param|string_param|stylesheet|types)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(imap_)(auth|capabilities|client_buffer)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(pop3_)(auth|capabilities)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(smtp_)(auth|capabilities|client_buffer|greeting_delay)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(preread_)(buffer_size|timeout)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(mqtt_)(preread|buffers|rewrite_buffer_size|set_connect)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(zone_)(sync_(?:buffers|connect_retry_interval|connect_timeout|interval|recv_buffer_size|server|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_conf_command|ssl_crl|ssl_name|ssl_password_file|ssl_protocols|ssl_server_name|ssl_trusted_certificate|ssl_verify|ssl_verify_depth|timeout))([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(otel_)(exporter|service_name|trace|trace_context|span_name|span_attr)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(js_)(body_filter|content|fetch_buffer_size|fetch_ciphers|fetch_max_response_buffer_size|fetch_protocols|fetch_timeout|fetch_trusted_certificate|fetch_verify|fetch_verify_depth|header_filter|import|include|path|periodic|preload_object|set|shared_dict_zone|var|access|filter|preread)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"},"4":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"([\\"'\\\\s]|^)(daemon|env|include|pid|user??|aio|alias|directio|etag|listen|resolver|root|satisfy|sendfile|allow|deny|api|autoindex|charset|geo|gunzip|gzip|expires|index|keyval|mirror|perl|set|slice|ssi|ssl|zone|state|hash|keepalive|queue|random|sticky|match|userid|http2|http3|protocol|timeout|xclient|starttls|mqtt|load_module|lock_file|master_process|multi_accept|pcre_jit|thread_pool|timer_resolution|working_directory|absolute_redirect|aio_write|chunked_transfer_encoding|connection_pool_size|default_type|directio_alignment|disable_symlinks|if_modified_since|ignore_invalid_headers|large_client_header_buffers|merge_slashes|output_buffers|port_in_redirect|postpone_output|read_ahead|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver_timeout|sendfile_max_chunk|subrequest_output_buffer_size|try_files|underscores_in_headers|addition_types|override_charset|source_charset|create_full_put_path|min_delete_depth|f4f_buffer_size|gunzip_buffers|internal_redirect|keyval_zone|access_log|mirror_request_body|random_index|set_real_ip_from|valid_referers|rewrite_log|uninitialized_variable_warn|split_clients|least_time|sticky_cookie_insert|xml_entities|google_perftools_profiles)([\\"'\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.directive.nginx"},"2":{"name":"keyword.directive.nginx"},"3":{"name":"keyword.directive.nginx"}},"end":";","endCaptures":{"0":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"\\\\b([0-9A-Z_a-z]+)\\\\s+","beginCaptures":{"1":{"name":"keyword.directive.unknown.nginx"}},"end":"(;|$)","endCaptures":{"1":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]},{"begin":"\\\\b([a-z]+/[-+.0-9A-Za-z]+)\\\\b","beginCaptures":{"1":{"name":"constant.other.mediatype.nginx"}},"end":"(;)","endCaptures":{"1":{"name":"punctuation.terminator.nginx"}},"patterns":[{"include":"#values"}]}],"repository":{"if_condition":{"patterns":[{"include":"#variables"},{"match":"!?~\\\\*?\\\\s","name":"keyword.operator.nginx"},{"match":"!?-[defx]\\\\s","name":"keyword.operator.nginx"},{"match":"!?=[^=]","name":"keyword.operator.nginx"},{"include":"#regexp_and_string"}]},"regexp_and_string":{"patterns":[{"match":"\\\\^.*?\\\\$","name":"string.regexp.nginx"},{"begin":"\\"","end":"\\"","name":"string.quoted.double.nginx","patterns":[{"match":"\\\\\\\\[\\"'\\\\\\\\nt]","name":"constant.character.escape.nginx"},{"include":"#variables"}]},{"begin":"'","end":"'","name":"string.quoted.single.nginx","patterns":[{"match":"\\\\\\\\[\\"'\\\\\\\\nt]","name":"constant.character.escape.nginx"},{"include":"#variables"}]}]},"server_parameters":{"patterns":[{"captures":{"1":{"name":"variable.parameter.nginx"},"2":{"name":"keyword.operator.nginx"},"3":{"name":"constant.numeric.nginx"}},"match":"(?:^|\\\\s)(weight|max_conn|max_fails|fail_timeout|slow_start)(=)(\\\\d[.\\\\d]*[BDGHKMSTbdghkmst]?)(?:[;\\\\s]|$)"},{"include":"#values"}]},"values":{"patterns":[{"include":"#variables"},{"match":"#.*","name":"comment.line.number-sign"},{"captures":{"1":{"name":"constant.numeric.nginx"}},"match":"(?<=\\\\G|\\\\s)(=?[0-9][.0-9]*[BDGHKMSTbdghkmst]?)(?=[\\\\t ;])"},{"match":"(?<=\\\\G|\\\\s)(on|off|true|false)(?=[\\\\t ;])","name":"constant.language.nginx"},{"match":"(?<=\\\\G|\\\\s)(kqueue|rtsig|epoll|/dev/poll|select|poll|eventport|max|all|default_server|default|main|crit|error|debug|warn|notice|last)(?=[\\\\t ;])","name":"constant.language.nginx"},{"match":"\\\\\\\\.* |~\\\\*?|!~\\\\*?","name":"keyword.operator.nginx"},{"include":"#regexp_and_string"}]},"variables":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.nginx"},"2":{"name":"variable.other.nginx"}},"match":"(\\\\$)([0-9A-Z_a-z]+)\\\\b"},{"captures":{"1":{"name":"punctuation.definition.variable.nginx"},"2":{"name":"variable.other.nginx"},"3":{"name":"punctuation.definition.variable.nginx"}},"match":"(\\\\$\\\\{)([0-9A-Z_a-z]+)(})"}]}},"scopeName":"source.nginx","embeddedLangs":["lua"]}`)),n=[...e,t];export{n as default};
|
dist/assets/{perl-BF4pw_93.js → perl-CkwEZZwX.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import e from"./sql-BsFa4tDR.js";import t from"./css-BsVw1vtW.js";import n from"./javascript-BgS3c2Ky.js";import r from"./html-BY76lXLH.js";import i from"./xml-D1DXoeKX.js";var a=Object.freeze(JSON.parse(`{"displayName":"Perl","name":"perl","patterns":[{"include":"#line_comment"},{"begin":"^(?==[A-Za-z]+)","end":"^(=cut\\\\b.*)$","endCaptures":{"1":{"patterns":[{"include":"#pod"}]}},"name":"comment.block.documentation.perl","patterns":[{"include":"#pod"}]},{"include":"#variable"},{"applyEndPatternLast":1,"begin":"\\\\b(?=qr\\\\s*[^\\\\s\\\\w])","end":"((([acdegil-prsux]*)))(?=(\\\\s+\\\\S|\\\\s*[#),;{}]|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.compile.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(qr)\\\\s*\\\\{","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"}","name":"string.regexp.compile.nested_braces.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_braces_interpolated"}]},{"begin":"(qr)\\\\s*\\\\[","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"]","name":"string.regexp.compile.nested_brackets.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_brackets_interpolated"}]},{"begin":"(qr)\\\\s*<","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":">","name":"string.regexp.compile.nested_ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_ltgt_interpolated"}]},{"begin":"(qr)\\\\s*\\\\(","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\)","name":"string.regexp.compile.nested_parens.perl","patterns":[{"match":"\\\\$(?=[^'(<\\\\[\\\\\\\\{\\\\s\\\\w])"},{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]},{"begin":"(qr)\\\\s*'","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"'","name":"string.regexp.compile.single-quote.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"(qr)\\\\s*([^'(<\\\\[{\\\\s\\\\w])","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\2","name":"string.regexp.compile.simple-delimiter.perl","patterns":[{"match":"\\\\$(?=[^'(<\\\\[{\\\\s\\\\w])","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]}]},{"applyEndPatternLast":1,"begin":"(?<![-+{])\\\\b(?=m\\\\s*[^0-9A-Za-z\\\\s])","end":"((([acdegil-prsux]*)))(?=(\\\\s+\\\\S|\\\\s*[#),;{}]|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.find-m.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(m)\\\\s*\\\\{","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"}","name":"string.regexp.find-m.nested_braces.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_braces_interpolated"}]},{"begin":"(m)\\\\s*\\\\[","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"]","name":"string.regexp.find-m.nested_brackets.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_brackets_interpolated"}]},{"begin":"(m)\\\\s*<","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":">","name":"string.regexp.find-m.nested_ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_ltgt_interpolated"}]},{"begin":"(m)\\\\s*\\\\(","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\)","name":"string.regexp.find-m.nested_parens.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]},{"begin":"(m)\\\\s*'","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"'","name":"string.regexp.find-m.single-quote.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"\\\\G(?<![-+{])(m)(?!_)\\\\s*([^'(0-9<A-\\\\[a-{\\\\s])","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\2","name":"string.regexp.find-m.simple-delimiter.perl","patterns":[{"match":"\\\\$(?=[^'(0-9<A-\\\\[a-{\\\\s])","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"},{"include":"#variable"},{"begin":"\\\\[","beginCaptures":{"1":{"name":"punctuation.definition.character-class.begin.perl"}},"end":"]","endCaptures":{"1":{"name":"punctuation.definition.character-class.end.perl"}},"name":"constant.other.character-class.set.perl","patterns":[{"match":"\\\\$(?=[^'(<\\\\[{\\\\s\\\\w])","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"}]},{"include":"#nested_parens_interpolated"}]}]},{"applyEndPatternLast":1,"begin":"\\\\b(?=(?<!&)(s)(\\\\s+\\\\S|\\\\s*[(),;<\\\\[{}]|$))","end":"((([acdegil-prsux]*)))(?=(\\\\s+\\\\S|\\\\s*[]),;>{}]|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.replace.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(s)\\\\s*\\\\{","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"}","name":"string.regexp.nested_braces.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_braces"}]},{"begin":"(s)\\\\s*\\\\[","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"]","name":"string.regexp.nested_brackets.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_brackets"}]},{"begin":"(s)\\\\s*<","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":">","name":"string.regexp.nested_ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_ltgt"}]},{"begin":"(s)\\\\s*\\\\(","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\)","name":"string.regexp.nested_parens.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_parens"}]},{"begin":"\\\\{","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"}","name":"string.regexp.format.nested_braces.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_braces_interpolated"}]},{"begin":"\\\\[","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"]","name":"string.regexp.format.nested_brackets.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_brackets_interpolated"}]},{"begin":"<","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":">","name":"string.regexp.format.nested_ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_ltgt_interpolated"}]},{"begin":"\\\\(","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"\\\\)","name":"string.regexp.format.nested_parens.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]},{"begin":"'","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"'","name":"string.regexp.format.single_quote.perl","patterns":[{"match":"\\\\\\\\['\\\\\\\\]","name":"constant.character.escape.perl"}]},{"begin":"([^(;<\\\\[{\\\\s\\\\w])","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"\\\\1","name":"string.regexp.format.simple_delimiter.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"match":"\\\\s+"}]},{"begin":"\\\\b(?=s([^(0-9<A-\\\\[a-{\\\\s]).*\\\\1([acdegil-prsux]*)([),;}]|\\\\s+))","end":"((([acdegil-prsux]*)))(?=([),;}]|\\\\s+|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.replace.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(s\\\\s*)([^(0-9<A-\\\\[a-{\\\\s])","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"(?=\\\\2)","name":"string.regexp.replaceXXX.simple_delimiter.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"'","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"'","name":"string.regexp.replaceXXX.format.single_quote.perl","patterns":[{"match":"\\\\\\\\['\\\\\\\\]","name":"constant.character.escape.perl.perl"}]},{"begin":"([^(0-9<A-\\\\[a-{\\\\s])","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"\\\\1","name":"string.regexp.replaceXXX.format.simple_delimiter.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]}]},{"begin":"\\\\b(?=(?<!\\\\\\\\)s\\\\s*([^(<>\\\\[{\\\\s\\\\w]))","end":"((([acdegilmoprsu]*x[acdegilmoprsu]*)))\\\\b","endCaptures":{"1":{"name":"string.regexp.replace.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(s)\\\\s*(.)","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"(?=\\\\2)","name":"string.regexp.replace.extended.simple_delimiter.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"'","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"'(?=[acdegilmoprsu]*x[acdegilmoprsu]*)\\\\b","name":"string.regexp.replace.extended.simple_delimiter.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"(.)","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"\\\\1(?=[acdegilmoprsu]*x[acdegilmoprsu]*)\\\\b","name":"string.regexp.replace.extended.simple_delimiter.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]}]},{"begin":"(?<=[\\\\&({|~]|if|unless|^)\\\\s*((/))","beginCaptures":{"1":{"name":"string.regexp.find.perl"},"2":{"name":"punctuation.definition.string.perl"}},"contentName":"string.regexp.find.perl","end":"((\\\\1([acdegil-prsux]*)))(?=(\\\\s+\\\\S|\\\\s*[#),;{}]|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.find.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"match":"\\\\$(?=/)","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"},{"include":"#variable"}]},{"captures":{"1":{"name":"constant.other.key.perl"}},"match":"\\\\b(\\\\w+)\\\\s*(?==>)"},{"match":"(?<=\\\\{)\\\\s*\\\\w+\\\\s*(?=})","name":"constant.other.bareword.perl"},{"captures":{"1":{"name":"keyword.control.perl"},"2":{"name":"entity.name.type.class.perl"}},"match":"^\\\\s*(package)\\\\s+([^;\\\\s]+)","name":"meta.class.perl"},{"captures":{"1":{"name":"storage.type.sub.perl"},"2":{"name":"entity.name.function.perl"},"3":{"name":"storage.type.method.perl"}},"match":"\\\\b(sub)(?:\\\\s+([-0-9A-Z_a-z]+))?\\\\s*(?:\\\\([$*;@]*\\\\))?[^{\\\\w]","name":"meta.function.perl"},{"captures":{"1":{"name":"entity.name.function.perl"},"2":{"name":"punctuation.definition.parameters.perl"},"3":{"name":"variable.parameter.function.perl"}},"match":"^\\\\s*(BEGIN|UNITCHECK|CHECK|INIT|END|DESTROY)\\\\b","name":"meta.function.perl"},{"begin":"^(?=(\\\\t| {4}))","end":"(?=[^\\\\t\\\\s])","name":"meta.leading-tabs","patterns":[{"captures":{"1":{"name":"meta.odd-tab"},"2":{"name":"meta.even-tab"}},"match":"(\\\\t| {4})(\\\\t| {4})?"}]},{"captures":{"1":{"name":"support.function.perl"},"2":{"name":"punctuation.definition.string.perl"},"5":{"name":"punctuation.definition.string.perl"},"8":{"name":"punctuation.definition.string.perl"}},"match":"\\\\b(tr|y)\\\\s*([^0-9A-Za-z\\\\s])(.*?)(?<!\\\\\\\\)(\\\\\\\\{2})*(\\\\2)(.*?)(?<!\\\\\\\\)(\\\\\\\\{2})*(\\\\2)","name":"string.regexp.replace.perl"},{"match":"\\\\b(__(?:FILE|LINE|PACKAGE|SUB)__)\\\\b","name":"constant.language.perl"},{"begin":"\\\\b(__(?:DATA__|END__))\\\\n?","beginCaptures":{"1":{"name":"constant.language.perl"}},"contentName":"comment.block.documentation.perl","end":"\\\\z","patterns":[{"include":"#pod"}]},{"match":"(?<!->)\\\\b(continue|default|die|do|else|elsif|exit|for|foreach|given|goto|if|last|next|redo|return|select|unless|until|wait|when|while|switch|case|require|use|eval)\\\\b","name":"keyword.control.perl"},{"match":"\\\\b(my|our|local)\\\\b","name":"storage.modifier.perl"},{"match":"(?<!\\\\w)-[ABCMORSTWXb-gklopr-uwxz]\\\\b","name":"keyword.operator.filetest.perl"},{"match":"\\\\b(and|or|xor|as|not)\\\\b","name":"keyword.operator.logical.perl"},{"match":"((?:<=|[-=])>)","name":"keyword.operator.comparison.perl"},{"include":"#heredoc"},{"begin":"\\\\bqq\\\\s*([^(<\\\\[{\\\\w\\\\s])","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\1","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*([^'(<\\\\[{\\\\w\\\\s])","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\1","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx.single-quote.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.double.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"(?<!->)\\\\bqw?\\\\s*([^(<\\\\[{\\\\w\\\\s])","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\1","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q.perl"},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.single.perl","patterns":[{"match":"\\\\\\\\['\\\\\\\\]","name":"constant.character.escape.perl"}]},{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"(?<!->)\\\\bqq\\\\s*\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq-paren.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_parens_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqq\\\\s*\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq-brace.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_braces_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqq\\\\s*\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq-bracket.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_brackets_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqq\\\\s*<","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq-ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_ltgt_interpolated"},{"include":"#variable"}]},{"begin":"(?<!->)\\\\bqx\\\\s*\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx-paren.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_parens_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx-brace.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_braces_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx-bracket.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_brackets_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*<","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx-ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_ltgt_interpolated"},{"include":"#variable"}]},{"begin":"(?<!->)\\\\bqw?\\\\s*\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q-paren.perl","patterns":[{"include":"#nested_parens"}]},{"begin":"\\\\bqw?\\\\s*\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q-brace.perl","patterns":[{"include":"#nested_braces"}]},{"begin":"\\\\bqw?\\\\s*\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q-bracket.perl","patterns":[{"include":"#nested_brackets"}]},{"begin":"\\\\bqw?\\\\s*<","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q-ltgt.perl","patterns":[{"include":"#nested_ltgt"}]},{"begin":"^__\\\\w+__","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"$","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.unquoted.program-block.perl"},{"begin":"\\\\b(format)\\\\s+(\\\\w+)\\\\s*=","beginCaptures":{"1":{"name":"support.function.perl"},"2":{"name":"entity.name.function.format.perl"}},"end":"^\\\\.\\\\s*$","name":"meta.format.perl","patterns":[{"include":"#line_comment"},{"include":"#variable"}]},{"captures":{"1":{"name":"support.function.perl"},"2":{"name":"entity.name.function.perl"}},"match":"\\\\b(x)\\\\s*(\\\\d+)\\\\b"},{"match":"\\\\b(ARGV|DATA|ENV|SIG|STDERR|STDIN|STDOUT|atan2|bind|binmode|bless|caller|chdir|chmod|chomp|chop|chown|chr|chroot|close|closedir|cmp|connect|cos|crypt|dbmclose|dbmopen|defined|delete|dump|each|endgrent|endhostent|endnetent|endprotoent|endpwent|endservent|eof|eq|eval|exec|exists|exp|fcntl|fileno|flock|fork|formline|ge|getc|getgrent|getgrgid|getgrnam|gethostbyaddr|gethostbyname|gethostent|getlogin|getnetbyaddr|getnetbyname|getnetent|getpeername|getpgrp|getppid|getpriority|getprotobyname|getprotobynumber|getprotoent|getpwent|getpwnam|getpwuid|getservbyname|getservbyport|getservent|getsockname|getsockopt|glob|gmtime|grep|gt|hex|import|index|int|ioctl|join|keys|kill|lc|lcfirst|le|length|link|listen|local|localtime|log|lstat|lt|m|map|mkdir|msgctl|msgget|msgrcv|msgsnd|ne|no|oct|open|opendir|ord|pack|pipe|pop|pos|printf??|push|quotemeta|rand|read|readdir|readlink|recv|ref|rename|reset|reverse|rewinddir|rindex|rmdir|s|say|scalar|seek|seekdir|semctl|semget|semop|send|setgrent|sethostent|setnetent|setpgrp|setpriority|setprotoent|setpwent|setservent|setsockopt|shift|shmctl|shmget|shmread|shmwrite|shutdown|sin|sleep|socket|socketpair|sort|splice|split|sprintf|sqrt|srand|stat|study|substr|symlink|syscall|sysopen|sysread|system|syswrite|tell|telldir|tied??|times??|tr|truncate|uc|ucfirst|umask|undef|unlink|unpack|unshift|untie|utime|values|vec|waitpid|wantarray|warn|write|y)\\\\b","name":"support.function.perl"},{"captures":{"1":{"name":"punctuation.section.scope.begin.perl"},"2":{"name":"punctuation.section.scope.end.perl"}},"match":"(\\\\{)(})"},{"captures":{"1":{"name":"punctuation.section.scope.begin.perl"},"2":{"name":"punctuation.section.scope.end.perl"}},"match":"(\\\\()(\\\\))"}],"repository":{"escaped_char":{"patterns":[{"match":"\\\\\\\\\\\\d+","name":"constant.character.escape.perl"},{"match":"\\\\\\\\c[^\\\\\\\\\\\\s]","name":"constant.character.escape.perl"},{"match":"\\\\\\\\g(?:\\\\{(?:\\\\w*|-\\\\d+)}|\\\\d+)","name":"constant.character.escape.perl"},{"match":"\\\\\\\\k(?:\\\\{\\\\w*}|<\\\\w*>|'\\\\w*')","name":"constant.character.escape.perl"},{"match":"\\\\\\\\N\\\\{[^}]*}","name":"constant.character.escape.perl"},{"match":"\\\\\\\\o\\\\{\\\\d*}","name":"constant.character.escape.perl"},{"match":"\\\\\\\\[Pp](?:\\\\{\\\\w*}|P)","name":"constant.character.escape.perl"},{"match":"\\\\\\\\x(?:[0-9A-Za-z]{2}|\\\\{\\\\w*})?","name":"constant.character.escape.perl"},{"match":"\\\\\\\\.","name":"constant.character.escape.perl"}]},"heredoc":{"patterns":[{"begin":"((((<<(~)?) *')(HTML)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.html","patterns":[{"begin":"^","end":"\\\\n","name":"text.html.basic","patterns":[{"include":"text.html.basic"}]}]},{"begin":"((((<<(~)?) *')(XML)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.xml","patterns":[{"begin":"^","end":"\\\\n","name":"text.xml","patterns":[{"include":"text.xml"}]}]},{"begin":"((((<<(~)?) *')(CSS)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.css","patterns":[{"begin":"^","end":"\\\\n","name":"source.css","patterns":[{"include":"source.css"}]}]},{"begin":"((((<<(~)?) *')(JAVASCRIPT)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.js","patterns":[{"begin":"^","end":"\\\\n","name":"source.js","patterns":[{"include":"source.js"}]}]},{"begin":"((((<<(~)?) *')(SQL)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.sql","patterns":[{"begin":"^","end":"\\\\n","name":"source.sql","patterns":[{"include":"source.sql"}]}]},{"begin":"((((<<(~)?) *')(POSTSCRIPT)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.postscript","patterns":[{"begin":"^","end":"\\\\n","name":"source.postscript","patterns":[{"include":"source.postscript"}]}]},{"begin":"((((<<(~)?) *')([^']*)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}}},{"begin":"((((<<(~)?) *\\\\\\\\)((?![ $(=\\\\d])[^\\"'),;\`\\\\s]*)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}}},{"begin":"((((<<(~)?) *\\")(HTML)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.html","patterns":[{"begin":"^","end":"\\\\n","name":"text.html.basic","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"text.html.basic"}]}]},{"begin":"((((<<(~)?) *\\")(XML)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.xml","patterns":[{"begin":"^","end":"\\\\n","name":"text.xml","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"text.xml"}]}]},{"begin":"((((<<(~)?) *\\")(CSS)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.css","patterns":[{"begin":"^","end":"\\\\n","name":"source.css","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.css"}]}]},{"begin":"((((<<(~)?) *\\")(JAVASCRIPT)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.js","patterns":[{"begin":"^","end":"\\\\n","name":"source.js","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.js"}]}]},{"begin":"((((<<(~)?) *\\")(SQL)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.sql","patterns":[{"begin":"^","end":"\\\\n","name":"source.sql","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.sql"}]}]},{"begin":"((((<<(~)?) *\\")(POSTSCRIPT)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.postscript","patterns":[{"begin":"^","end":"\\\\n","name":"source.postscript","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.postscript"}]}]},{"begin":"((((<<(~)?) *\\")([^\\"]*)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"((((<<(~)?) *)(HTML)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.html","patterns":[{"begin":"^","end":"\\\\n","name":"text.html.basic","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"text.html.basic"}]}]},{"begin":"((((<<(~)?) *)(XML)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.xml","patterns":[{"begin":"^","end":"\\\\n","name":"text.xml","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"text.xml"}]}]},{"begin":"((((<<(~)?) *)(CSS)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.css","patterns":[{"begin":"^","end":"\\\\n","name":"source.css","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.css"}]}]},{"begin":"((((<<(~)?) *)(JAVASCRIPT)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.js","patterns":[{"begin":"^","end":"\\\\n","name":"source.js","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.js"}]}]},{"begin":"((((<<(~)?) *)(SQL)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.sql","patterns":[{"begin":"^","end":"\\\\n","name":"source.sql","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.sql"}]}]},{"begin":"((((<<(~)?) *)(POSTSCRIPT)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.postscript","patterns":[{"begin":"^","end":"\\\\n","name":"source.postscript","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.postscript"}]}]},{"begin":"((((<<(~)?) *)((?![ $(=\\\\d])[^\\"'),;\`\\\\s]*)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"((((<<(~)?) *\`)([^\`]*)(\`)))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.shell.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"patterns":[{"include":"#escaped_char"},{"include":"#variable"}]}]},"line_comment":{"patterns":[{"begin":"(^[\\\\t ]+)?(?=#)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.perl"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.perl"}},"end":"\\\\n","name":"comment.line.number-sign.perl"}]}]},"nested_braces":{"begin":"\\\\{","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"}","patterns":[{"include":"#escaped_char"},{"include":"#nested_braces"}]},"nested_braces_interpolated":{"begin":"\\\\{","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"}","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_braces_interpolated"}]},"nested_brackets":{"begin":"\\\\[","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"]","patterns":[{"include":"#escaped_char"},{"include":"#nested_brackets"}]},"nested_brackets_interpolated":{"begin":"\\\\[","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"]","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_brackets_interpolated"}]},"nested_ltgt":{"begin":"<","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":">","patterns":[{"include":"#nested_ltgt"}]},"nested_ltgt_interpolated":{"begin":"<","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":">","patterns":[{"include":"#variable"},{"include":"#nested_ltgt_interpolated"}]},"nested_parens":{"begin":"\\\\(","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"\\\\)","patterns":[{"include":"#escaped_char"},{"include":"#nested_parens"}]},"nested_parens_interpolated":{"begin":"\\\\(","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"\\\\)","patterns":[{"match":"\\\\$(?=[^'(<\\\\[{\\\\s\\\\w])","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]},"pod":{"patterns":[{"match":"^=(pod|back|cut)\\\\b","name":"storage.type.class.pod.perl"},{"begin":"^(=begin)\\\\s+(html)\\\\s*$","beginCaptures":{"1":{"name":"storage.type.class.pod.perl"},"2":{"name":"variable.other.pod.perl"}},"contentName":"text.embedded.html.basic","end":"^(?:(=end)\\\\s+(html)|(?==cut))","endCaptures":{"1":{"name":"storage.type.class.pod.perl"},"2":{"name":"variable.other.pod.perl"}},"name":"meta.embedded.pod.perl","patterns":[{"include":"text.html.basic"}]},{"captures":{"1":{"name":"storage.type.class.pod.perl"},"2":{"name":"variable.other.pod.perl","patterns":[{"include":"#pod-formatting"}]}},"match":"^(=(?:head[1-4]|item|over|encoding|begin|end|for))\\\\b\\\\s*(.*)"},{"include":"#pod-formatting"}]},"pod-formatting":{"patterns":[{"captures":{"1":{"name":"markup.italic.pod.perl"},"2":{"name":"markup.italic.pod.perl"}},"match":"I(?:<([^<>]+)>|<+(\\\\s+(?:(?<!\\\\s)>|[^>])+\\\\s+)>+)","name":"entity.name.type.instance.pod.perl"},{"captures":{"1":{"name":"markup.bold.pod.perl"},"2":{"name":"markup.bold.pod.perl"}},"match":"B(?:<([^<>]+)>|<+(\\\\s+(?:(?<!\\\\s)>|[^>])+\\\\s+)>+)","name":"entity.name.type.instance.pod.perl"},{"captures":{"1":{"name":"markup.raw.pod.perl"},"2":{"name":"markup.raw.pod.perl"}},"match":"C(?:<([^<>]+)>|<+(\\\\\\\\s+(?:(?<!\\\\\\\\s)>|[^>])+\\\\\\\\s+)>+)","name":"entity.name.type.instance.pod.perl"},{"captures":{"1":{"name":"markup.underline.link.hyperlink.pod.perl"}},"match":"L<([^>]+)>","name":"entity.name.type.instance.pod.perl"},{"match":"[EFSXZ]<[^>]*>","name":"entity.name.type.instance.pod.perl"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)&(?![0-9A-Z_a-z])","name":"variable.other.regexp.match.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)\`(?![0-9A-Z_a-z])","name":"variable.other.regexp.pre-match.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)'(?![0-9A-Z_a-z])","name":"variable.other.regexp.post-match.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)\\\\+(?![0-9A-Z_a-z])","name":"variable.other.regexp.last-paren-match.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)\\"(?![0-9A-Z_a-z])","name":"variable.other.readwrite.list-separator.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)0(?![0-9A-Z_a-z])","name":"variable.other.predefined.program-name.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)[!#$%()*,-/:-@\\\\[-_ab|~](?![0-9A-Z_a-z])","name":"variable.other.predefined.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)[0-9]+(?![0-9A-Z_a-z])","name":"variable.other.subpattern.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"([$%@](#)?)([$7A-Za-z]|::)([$0-9A-Z_a-z]|::)*\\\\b","name":"variable.other.readwrite.global.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"},"2":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$\\\\{)(?:[$7A-Za-z]|::)(?:[$0-9A-Z_a-z]|::)*(})","name":"variable.other.readwrite.global.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"([$%@](#)?)[0-9_]\\\\b","name":"variable.other.readwrite.global.special.perl"}]}},"scopeName":"source.perl","embeddedLangs":["html","xml","css","javascript","sql"]}`)),o=[...r,...i,...t,...n,...e,a];export{o as default};
|
|
|
|
| 1 |
+
import e from"./sql-BsFa4tDR.js";import t from"./css-BsVw1vtW.js";import n from"./javascript-BgS3c2Ky.js";import r from"./html-BY76lXLH.js";import i from"./xml-Cpvg3MKE.js";var a=Object.freeze(JSON.parse(`{"displayName":"Perl","name":"perl","patterns":[{"include":"#line_comment"},{"begin":"^(?==[A-Za-z]+)","end":"^(=cut\\\\b.*)$","endCaptures":{"1":{"patterns":[{"include":"#pod"}]}},"name":"comment.block.documentation.perl","patterns":[{"include":"#pod"}]},{"include":"#variable"},{"applyEndPatternLast":1,"begin":"\\\\b(?=qr\\\\s*[^\\\\s\\\\w])","end":"((([acdegil-prsux]*)))(?=(\\\\s+\\\\S|\\\\s*[#),;{}]|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.compile.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(qr)\\\\s*\\\\{","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"}","name":"string.regexp.compile.nested_braces.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_braces_interpolated"}]},{"begin":"(qr)\\\\s*\\\\[","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"]","name":"string.regexp.compile.nested_brackets.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_brackets_interpolated"}]},{"begin":"(qr)\\\\s*<","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":">","name":"string.regexp.compile.nested_ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_ltgt_interpolated"}]},{"begin":"(qr)\\\\s*\\\\(","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\)","name":"string.regexp.compile.nested_parens.perl","patterns":[{"match":"\\\\$(?=[^'(<\\\\[\\\\\\\\{\\\\s\\\\w])"},{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]},{"begin":"(qr)\\\\s*'","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"'","name":"string.regexp.compile.single-quote.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"(qr)\\\\s*([^'(<\\\\[{\\\\s\\\\w])","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\2","name":"string.regexp.compile.simple-delimiter.perl","patterns":[{"match":"\\\\$(?=[^'(<\\\\[{\\\\s\\\\w])","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]}]},{"applyEndPatternLast":1,"begin":"(?<![-+{])\\\\b(?=m\\\\s*[^0-9A-Za-z\\\\s])","end":"((([acdegil-prsux]*)))(?=(\\\\s+\\\\S|\\\\s*[#),;{}]|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.find-m.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(m)\\\\s*\\\\{","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"}","name":"string.regexp.find-m.nested_braces.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_braces_interpolated"}]},{"begin":"(m)\\\\s*\\\\[","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"]","name":"string.regexp.find-m.nested_brackets.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_brackets_interpolated"}]},{"begin":"(m)\\\\s*<","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":">","name":"string.regexp.find-m.nested_ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_ltgt_interpolated"}]},{"begin":"(m)\\\\s*\\\\(","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\)","name":"string.regexp.find-m.nested_parens.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]},{"begin":"(m)\\\\s*'","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"'","name":"string.regexp.find-m.single-quote.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"\\\\G(?<![-+{])(m)(?!_)\\\\s*([^'(0-9<A-\\\\[a-{\\\\s])","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\2","name":"string.regexp.find-m.simple-delimiter.perl","patterns":[{"match":"\\\\$(?=[^'(0-9<A-\\\\[a-{\\\\s])","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"},{"include":"#variable"},{"begin":"\\\\[","beginCaptures":{"1":{"name":"punctuation.definition.character-class.begin.perl"}},"end":"]","endCaptures":{"1":{"name":"punctuation.definition.character-class.end.perl"}},"name":"constant.other.character-class.set.perl","patterns":[{"match":"\\\\$(?=[^'(<\\\\[{\\\\s\\\\w])","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"}]},{"include":"#nested_parens_interpolated"}]}]},{"applyEndPatternLast":1,"begin":"\\\\b(?=(?<!&)(s)(\\\\s+\\\\S|\\\\s*[(),;<\\\\[{}]|$))","end":"((([acdegil-prsux]*)))(?=(\\\\s+\\\\S|\\\\s*[]),;>{}]|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.replace.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(s)\\\\s*\\\\{","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"}","name":"string.regexp.nested_braces.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_braces"}]},{"begin":"(s)\\\\s*\\\\[","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"]","name":"string.regexp.nested_brackets.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_brackets"}]},{"begin":"(s)\\\\s*<","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":">","name":"string.regexp.nested_ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_ltgt"}]},{"begin":"(s)\\\\s*\\\\(","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"\\\\)","name":"string.regexp.nested_parens.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_parens"}]},{"begin":"\\\\{","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"}","name":"string.regexp.format.nested_braces.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_braces_interpolated"}]},{"begin":"\\\\[","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"]","name":"string.regexp.format.nested_brackets.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_brackets_interpolated"}]},{"begin":"<","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":">","name":"string.regexp.format.nested_ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_ltgt_interpolated"}]},{"begin":"\\\\(","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"\\\\)","name":"string.regexp.format.nested_parens.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]},{"begin":"'","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"'","name":"string.regexp.format.single_quote.perl","patterns":[{"match":"\\\\\\\\['\\\\\\\\]","name":"constant.character.escape.perl"}]},{"begin":"([^(;<\\\\[{\\\\s\\\\w])","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"\\\\1","name":"string.regexp.format.simple_delimiter.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"match":"\\\\s+"}]},{"begin":"\\\\b(?=s([^(0-9<A-\\\\[a-{\\\\s]).*\\\\1([acdegil-prsux]*)([),;}]|\\\\s+))","end":"((([acdegil-prsux]*)))(?=([),;}]|\\\\s+|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.replace.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(s\\\\s*)([^(0-9<A-\\\\[a-{\\\\s])","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"(?=\\\\2)","name":"string.regexp.replaceXXX.simple_delimiter.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"'","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"'","name":"string.regexp.replaceXXX.format.single_quote.perl","patterns":[{"match":"\\\\\\\\['\\\\\\\\]","name":"constant.character.escape.perl.perl"}]},{"begin":"([^(0-9<A-\\\\[a-{\\\\s])","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"\\\\1","name":"string.regexp.replaceXXX.format.simple_delimiter.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]}]},{"begin":"\\\\b(?=(?<!\\\\\\\\)s\\\\s*([^(<>\\\\[{\\\\s\\\\w]))","end":"((([acdegilmoprsu]*x[acdegilmoprsu]*)))\\\\b","endCaptures":{"1":{"name":"string.regexp.replace.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"begin":"(s)\\\\s*(.)","captures":{"0":{"name":"punctuation.definition.string.perl"},"1":{"name":"support.function.perl"}},"end":"(?=\\\\2)","name":"string.regexp.replace.extended.simple_delimiter.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"'","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"'(?=[acdegilmoprsu]*x[acdegilmoprsu]*)\\\\b","name":"string.regexp.replace.extended.simple_delimiter.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"(.)","captures":{"0":{"name":"punctuation.definition.string.perl"}},"end":"\\\\1(?=[acdegilmoprsu]*x[acdegilmoprsu]*)\\\\b","name":"string.regexp.replace.extended.simple_delimiter.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]}]},{"begin":"(?<=[\\\\&({|~]|if|unless|^)\\\\s*((/))","beginCaptures":{"1":{"name":"string.regexp.find.perl"},"2":{"name":"punctuation.definition.string.perl"}},"contentName":"string.regexp.find.perl","end":"((\\\\1([acdegil-prsux]*)))(?=(\\\\s+\\\\S|\\\\s*[#),;{}]|\\\\s*$))","endCaptures":{"1":{"name":"string.regexp.find.perl"},"2":{"name":"punctuation.definition.string.perl"},"3":{"name":"keyword.control.regexp-option.perl"}},"patterns":[{"match":"\\\\$(?=/)","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"},{"include":"#variable"}]},{"captures":{"1":{"name":"constant.other.key.perl"}},"match":"\\\\b(\\\\w+)\\\\s*(?==>)"},{"match":"(?<=\\\\{)\\\\s*\\\\w+\\\\s*(?=})","name":"constant.other.bareword.perl"},{"captures":{"1":{"name":"keyword.control.perl"},"2":{"name":"entity.name.type.class.perl"}},"match":"^\\\\s*(package)\\\\s+([^;\\\\s]+)","name":"meta.class.perl"},{"captures":{"1":{"name":"storage.type.sub.perl"},"2":{"name":"entity.name.function.perl"},"3":{"name":"storage.type.method.perl"}},"match":"\\\\b(sub)(?:\\\\s+([-0-9A-Z_a-z]+))?\\\\s*(?:\\\\([$*;@]*\\\\))?[^{\\\\w]","name":"meta.function.perl"},{"captures":{"1":{"name":"entity.name.function.perl"},"2":{"name":"punctuation.definition.parameters.perl"},"3":{"name":"variable.parameter.function.perl"}},"match":"^\\\\s*(BEGIN|UNITCHECK|CHECK|INIT|END|DESTROY)\\\\b","name":"meta.function.perl"},{"begin":"^(?=(\\\\t| {4}))","end":"(?=[^\\\\t\\\\s])","name":"meta.leading-tabs","patterns":[{"captures":{"1":{"name":"meta.odd-tab"},"2":{"name":"meta.even-tab"}},"match":"(\\\\t| {4})(\\\\t| {4})?"}]},{"captures":{"1":{"name":"support.function.perl"},"2":{"name":"punctuation.definition.string.perl"},"5":{"name":"punctuation.definition.string.perl"},"8":{"name":"punctuation.definition.string.perl"}},"match":"\\\\b(tr|y)\\\\s*([^0-9A-Za-z\\\\s])(.*?)(?<!\\\\\\\\)(\\\\\\\\{2})*(\\\\2)(.*?)(?<!\\\\\\\\)(\\\\\\\\{2})*(\\\\2)","name":"string.regexp.replace.perl"},{"match":"\\\\b(__(?:FILE|LINE|PACKAGE|SUB)__)\\\\b","name":"constant.language.perl"},{"begin":"\\\\b(__(?:DATA__|END__))\\\\n?","beginCaptures":{"1":{"name":"constant.language.perl"}},"contentName":"comment.block.documentation.perl","end":"\\\\z","patterns":[{"include":"#pod"}]},{"match":"(?<!->)\\\\b(continue|default|die|do|else|elsif|exit|for|foreach|given|goto|if|last|next|redo|return|select|unless|until|wait|when|while|switch|case|require|use|eval)\\\\b","name":"keyword.control.perl"},{"match":"\\\\b(my|our|local)\\\\b","name":"storage.modifier.perl"},{"match":"(?<!\\\\w)-[ABCMORSTWXb-gklopr-uwxz]\\\\b","name":"keyword.operator.filetest.perl"},{"match":"\\\\b(and|or|xor|as|not)\\\\b","name":"keyword.operator.logical.perl"},{"match":"((?:<=|[-=])>)","name":"keyword.operator.comparison.perl"},{"include":"#heredoc"},{"begin":"\\\\bqq\\\\s*([^(<\\\\[{\\\\w\\\\s])","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\1","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*([^'(<\\\\[{\\\\w\\\\s])","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\1","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx.single-quote.perl","patterns":[{"include":"#escaped_char"}]},{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.double.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"(?<!->)\\\\bqw?\\\\s*([^(<\\\\[{\\\\w\\\\s])","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\1","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q.perl"},{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.single.perl","patterns":[{"match":"\\\\\\\\['\\\\\\\\]","name":"constant.character.escape.perl"}]},{"begin":"\`","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\`","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.perl","patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"(?<!->)\\\\bqq\\\\s*\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq-paren.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_parens_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqq\\\\s*\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq-brace.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_braces_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqq\\\\s*\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq-bracket.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_brackets_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqq\\\\s*<","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.qq-ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_ltgt_interpolated"},{"include":"#variable"}]},{"begin":"(?<!->)\\\\bqx\\\\s*\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx-paren.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_parens_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx-brace.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_braces_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx-bracket.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_brackets_interpolated"},{"include":"#variable"}]},{"begin":"\\\\bqx\\\\s*<","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.interpolated.qx-ltgt.perl","patterns":[{"include":"#escaped_char"},{"include":"#nested_ltgt_interpolated"},{"include":"#variable"}]},{"begin":"(?<!->)\\\\bqw?\\\\s*\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q-paren.perl","patterns":[{"include":"#nested_parens"}]},{"begin":"\\\\bqw?\\\\s*\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q-brace.perl","patterns":[{"include":"#nested_braces"}]},{"begin":"\\\\bqw?\\\\s*\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q-bracket.perl","patterns":[{"include":"#nested_brackets"}]},{"begin":"\\\\bqw?\\\\s*<","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":">","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.quoted.other.q-ltgt.perl","patterns":[{"include":"#nested_ltgt"}]},{"begin":"^__\\\\w+__","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.perl"}},"end":"$","endCaptures":{"0":{"name":"punctuation.definition.string.end.perl"}},"name":"string.unquoted.program-block.perl"},{"begin":"\\\\b(format)\\\\s+(\\\\w+)\\\\s*=","beginCaptures":{"1":{"name":"support.function.perl"},"2":{"name":"entity.name.function.format.perl"}},"end":"^\\\\.\\\\s*$","name":"meta.format.perl","patterns":[{"include":"#line_comment"},{"include":"#variable"}]},{"captures":{"1":{"name":"support.function.perl"},"2":{"name":"entity.name.function.perl"}},"match":"\\\\b(x)\\\\s*(\\\\d+)\\\\b"},{"match":"\\\\b(ARGV|DATA|ENV|SIG|STDERR|STDIN|STDOUT|atan2|bind|binmode|bless|caller|chdir|chmod|chomp|chop|chown|chr|chroot|close|closedir|cmp|connect|cos|crypt|dbmclose|dbmopen|defined|delete|dump|each|endgrent|endhostent|endnetent|endprotoent|endpwent|endservent|eof|eq|eval|exec|exists|exp|fcntl|fileno|flock|fork|formline|ge|getc|getgrent|getgrgid|getgrnam|gethostbyaddr|gethostbyname|gethostent|getlogin|getnetbyaddr|getnetbyname|getnetent|getpeername|getpgrp|getppid|getpriority|getprotobyname|getprotobynumber|getprotoent|getpwent|getpwnam|getpwuid|getservbyname|getservbyport|getservent|getsockname|getsockopt|glob|gmtime|grep|gt|hex|import|index|int|ioctl|join|keys|kill|lc|lcfirst|le|length|link|listen|local|localtime|log|lstat|lt|m|map|mkdir|msgctl|msgget|msgrcv|msgsnd|ne|no|oct|open|opendir|ord|pack|pipe|pop|pos|printf??|push|quotemeta|rand|read|readdir|readlink|recv|ref|rename|reset|reverse|rewinddir|rindex|rmdir|s|say|scalar|seek|seekdir|semctl|semget|semop|send|setgrent|sethostent|setnetent|setpgrp|setpriority|setprotoent|setpwent|setservent|setsockopt|shift|shmctl|shmget|shmread|shmwrite|shutdown|sin|sleep|socket|socketpair|sort|splice|split|sprintf|sqrt|srand|stat|study|substr|symlink|syscall|sysopen|sysread|system|syswrite|tell|telldir|tied??|times??|tr|truncate|uc|ucfirst|umask|undef|unlink|unpack|unshift|untie|utime|values|vec|waitpid|wantarray|warn|write|y)\\\\b","name":"support.function.perl"},{"captures":{"1":{"name":"punctuation.section.scope.begin.perl"},"2":{"name":"punctuation.section.scope.end.perl"}},"match":"(\\\\{)(})"},{"captures":{"1":{"name":"punctuation.section.scope.begin.perl"},"2":{"name":"punctuation.section.scope.end.perl"}},"match":"(\\\\()(\\\\))"}],"repository":{"escaped_char":{"patterns":[{"match":"\\\\\\\\\\\\d+","name":"constant.character.escape.perl"},{"match":"\\\\\\\\c[^\\\\\\\\\\\\s]","name":"constant.character.escape.perl"},{"match":"\\\\\\\\g(?:\\\\{(?:\\\\w*|-\\\\d+)}|\\\\d+)","name":"constant.character.escape.perl"},{"match":"\\\\\\\\k(?:\\\\{\\\\w*}|<\\\\w*>|'\\\\w*')","name":"constant.character.escape.perl"},{"match":"\\\\\\\\N\\\\{[^}]*}","name":"constant.character.escape.perl"},{"match":"\\\\\\\\o\\\\{\\\\d*}","name":"constant.character.escape.perl"},{"match":"\\\\\\\\[Pp](?:\\\\{\\\\w*}|P)","name":"constant.character.escape.perl"},{"match":"\\\\\\\\x(?:[0-9A-Za-z]{2}|\\\\{\\\\w*})?","name":"constant.character.escape.perl"},{"match":"\\\\\\\\.","name":"constant.character.escape.perl"}]},"heredoc":{"patterns":[{"begin":"((((<<(~)?) *')(HTML)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.html","patterns":[{"begin":"^","end":"\\\\n","name":"text.html.basic","patterns":[{"include":"text.html.basic"}]}]},{"begin":"((((<<(~)?) *')(XML)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.xml","patterns":[{"begin":"^","end":"\\\\n","name":"text.xml","patterns":[{"include":"text.xml"}]}]},{"begin":"((((<<(~)?) *')(CSS)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.css","patterns":[{"begin":"^","end":"\\\\n","name":"source.css","patterns":[{"include":"source.css"}]}]},{"begin":"((((<<(~)?) *')(JAVASCRIPT)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.js","patterns":[{"begin":"^","end":"\\\\n","name":"source.js","patterns":[{"include":"source.js"}]}]},{"begin":"((((<<(~)?) *')(SQL)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.sql","patterns":[{"begin":"^","end":"\\\\n","name":"source.sql","patterns":[{"include":"source.sql"}]}]},{"begin":"((((<<(~)?) *')(POSTSCRIPT)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.postscript","patterns":[{"begin":"^","end":"\\\\n","name":"source.postscript","patterns":[{"include":"source.postscript"}]}]},{"begin":"((((<<(~)?) *')([^']*)(')))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}}},{"begin":"((((<<(~)?) *\\\\\\\\)((?![ $(=\\\\d])[^\\"'),;\`\\\\s]*)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.raw.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.raw.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.raw.perl"},"3":{"name":"punctuation.definition.string.end.perl"}}},{"begin":"((((<<(~)?) *\\")(HTML)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.html","patterns":[{"begin":"^","end":"\\\\n","name":"text.html.basic","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"text.html.basic"}]}]},{"begin":"((((<<(~)?) *\\")(XML)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.xml","patterns":[{"begin":"^","end":"\\\\n","name":"text.xml","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"text.xml"}]}]},{"begin":"((((<<(~)?) *\\")(CSS)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.css","patterns":[{"begin":"^","end":"\\\\n","name":"source.css","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.css"}]}]},{"begin":"((((<<(~)?) *\\")(JAVASCRIPT)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.js","patterns":[{"begin":"^","end":"\\\\n","name":"source.js","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.js"}]}]},{"begin":"((((<<(~)?) *\\")(SQL)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.sql","patterns":[{"begin":"^","end":"\\\\n","name":"source.sql","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.sql"}]}]},{"begin":"((((<<(~)?) *\\")(POSTSCRIPT)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.postscript","patterns":[{"begin":"^","end":"\\\\n","name":"source.postscript","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.postscript"}]}]},{"begin":"((((<<(~)?) *\\")([^\\"]*)(\\")))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"((((<<(~)?) *)(HTML)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.html","patterns":[{"begin":"^","end":"\\\\n","name":"text.html.basic","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"text.html.basic"}]}]},{"begin":"((((<<(~)?) *)(XML)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.xml","patterns":[{"begin":"^","end":"\\\\n","name":"text.xml","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"text.xml"}]}]},{"begin":"((((<<(~)?) *)(CSS)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.css","patterns":[{"begin":"^","end":"\\\\n","name":"source.css","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.css"}]}]},{"begin":"((((<<(~)?) *)(JAVASCRIPT)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.js","patterns":[{"begin":"^","end":"\\\\n","name":"source.js","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.js"}]}]},{"begin":"((((<<(~)?) *)(SQL)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.sql","patterns":[{"begin":"^","end":"\\\\n","name":"source.sql","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.sql"}]}]},{"begin":"((((<<(~)?) *)(POSTSCRIPT)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"name":"meta.embedded.block.postscript","patterns":[{"begin":"^","end":"\\\\n","name":"source.postscript","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"source.postscript"}]}]},{"begin":"((((<<(~)?) *)((?![ $(=\\\\d])[^\\"'),;\`\\\\s]*)()))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.interpolated.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"patterns":[{"include":"#escaped_char"},{"include":"#variable"}]},{"begin":"((((<<(~)?) *\`)([^\`]*)(\`)))(.*)\\\\n?","beginCaptures":{"1":{"name":"string.unquoted.heredoc.interpolated.perl"},"2":{"name":"punctuation.definition.string.begin.perl"},"3":{"name":"punctuation.definition.delimiter.begin.perl"},"7":{"name":"punctuation.definition.delimiter.end.perl"},"8":{"patterns":[{"include":"$self"}]}},"contentName":"string.unquoted.heredoc.shell.perl","end":"^((?!\\\\5)\\\\s+)?((\\\\6))$","endCaptures":{"2":{"name":"string.unquoted.heredoc.interpolated.perl"},"3":{"name":"punctuation.definition.string.end.perl"}},"patterns":[{"include":"#escaped_char"},{"include":"#variable"}]}]},"line_comment":{"patterns":[{"begin":"(^[\\\\t ]+)?(?=#)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.perl"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.perl"}},"end":"\\\\n","name":"comment.line.number-sign.perl"}]}]},"nested_braces":{"begin":"\\\\{","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"}","patterns":[{"include":"#escaped_char"},{"include":"#nested_braces"}]},"nested_braces_interpolated":{"begin":"\\\\{","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"}","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_braces_interpolated"}]},"nested_brackets":{"begin":"\\\\[","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"]","patterns":[{"include":"#escaped_char"},{"include":"#nested_brackets"}]},"nested_brackets_interpolated":{"begin":"\\\\[","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"]","patterns":[{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_brackets_interpolated"}]},"nested_ltgt":{"begin":"<","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":">","patterns":[{"include":"#nested_ltgt"}]},"nested_ltgt_interpolated":{"begin":"<","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":">","patterns":[{"include":"#variable"},{"include":"#nested_ltgt_interpolated"}]},"nested_parens":{"begin":"\\\\(","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"\\\\)","patterns":[{"include":"#escaped_char"},{"include":"#nested_parens"}]},"nested_parens_interpolated":{"begin":"\\\\(","captures":{"1":{"name":"punctuation.section.scope.perl"}},"end":"\\\\)","patterns":[{"match":"\\\\$(?=[^'(<\\\\[{\\\\s\\\\w])","name":"keyword.control.anchor.perl"},{"include":"#escaped_char"},{"include":"#variable"},{"include":"#nested_parens_interpolated"}]},"pod":{"patterns":[{"match":"^=(pod|back|cut)\\\\b","name":"storage.type.class.pod.perl"},{"begin":"^(=begin)\\\\s+(html)\\\\s*$","beginCaptures":{"1":{"name":"storage.type.class.pod.perl"},"2":{"name":"variable.other.pod.perl"}},"contentName":"text.embedded.html.basic","end":"^(?:(=end)\\\\s+(html)|(?==cut))","endCaptures":{"1":{"name":"storage.type.class.pod.perl"},"2":{"name":"variable.other.pod.perl"}},"name":"meta.embedded.pod.perl","patterns":[{"include":"text.html.basic"}]},{"captures":{"1":{"name":"storage.type.class.pod.perl"},"2":{"name":"variable.other.pod.perl","patterns":[{"include":"#pod-formatting"}]}},"match":"^(=(?:head[1-4]|item|over|encoding|begin|end|for))\\\\b\\\\s*(.*)"},{"include":"#pod-formatting"}]},"pod-formatting":{"patterns":[{"captures":{"1":{"name":"markup.italic.pod.perl"},"2":{"name":"markup.italic.pod.perl"}},"match":"I(?:<([^<>]+)>|<+(\\\\s+(?:(?<!\\\\s)>|[^>])+\\\\s+)>+)","name":"entity.name.type.instance.pod.perl"},{"captures":{"1":{"name":"markup.bold.pod.perl"},"2":{"name":"markup.bold.pod.perl"}},"match":"B(?:<([^<>]+)>|<+(\\\\s+(?:(?<!\\\\s)>|[^>])+\\\\s+)>+)","name":"entity.name.type.instance.pod.perl"},{"captures":{"1":{"name":"markup.raw.pod.perl"},"2":{"name":"markup.raw.pod.perl"}},"match":"C(?:<([^<>]+)>|<+(\\\\\\\\s+(?:(?<!\\\\\\\\s)>|[^>])+\\\\\\\\s+)>+)","name":"entity.name.type.instance.pod.perl"},{"captures":{"1":{"name":"markup.underline.link.hyperlink.pod.perl"}},"match":"L<([^>]+)>","name":"entity.name.type.instance.pod.perl"},{"match":"[EFSXZ]<[^>]*>","name":"entity.name.type.instance.pod.perl"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)&(?![0-9A-Z_a-z])","name":"variable.other.regexp.match.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)\`(?![0-9A-Z_a-z])","name":"variable.other.regexp.pre-match.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)'(?![0-9A-Z_a-z])","name":"variable.other.regexp.post-match.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)\\\\+(?![0-9A-Z_a-z])","name":"variable.other.regexp.last-paren-match.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)\\"(?![0-9A-Z_a-z])","name":"variable.other.readwrite.list-separator.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)0(?![0-9A-Z_a-z])","name":"variable.other.predefined.program-name.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)[!#$%()*,-/:-@\\\\[-_ab|~](?![0-9A-Z_a-z])","name":"variable.other.predefined.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$)[0-9]+(?![0-9A-Z_a-z])","name":"variable.other.subpattern.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"([$%@](#)?)([$7A-Za-z]|::)([$0-9A-Z_a-z]|::)*\\\\b","name":"variable.other.readwrite.global.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"},"2":{"name":"punctuation.definition.variable.perl"}},"match":"(\\\\$\\\\{)(?:[$7A-Za-z]|::)(?:[$0-9A-Z_a-z]|::)*(})","name":"variable.other.readwrite.global.perl"},{"captures":{"1":{"name":"punctuation.definition.variable.perl"}},"match":"([$%@](#)?)[0-9_]\\\\b","name":"variable.other.readwrite.global.special.perl"}]}},"scopeName":"source.perl","embeddedLangs":["html","xml","css","javascript","sql"]}`)),o=[...r,...i,...t,...n,...e,a];export{o as default};
|
dist/assets/{php-Ck6au63W.js → php-D7zCItky.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{ruby-MtT2q-YK.js → ruby-DS6OgOeT.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{tsx-DTec1eR3.js → tsx-SWHveV8v.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{typescript-DS_K7jZo.js → typescript-Dwr3H4Cg.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/assets/{xml-D1DXoeKX.js → xml-Cpvg3MKE.js}
RENAMED
|
@@ -1 +1 @@
|
|
| 1 |
-
import{t as e}from"./java-
|
|
|
|
| 1 |
+
import{t as e}from"./java-BlrE5MjW.js";var t=Object.freeze(JSON.parse(`{"displayName":"XML","name":"xml","patterns":[{"begin":"(<\\\\?)\\\\s*([-0-9A-Z_a-z]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"}},"end":"(\\\\?>)","name":"meta.tag.preprocessor.xml","patterns":[{"match":" ([-A-Za-z]+)","name":"entity.other.attribute-name.xml"},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},{"begin":"(<!)(DOCTYPE)\\\\s+([:A-Z_a-z][-.0-:A-Z_a-z]*)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.doctype.xml"},"3":{"name":"variable.language.documentroot.xml"}},"end":"\\\\s*(>)","name":"meta.tag.sgml.doctype.xml","patterns":[{"include":"#internalSubset"}]},{"include":"#comments"},{"begin":"(<)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(?=(\\\\s[^>]*)?></\\\\2>)","beginCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(>)(</)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(>)","endCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"punctuation.definition.tag.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"entity.name.tag.namespace.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"},"7":{"name":"punctuation.definition.tag.xml"}},"name":"meta.tag.no-content.xml","patterns":[{"include":"#tagStuff"}]},{"begin":"(</?)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(/?>)","name":"meta.tag.xml","patterns":[{"include":"#tagStuff"}]},{"include":"#entity"},{"include":"#bare-ampersand"},{"begin":"<%@","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java-props.embedded.xml","patterns":[{"match":"page|include|taglib","name":"keyword.other.page-props.xml"}]},{"begin":"<%[!=]?(?!--)","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"(?!--)%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java.embedded.xml","patterns":[{"include":"source.java"}]},{"begin":"<!\\\\[CDATA\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"]]>","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.unquoted.cdata.xml"}],"repository":{"EntityDecl":{"begin":"(<!)(ENTITY)\\\\s+(%\\\\s+)?([:A-Z_a-z][-.0-:A-Z_a-z]*)(\\\\s+(?:SYSTEM|PUBLIC)\\\\s+)?","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.entity.xml"},"3":{"name":"punctuation.definition.entity.xml"},"4":{"name":"variable.language.entity.xml"},"5":{"name":"keyword.other.entitytype.xml"}},"end":"(>)","patterns":[{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},"bare-ampersand":{"match":"&","name":"invalid.illegal.bad-ampersand.xml"},"comments":{"patterns":[{"begin":"<%--","captures":{"0":{"name":"punctuation.definition.comment.xml"},"end":"--%>","name":"comment.block.xml"}},{"begin":"<!--","captures":{"0":{"name":"punctuation.definition.comment.xml"}},"end":"-->","name":"comment.block.xml","patterns":[{"begin":"--(?!>)","captures":{"0":{"name":"invalid.illegal.bad-comments-or-CDATA.xml"}}}]}]},"doublequotedString":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"entity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(&)([:A-Z_a-z][-.0-:A-Z_a-z]*|#[0-9]+|#x\\\\h+)(;)","name":"constant.character.entity.xml"},"internalSubset":{"begin":"(\\\\[)","captures":{"1":{"name":"punctuation.definition.constant.xml"}},"end":"(])","name":"meta.internalsubset.xml","patterns":[{"include":"#EntityDecl"},{"include":"#parameterEntity"},{"include":"#comments"}]},"parameterEntity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(%)([:A-Z_a-z][-.0-:A-Z_a-z]*)(;)","name":"constant.character.parameter-entity.xml"},"singlequotedString":{"begin":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"'","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"tagStuff":{"patterns":[{"captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}},"match":"(?:^|\\\\s+)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)\\\\s*="},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]}},"scopeName":"text.xml","embeddedLangs":["java"]}`)),n=[...e,t];export{n as default};
|
dist/index.html
CHANGED
|
@@ -10,8 +10,8 @@
|
|
| 10 |
content="Bonsai Chat runs private WebGPU language models locally in your browser."
|
| 11 |
/>
|
| 12 |
<title>Bonsai Chat · WebGPU</title>
|
| 13 |
-
<script type="module" crossorigin src="/assets/index-
|
| 14 |
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
| 15 |
</head>
|
| 16 |
<body>
|
| 17 |
<div id="root"></div>
|
|
|
|
| 10 |
content="Bonsai Chat runs private WebGPU language models locally in your browser."
|
| 11 |
/>
|
| 12 |
<title>Bonsai Chat · WebGPU</title>
|
| 13 |
+
<script type="module" crossorigin src="/assets/index-vXLRCcU6.js"></script>
|
| 14 |
+
<link rel="stylesheet" crossorigin href="/assets/index-CFM0yVq3.css">
|
| 15 |
</head>
|
| 16 |
<body>
|
| 17 |
<div id="root"></div>
|
scripts/test-artifact-csp.mjs
CHANGED
|
@@ -67,38 +67,141 @@ try {
|
|
| 67 |
await page.goto(`http://127.0.0.1:${viteAddress.port}/artifact-csp-probe.html`);
|
| 68 |
|
| 69 |
const payloads = [
|
| 70 |
-
{ id: 'comment-head', html: `<!-- <head> --><img src="${probeBaseUrl}/probe/comment-head">` },
|
| 71 |
-
{ id: 'before-head', html: `<img src="${probeBaseUrl}/probe/before-head"><head><title>late head</title></head>` },
|
| 72 |
-
{ id: 'inline-script', html: `<script>location.href=${JSON.stringify(`${probeBaseUrl}/probe/inline-script`)}</script>` },
|
| 73 |
-
{ id: 'meta-refresh', html: `<meta http-equiv="refresh" content="0;url=${probeBaseUrl}/probe/meta-refresh">` },
|
| 74 |
];
|
| 75 |
for (const payload of payloads) {
|
| 76 |
-
await page.evaluate(async ({ artifactId, sourceHtml }) => {
|
| 77 |
-
const { prepareHtmlArtifact } = await import('/src/lib/
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
const iframe = document.createElement('iframe');
|
| 80 |
iframe.dataset.artifactId = artifactId;
|
| 81 |
-
|
| 82 |
-
iframe.setAttribute('credentialless', '');
|
| 83 |
await new Promise((resolveLoad) => {
|
| 84 |
iframe.addEventListener('load', resolveLoad, { once: true });
|
| 85 |
iframe.srcdoc = artifact.sandboxedSource;
|
| 86 |
document.body.append(iframe);
|
| 87 |
});
|
| 88 |
-
}, { artifactId: payload.id, sourceHtml: payload.html });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
}
|
| 90 |
|
| 91 |
await page.evaluate(async () => {
|
| 92 |
-
const { prepareHtmlArtifact } = await import('/src/lib/
|
| 93 |
const artifact = prepareHtmlArtifact(
|
| 94 |
-
'<style>#static-card{color:rgb(17, 34, 51);background:rgb(238, 244, 240)}</style><section id="static-card">
|
| 95 |
-
'
|
| 96 |
'static-render',
|
| 97 |
);
|
| 98 |
const iframe = document.createElement('iframe');
|
| 99 |
iframe.dataset.artifactId = artifact.id;
|
| 100 |
-
|
| 101 |
-
iframe.setAttribute('credentialless', '');
|
| 102 |
await new Promise((resolveLoad) => {
|
| 103 |
iframe.addEventListener('load', resolveLoad, { once: true });
|
| 104 |
iframe.srcdoc = artifact.sandboxedSource;
|
|
@@ -106,7 +209,7 @@ try {
|
|
| 106 |
});
|
| 107 |
});
|
| 108 |
|
| 109 |
-
await new Promise((resolveWait) => setTimeout(resolveWait,
|
| 110 |
if (probeHits.length > 0) {
|
| 111 |
throw new Error(`Artifact CSP leaked ${probeHits.length} request(s): ${probeHits.join(', ')}`);
|
| 112 |
}
|
|
@@ -117,12 +220,12 @@ try {
|
|
| 117 |
color: getComputedStyle(element).color,
|
| 118 |
background: getComputedStyle(element).backgroundColor,
|
| 119 |
}));
|
| 120 |
-
if (staticRender.text !== '
|
| 121 |
|| staticRender.color !== 'rgb(17, 34, 51)'
|
| 122 |
|| staticRender.background !== 'rgb(238, 244, 240)') {
|
| 123 |
throw new Error(`Static HTML/CSS render failed: ${JSON.stringify(staticRender)}`);
|
| 124 |
}
|
| 125 |
-
console.log(`artifact
|
| 126 |
} finally {
|
| 127 |
await browser?.close();
|
| 128 |
await vite?.close();
|
|
|
|
| 67 |
await page.goto(`http://127.0.0.1:${viteAddress.port}/artifact-csp-probe.html`);
|
| 68 |
|
| 69 |
const payloads = [
|
| 70 |
+
{ id: 'comment-head', html: `<!-- <head> --><img src="${probeBaseUrl}/probe/comment-head">`, rejected: false },
|
| 71 |
+
{ id: 'before-head', html: `<img src="${probeBaseUrl}/probe/before-head"><head><title>late head</title></head>`, rejected: false },
|
| 72 |
+
{ id: 'inline-script', html: `<script>location.href=${JSON.stringify(`${probeBaseUrl}/probe/inline-script`)}</script>`, rejected: true },
|
| 73 |
+
{ id: 'meta-refresh', html: `<meta http-equiv="refresh" content="0;url=${probeBaseUrl}/probe/meta-refresh">`, rejected: true },
|
| 74 |
];
|
| 75 |
for (const payload of payloads) {
|
| 76 |
+
await page.evaluate(async ({ artifactId, sourceHtml, shouldReject }) => {
|
| 77 |
+
const { configureArtifactIframe, prepareHtmlArtifact } = await import('/src/lib/artifact-runtime.ts');
|
| 78 |
+
let artifact;
|
| 79 |
+
try {
|
| 80 |
+
artifact = prepareHtmlArtifact(sourceHtml, 'CSP probe', artifactId);
|
| 81 |
+
} catch (error) {
|
| 82 |
+
if (shouldReject) return;
|
| 83 |
+
throw error;
|
| 84 |
+
}
|
| 85 |
+
if (shouldReject) throw new Error(`${artifactId} was expected to be rejected`);
|
| 86 |
const iframe = document.createElement('iframe');
|
| 87 |
iframe.dataset.artifactId = artifactId;
|
| 88 |
+
configureArtifactIframe(iframe);
|
|
|
|
| 89 |
await new Promise((resolveLoad) => {
|
| 90 |
iframe.addEventListener('load', resolveLoad, { once: true });
|
| 91 |
iframe.srcdoc = artifact.sandboxedSource;
|
| 92 |
document.body.append(iframe);
|
| 93 |
});
|
| 94 |
+
}, { artifactId: payload.id, sourceHtml: payload.html, shouldReject: payload.rejected });
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
const passingEvaluation = await page.evaluate(async ({ blockedUrl }) => {
|
| 98 |
+
const { evaluateHtmlArtifact, prepareHtmlArtifact } = await import('/src/lib/artifact-runtime.ts');
|
| 99 |
+
const artifact = prepareHtmlArtifact(
|
| 100 |
+
`<!doctype html><html><head><title>Live artifact</title><style>#output{color:rgb(17, 34, 51);background:rgb(238, 244, 240)}</style></head><body><section id="output">Waiting</section><script>
|
| 101 |
+
document.querySelector('#output').textContent = 'JavaScript artifact rendered';
|
| 102 |
+
console.log('artifact booted', { ready: true });
|
| 103 |
+
try { localStorage.setItem('forbidden', '1'); } catch (error) { console.warn('storage blocked', error.name); }
|
| 104 |
+
fetch(${JSON.stringify(blockedUrl)}).catch(() => console.warn('fetch blocked'));
|
| 105 |
+
</script></body></html>`,
|
| 106 |
+
'Live artifact probe',
|
| 107 |
+
'live-evaluation',
|
| 108 |
+
);
|
| 109 |
+
return evaluateHtmlArtifact(artifact);
|
| 110 |
+
}, { blockedUrl: `${probeBaseUrl}/probe/fetch` });
|
| 111 |
+
if (passingEvaluation.status !== 'passed') {
|
| 112 |
+
throw new Error(`Passing artifact reported failure: ${JSON.stringify(passingEvaluation)}`);
|
| 113 |
+
}
|
| 114 |
+
if (!passingEvaluation.entries.some((entry) => entry.message.includes('artifact booted'))
|
| 115 |
+
|| !passingEvaluation.entries.some((entry) => entry.message.includes('storage blocked'))
|
| 116 |
+
|| passingEvaluation.dom?.textPreview !== 'JavaScript artifact rendered') {
|
| 117 |
+
throw new Error(`Passing artifact diagnostics were incomplete: ${JSON.stringify(passingEvaluation)}`);
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
const failingEvaluation = await page.evaluate(async () => {
|
| 121 |
+
const { evaluateHtmlArtifact, prepareHtmlArtifact } = await import('/src/lib/artifact-runtime.ts');
|
| 122 |
+
const artifact = prepareHtmlArtifact(
|
| 123 |
+
'<main>Broken artifact</main><script>console.error("deliberate runtime failure"); Promise.reject(new Error("async failure"));</script>',
|
| 124 |
+
'Failure probe',
|
| 125 |
+
'failure-evaluation',
|
| 126 |
+
);
|
| 127 |
+
return evaluateHtmlArtifact(artifact);
|
| 128 |
+
});
|
| 129 |
+
if (failingEvaluation.status !== 'failed'
|
| 130 |
+
|| !failingEvaluation.entries.some((entry) => entry.level === 'error' && entry.message.includes('deliberate runtime failure'))
|
| 131 |
+
|| !failingEvaluation.entries.some((entry) => entry.level === 'error' && entry.message.includes('async failure'))) {
|
| 132 |
+
throw new Error(`Runtime errors were not returned: ${JSON.stringify(failingEvaluation)}`);
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
const lifecycle = await page.evaluate(async () => {
|
| 136 |
+
const { executeAgentTool } = await import('/src/lib/agent-tools.ts');
|
| 137 |
+
const context = { artifacts: new Map() };
|
| 138 |
+
const create = await executeAgentTool({
|
| 139 |
+
id: 'stable-tool-artifact',
|
| 140 |
+
type: 'function',
|
| 141 |
+
function: {
|
| 142 |
+
name: 'html_artifact',
|
| 143 |
+
arguments: JSON.stringify({
|
| 144 |
+
title: 'Repair lifecycle',
|
| 145 |
+
html: '<main>Broken</main><script>console.error("repair me")</script>',
|
| 146 |
+
}),
|
| 147 |
+
},
|
| 148 |
+
}, undefined, context);
|
| 149 |
+
const update = await executeAgentTool({
|
| 150 |
+
id: 'repair-call',
|
| 151 |
+
type: 'function',
|
| 152 |
+
function: {
|
| 153 |
+
name: 'artifact_update',
|
| 154 |
+
arguments: JSON.stringify({
|
| 155 |
+
artifact_id: 'stable-tool-artifact',
|
| 156 |
+
html: '<main id="fixed">Fixed</main><script>document.querySelector("#fixed").dataset.ready="1"</script>',
|
| 157 |
+
}),
|
| 158 |
+
},
|
| 159 |
+
}, undefined, context);
|
| 160 |
+
const retest = await executeAgentTool({
|
| 161 |
+
id: 'retest-call',
|
| 162 |
+
type: 'function',
|
| 163 |
+
function: {
|
| 164 |
+
name: 'artifact_test',
|
| 165 |
+
arguments: JSON.stringify({ artifact_id: 'stable-tool-artifact' }),
|
| 166 |
+
},
|
| 167 |
+
}, undefined, context);
|
| 168 |
+
const inspect = await executeAgentTool({
|
| 169 |
+
id: 'inspect-call',
|
| 170 |
+
type: 'function',
|
| 171 |
+
function: {
|
| 172 |
+
name: 'artifact_inspect',
|
| 173 |
+
arguments: JSON.stringify({ artifact_id: 'stable-tool-artifact', include_source: true }),
|
| 174 |
+
},
|
| 175 |
+
}, undefined, context);
|
| 176 |
+
return {
|
| 177 |
+
create: JSON.parse(create.output),
|
| 178 |
+
update: JSON.parse(update.output),
|
| 179 |
+
retest: JSON.parse(retest.output),
|
| 180 |
+
inspect: JSON.parse(inspect.output),
|
| 181 |
+
stableId: update.artifact?.id,
|
| 182 |
+
artifactCount: context.artifacts.size,
|
| 183 |
+
};
|
| 184 |
+
});
|
| 185 |
+
if (lifecycle.create.evaluation.status !== 'failed'
|
| 186 |
+
|| lifecycle.update.evaluation.status !== 'passed'
|
| 187 |
+
|| lifecycle.retest.evaluation.status !== 'passed'
|
| 188 |
+
|| lifecycle.inspect.artifact.evaluation.status !== 'passed'
|
| 189 |
+
|| !lifecycle.inspect.artifact.source.includes('dataset.ready')
|
| 190 |
+
|| lifecycle.stableId !== 'stable-tool-artifact'
|
| 191 |
+
|| lifecycle.artifactCount !== 1) {
|
| 192 |
+
throw new Error(`Artifact repair lifecycle failed: ${JSON.stringify(lifecycle)}`);
|
| 193 |
}
|
| 194 |
|
| 195 |
await page.evaluate(async () => {
|
| 196 |
+
const { configureArtifactIframe, prepareHtmlArtifact } = await import('/src/lib/artifact-runtime.ts');
|
| 197 |
const artifact = prepareHtmlArtifact(
|
| 198 |
+
'<style>#static-card{color:rgb(17, 34, 51);background:rgb(238, 244, 240)}</style><section id="static-card">Waiting</section><script>document.querySelector("#static-card").textContent="JavaScript artifact rendered"</script>',
|
| 199 |
+
'Rendered probe',
|
| 200 |
'static-render',
|
| 201 |
);
|
| 202 |
const iframe = document.createElement('iframe');
|
| 203 |
iframe.dataset.artifactId = artifact.id;
|
| 204 |
+
configureArtifactIframe(iframe);
|
|
|
|
| 205 |
await new Promise((resolveLoad) => {
|
| 206 |
iframe.addEventListener('load', resolveLoad, { once: true });
|
| 207 |
iframe.srcdoc = artifact.sandboxedSource;
|
|
|
|
| 209 |
});
|
| 210 |
});
|
| 211 |
|
| 212 |
+
await new Promise((resolveWait) => setTimeout(resolveWait, 400));
|
| 213 |
if (probeHits.length > 0) {
|
| 214 |
throw new Error(`Artifact CSP leaked ${probeHits.length} request(s): ${probeHits.join(', ')}`);
|
| 215 |
}
|
|
|
|
| 220 |
color: getComputedStyle(element).color,
|
| 221 |
background: getComputedStyle(element).backgroundColor,
|
| 222 |
}));
|
| 223 |
+
if (staticRender.text !== 'JavaScript artifact rendered'
|
| 224 |
|| staticRender.color !== 'rgb(17, 34, 51)'
|
| 225 |
|| staticRender.background !== 'rgb(238, 244, 240)') {
|
| 226 |
throw new Error(`Static HTML/CSS render failed: ${JSON.stringify(staticRender)}`);
|
| 227 |
}
|
| 228 |
+
console.log(`artifact runtime probe passed: ${payloads.length} network bypasses emitted 0 requests; inline JS rendered; console errors returned; stable-ID repair and retest passed`);
|
| 229 |
} finally {
|
| 230 |
await browser?.close();
|
| 231 |
await vite?.close();
|
src/app/App.test.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
|
|
| 2 |
import releaseManifest from '../../public/manifest/models.json';
|
| 3 |
import { EngineClientError } from '../engine';
|
| 4 |
import {
|
|
|
|
| 5 |
DEFAULT_CONTEXT_SIZE,
|
| 6 |
DEFAULT_MAX_TOKENS,
|
| 7 |
DEFAULT_MODEL_ID,
|
|
@@ -12,6 +13,7 @@ import {
|
|
| 12 |
reportsModelWeightProgress,
|
| 13 |
requiresModelReload,
|
| 14 |
} from './App';
|
|
|
|
| 15 |
|
| 16 |
function engineError(code: string): EngineClientError {
|
| 17 |
return new EngineClientError({ code, message: code });
|
|
@@ -97,3 +99,53 @@ describe('App backend diagnostics', () => {
|
|
| 97 |
delete globalThis.__bonsaiBackendReport;
|
| 98 |
});
|
| 99 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import releaseManifest from '../../public/manifest/models.json';
|
| 3 |
import { EngineClientError } from '../engine';
|
| 4 |
import {
|
| 5 |
+
applyToolExecutionToMessages,
|
| 6 |
DEFAULT_CONTEXT_SIZE,
|
| 7 |
DEFAULT_MAX_TOKENS,
|
| 8 |
DEFAULT_MODEL_ID,
|
|
|
|
| 13 |
reportsModelWeightProgress,
|
| 14 |
requiresModelReload,
|
| 15 |
} from './App';
|
| 16 |
+
import { prepareHtmlArtifact, type ToolExecution } from '../lib/agent-tools';
|
| 17 |
|
| 18 |
function engineError(code: string): EngineClientError {
|
| 19 |
return new EngineClientError({ code, message: code });
|
|
|
|
| 99 |
delete globalThis.__bonsaiBackendReport;
|
| 100 |
});
|
| 101 |
});
|
| 102 |
+
|
| 103 |
+
describe('App artifact identity', () => {
|
| 104 |
+
it('replaces an existing artifact in its original message while completing the current tool run', () => {
|
| 105 |
+
const original = prepareHtmlArtifact('<p>old</p>', 'Demo', 'stable-artifact', 'old-runtime');
|
| 106 |
+
const replacement = prepareHtmlArtifact('<p>new</p>', 'Demo', 'stable-artifact', 'new-runtime');
|
| 107 |
+
const execution: ToolExecution = {
|
| 108 |
+
call: {
|
| 109 |
+
id: 'update-call',
|
| 110 |
+
type: 'function',
|
| 111 |
+
function: { name: 'artifact_update', arguments: '{}' },
|
| 112 |
+
},
|
| 113 |
+
artifact: replacement,
|
| 114 |
+
output: '{"ok":true}',
|
| 115 |
+
failed: false,
|
| 116 |
+
};
|
| 117 |
+
const next = applyToolExecutionToMessages([
|
| 118 |
+
{ id: 'older', role: 'assistant', content: '', timestamp: '10:00', artifacts: [original] },
|
| 119 |
+
{
|
| 120 |
+
id: 'current',
|
| 121 |
+
role: 'assistant',
|
| 122 |
+
content: '',
|
| 123 |
+
timestamp: '10:01',
|
| 124 |
+
tools: [{ id: 'update-call', name: 'artifact_update', input: '{}', state: 'running' }],
|
| 125 |
+
},
|
| 126 |
+
], 'current', 'update-call', execution);
|
| 127 |
+
|
| 128 |
+
expect(next[0]?.artifacts).toEqual([replacement]);
|
| 129 |
+
expect(next[1]?.artifacts).toBeUndefined();
|
| 130 |
+
expect(next[1]?.tools?.[0]).toMatchObject({ state: 'complete', output: '{"ok":true}' });
|
| 131 |
+
});
|
| 132 |
+
|
| 133 |
+
it('attaches a newly created artifact to the current assistant message', () => {
|
| 134 |
+
const artifact = prepareHtmlArtifact('<p>new</p>', 'Demo', 'new-artifact', 'runtime');
|
| 135 |
+
const execution: ToolExecution = {
|
| 136 |
+
call: { id: 'create-call', type: 'function', function: { name: 'html_artifact', arguments: '{}' } },
|
| 137 |
+
artifact,
|
| 138 |
+
output: '{"ok":true}',
|
| 139 |
+
failed: false,
|
| 140 |
+
};
|
| 141 |
+
const next = applyToolExecutionToMessages([{
|
| 142 |
+
id: 'current',
|
| 143 |
+
role: 'assistant',
|
| 144 |
+
content: '',
|
| 145 |
+
timestamp: '10:01',
|
| 146 |
+
tools: [{ id: 'create-call', name: 'html_artifact', input: '{}', state: 'running' }],
|
| 147 |
+
}], 'current', 'create-call', execution);
|
| 148 |
+
|
| 149 |
+
expect(next[0]?.artifacts).toEqual([artifact]);
|
| 150 |
+
});
|
| 151 |
+
});
|
src/app/App.tsx
CHANGED
|
@@ -15,7 +15,8 @@ import {
|
|
| 15 |
type ModelTierId,
|
| 16 |
type RequestedBackend,
|
| 17 |
} from '../engine';
|
| 18 |
-
import { executeAgentTool } from '../lib/agent-tools';
|
|
|
|
| 19 |
import type {
|
| 20 |
ChatMessage,
|
| 21 |
ChatSession,
|
|
@@ -46,9 +47,9 @@ import { planClientTools } from '../lib/tool-routing';
|
|
| 46 |
import { BonsaiShell } from './components/BonsaiShell';
|
| 47 |
|
| 48 |
const MANIFEST_PATH = 'manifest/models.json';
|
| 49 |
-
const MAX_TOOL_ROUNDS =
|
| 50 |
const MAX_TOOL_CALLS_PER_ROUND = 4;
|
| 51 |
-
const MAX_TOOL_CALLS_TOTAL =
|
| 52 |
export const DEFAULT_MODEL_ID: ModelId = 'bonsai-27b';
|
| 53 |
export { DEFAULT_CONTEXT_SIZE, DEFAULT_MAX_TOKENS } from '../lib/runtime-defaults';
|
| 54 |
|
|
@@ -230,6 +231,47 @@ function replaceMessage(
|
|
| 230 |
setter((current) => current.map((message) => message.id === id ? update(message) : message));
|
| 231 |
}
|
| 232 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
function buildEngineHistory(messages: ChatMessage[], systemPrompt: string): EngineChatMessage[] {
|
| 234 |
const history: EngineChatMessage[] = systemPrompt.trim()
|
| 235 |
? [{ role: 'system', content: systemPrompt.trim() }]
|
|
@@ -423,6 +465,7 @@ export function App() {
|
|
| 423 |
try {
|
| 424 |
const storedConversations = (await listConversations<ChatMessage>()).map((conversation) => ({
|
| 425 |
...conversation,
|
|
|
|
| 426 |
modelId: normalizeConversationModelId(conversation.modelId),
|
| 427 |
systemPrompt: typeof conversation.systemPrompt === 'string'
|
| 428 |
? conversation.systemPrompt
|
|
@@ -834,6 +877,9 @@ export function App() {
|
|
| 834 |
const generationStartedAt = performance.now();
|
| 835 |
let toolRounds = 0;
|
| 836 |
let totalToolCalls = 0;
|
|
|
|
|
|
|
|
|
|
| 837 |
clearPendingInferenceProgress();
|
| 838 |
setTelemetry((current) => ({
|
| 839 |
...current,
|
|
@@ -984,19 +1030,9 @@ export function App() {
|
|
| 984 |
tools: [...(message.tools ?? []), toolRun],
|
| 985 |
}));
|
| 986 |
setToolEvents((current) => [...current.filter((item) => item.id !== call.id), event].slice(-20));
|
| 987 |
-
const execution = await executeAgentTool(call, controller.signal);
|
| 988 |
if (controller.signal.aborted) throw new DOMException('The tool operation was aborted.', 'AbortError');
|
| 989 |
-
|
| 990 |
-
...message,
|
| 991 |
-
...(execution.artifact ? {
|
| 992 |
-
artifacts: [...(message.artifacts ?? []), execution.artifact],
|
| 993 |
-
} : {}),
|
| 994 |
-
tools: (message.tools ?? []).map((item) => item.id === call.id ? {
|
| 995 |
-
...item,
|
| 996 |
-
output: execution.output,
|
| 997 |
-
state: execution.failed ? 'error' : 'complete',
|
| 998 |
-
} : item),
|
| 999 |
-
}));
|
| 1000 |
setToolEvents((current) => current.map((item) => item.id === call.id ? {
|
| 1001 |
...item,
|
| 1002 |
timestamp: eventClock(),
|
|
|
|
| 15 |
type ModelTierId,
|
| 16 |
type RequestedBackend,
|
| 17 |
} from '../engine';
|
| 18 |
+
import { executeAgentTool, type ToolExecution } from '../lib/agent-tools';
|
| 19 |
+
import { normalizeArtifactDocument } from '../lib/artifact-runtime';
|
| 20 |
import type {
|
| 21 |
ChatMessage,
|
| 22 |
ChatSession,
|
|
|
|
| 47 |
import { BonsaiShell } from './components/BonsaiShell';
|
| 48 |
|
| 49 |
const MANIFEST_PATH = 'manifest/models.json';
|
| 50 |
+
const MAX_TOOL_ROUNDS = 8;
|
| 51 |
const MAX_TOOL_CALLS_PER_ROUND = 4;
|
| 52 |
+
const MAX_TOOL_CALLS_TOTAL = 20;
|
| 53 |
export const DEFAULT_MODEL_ID: ModelId = 'bonsai-27b';
|
| 54 |
export { DEFAULT_CONTEXT_SIZE, DEFAULT_MAX_TOKENS } from '../lib/runtime-defaults';
|
| 55 |
|
|
|
|
| 231 |
setter((current) => current.map((message) => message.id === id ? update(message) : message));
|
| 232 |
}
|
| 233 |
|
| 234 |
+
export function applyToolExecutionToMessages(
|
| 235 |
+
messages: ChatMessage[],
|
| 236 |
+
assistantId: string,
|
| 237 |
+
callId: string,
|
| 238 |
+
execution: ToolExecution,
|
| 239 |
+
): ChatMessage[] {
|
| 240 |
+
const artifactOwnerId = execution.artifact
|
| 241 |
+
? messages.find((message) => message.artifacts?.some((artifact) => artifact.id === execution.artifact?.id))?.id
|
| 242 |
+
: undefined;
|
| 243 |
+
return messages.map((message) => {
|
| 244 |
+
const ownsArtifact = message.id === artifactOwnerId;
|
| 245 |
+
const receivesArtifact = Boolean(execution.artifact)
|
| 246 |
+
&& (ownsArtifact || (!artifactOwnerId && message.id === assistantId));
|
| 247 |
+
const artifacts = receivesArtifact && execution.artifact
|
| 248 |
+
? ownsArtifact
|
| 249 |
+
? (message.artifacts ?? []).map((artifact) => artifact.id === execution.artifact?.id
|
| 250 |
+
? execution.artifact
|
| 251 |
+
: artifact) as NonNullable<ChatMessage['artifacts']>
|
| 252 |
+
: [...(message.artifacts ?? []), execution.artifact]
|
| 253 |
+
: message.artifacts;
|
| 254 |
+
if (message.id !== assistantId && !receivesArtifact) return message;
|
| 255 |
+
return {
|
| 256 |
+
...message,
|
| 257 |
+
...(receivesArtifact ? { artifacts } : {}),
|
| 258 |
+
...(message.id === assistantId ? {
|
| 259 |
+
tools: (message.tools ?? []).map((item) => item.id === callId ? {
|
| 260 |
+
...item,
|
| 261 |
+
output: execution.output,
|
| 262 |
+
state: execution.failed ? 'error' as const : 'complete' as const,
|
| 263 |
+
} : item),
|
| 264 |
+
} : {}),
|
| 265 |
+
};
|
| 266 |
+
});
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
export function normalizeStoredMessages(messages: ChatMessage[]): ChatMessage[] {
|
| 270 |
+
return messages.map((message) => message.artifacts
|
| 271 |
+
? { ...message, artifacts: message.artifacts.map(normalizeArtifactDocument) }
|
| 272 |
+
: message);
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
function buildEngineHistory(messages: ChatMessage[], systemPrompt: string): EngineChatMessage[] {
|
| 276 |
const history: EngineChatMessage[] = systemPrompt.trim()
|
| 277 |
? [{ role: 'system', content: systemPrompt.trim() }]
|
|
|
|
| 465 |
try {
|
| 466 |
const storedConversations = (await listConversations<ChatMessage>()).map((conversation) => ({
|
| 467 |
...conversation,
|
| 468 |
+
messages: normalizeStoredMessages(conversation.messages),
|
| 469 |
modelId: normalizeConversationModelId(conversation.modelId),
|
| 470 |
systemPrompt: typeof conversation.systemPrompt === 'string'
|
| 471 |
? conversation.systemPrompt
|
|
|
|
| 877 |
const generationStartedAt = performance.now();
|
| 878 |
let toolRounds = 0;
|
| 879 |
let totalToolCalls = 0;
|
| 880 |
+
const artifactRegistry = new Map(historySnapshot.flatMap((message) => (
|
| 881 |
+
message.artifacts ?? []
|
| 882 |
+
)).map((artifact) => [artifact.id, artifact]));
|
| 883 |
clearPendingInferenceProgress();
|
| 884 |
setTelemetry((current) => ({
|
| 885 |
...current,
|
|
|
|
| 1030 |
tools: [...(message.tools ?? []), toolRun],
|
| 1031 |
}));
|
| 1032 |
setToolEvents((current) => [...current.filter((item) => item.id !== call.id), event].slice(-20));
|
| 1033 |
+
const execution = await executeAgentTool(call, controller.signal, { artifacts: artifactRegistry });
|
| 1034 |
if (controller.signal.aborted) throw new DOMException('The tool operation was aborted.', 'AbortError');
|
| 1035 |
+
setMessages((current) => applyToolExecutionToMessages(current, assistantId, call.id, execution));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1036 |
setToolEvents((current) => current.map((item) => item.id === call.id ? {
|
| 1037 |
...item,
|
| 1038 |
timestamp: eventClock(),
|
src/app/components/ArtifactCard.tsx
CHANGED
|
@@ -1,5 +1,11 @@
|
|
| 1 |
import { useEffect, useRef, useState } from 'react';
|
| 2 |
import type { ArtifactDocument } from '../../lib/agent-tools';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
interface ArtifactCardProps {
|
| 5 |
artifact: ArtifactDocument;
|
|
@@ -18,13 +24,32 @@ export function ArtifactCard({ artifact }: ArtifactCardProps) {
|
|
| 18 |
const [tab, setTab] = useState<'html' | 'rendered'>('html');
|
| 19 |
const [fallbackFullscreen, setFallbackFullscreen] = useState(false);
|
| 20 |
const [nativeFullscreen, setNativeFullscreen] = useState(false);
|
|
|
|
| 21 |
const renderedRef = useRef<HTMLDivElement>(null);
|
|
|
|
| 22 |
|
| 23 |
useEffect(() => {
|
| 24 |
setTab('html');
|
| 25 |
setFallbackFullscreen(false);
|
| 26 |
}, [artifact.id]);
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
useEffect(() => {
|
| 29 |
const fullscreenDocument = document as WebkitFullscreenDocument;
|
| 30 |
const handleFullscreenChange = () => {
|
|
@@ -101,7 +126,12 @@ export function ArtifactCard({ artifact }: ArtifactCardProps) {
|
|
| 101 |
Rendered
|
| 102 |
</button>
|
| 103 |
</div>
|
| 104 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
{tab === 'rendered' && (
|
| 106 |
<button
|
| 107 |
className="artifact-fullscreen-button"
|
|
@@ -138,17 +168,46 @@ export function ArtifactCard({ artifact }: ArtifactCardProps) {
|
|
| 138 |
</button>
|
| 139 |
)}
|
| 140 |
<iframe
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
title={artifact.title}
|
| 143 |
-
sandbox=""
|
| 144 |
srcDoc={artifact.sandboxedSource}
|
| 145 |
/>
|
| 146 |
</div>
|
| 147 |
)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
</section>
|
| 149 |
);
|
| 150 |
}
|
| 151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
function FullscreenIcon({ expanded }: { expanded: boolean }) {
|
| 153 |
return expanded ? (
|
| 154 |
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M8 3v5H3M12 3v5h5M8 17v-5H3M12 17v-5h5" /></svg>
|
|
|
|
| 1 |
import { useEffect, useRef, useState } from 'react';
|
| 2 |
import type { ArtifactDocument } from '../../lib/agent-tools';
|
| 3 |
+
import {
|
| 4 |
+
configureArtifactIframe,
|
| 5 |
+
evaluationFromRuntimeMessage,
|
| 6 |
+
recordArtifactDiagnostics,
|
| 7 |
+
type ArtifactEvaluation,
|
| 8 |
+
} from '../../lib/artifact-runtime';
|
| 9 |
|
| 10 |
interface ArtifactCardProps {
|
| 11 |
artifact: ArtifactDocument;
|
|
|
|
| 24 |
const [tab, setTab] = useState<'html' | 'rendered'>('html');
|
| 25 |
const [fallbackFullscreen, setFallbackFullscreen] = useState(false);
|
| 26 |
const [nativeFullscreen, setNativeFullscreen] = useState(false);
|
| 27 |
+
const [evaluation, setEvaluation] = useState<ArtifactEvaluation | undefined>(artifact.evaluation);
|
| 28 |
const renderedRef = useRef<HTMLDivElement>(null);
|
| 29 |
+
const iframeRef = useRef<HTMLIFrameElement>(null);
|
| 30 |
|
| 31 |
useEffect(() => {
|
| 32 |
setTab('html');
|
| 33 |
setFallbackFullscreen(false);
|
| 34 |
}, [artifact.id]);
|
| 35 |
|
| 36 |
+
useEffect(() => {
|
| 37 |
+
setEvaluation(artifact.evaluation);
|
| 38 |
+
}, [artifact.evaluation, artifact.runtimeToken]);
|
| 39 |
+
|
| 40 |
+
useEffect(() => {
|
| 41 |
+
if (tab !== 'rendered') return;
|
| 42 |
+
const handleMessage = (event: MessageEvent) => {
|
| 43 |
+
if (event.source !== iframeRef.current?.contentWindow) return;
|
| 44 |
+
const next = evaluationFromRuntimeMessage(event.data, artifact.id, artifact.runtimeToken);
|
| 45 |
+
if (!next) return;
|
| 46 |
+
recordArtifactDiagnostics(artifact.id, artifact.runtimeToken, next);
|
| 47 |
+
setEvaluation(next);
|
| 48 |
+
};
|
| 49 |
+
window.addEventListener('message', handleMessage);
|
| 50 |
+
return () => window.removeEventListener('message', handleMessage);
|
| 51 |
+
}, [artifact.id, artifact.runtimeToken, tab]);
|
| 52 |
+
|
| 53 |
useEffect(() => {
|
| 54 |
const fullscreenDocument = document as WebkitFullscreenDocument;
|
| 55 |
const handleFullscreenChange = () => {
|
|
|
|
| 126 |
Rendered
|
| 127 |
</button>
|
| 128 |
</div>
|
| 129 |
+
<div className="artifact-title-block">
|
| 130 |
+
<strong id={`artifact-title-${artifact.id}`}>{artifact.title}</strong>
|
| 131 |
+
<span className={`artifact-test-status is-${evaluation?.status ?? 'pending'}`}>
|
| 132 |
+
{artifactStatus(evaluation)}
|
| 133 |
+
</span>
|
| 134 |
+
</div>
|
| 135 |
{tab === 'rendered' && (
|
| 136 |
<button
|
| 137 |
className="artifact-fullscreen-button"
|
|
|
|
| 168 |
</button>
|
| 169 |
)}
|
| 170 |
<iframe
|
| 171 |
+
key={`${artifact.id}-${artifact.runtimeToken}`}
|
| 172 |
+
ref={(node) => {
|
| 173 |
+
iframeRef.current = node;
|
| 174 |
+
if (node) configureArtifactIframe(node);
|
| 175 |
+
}}
|
| 176 |
title={artifact.title}
|
| 177 |
+
sandbox="allow-scripts"
|
| 178 |
srcDoc={artifact.sandboxedSource}
|
| 179 |
/>
|
| 180 |
</div>
|
| 181 |
)}
|
| 182 |
+
{evaluation && evaluation.entries.length > 0 && (
|
| 183 |
+
<details className="artifact-console" open={evaluation.status !== 'passed'}>
|
| 184 |
+
<summary>
|
| 185 |
+
Console
|
| 186 |
+
<span>{evaluation.entries.length} {evaluation.entries.length === 1 ? 'entry' : 'entries'}</span>
|
| 187 |
+
</summary>
|
| 188 |
+
<ol>
|
| 189 |
+
{evaluation.entries.map((entry, index) => (
|
| 190 |
+
<li className={`is-${entry.level}`} key={`${entry.level}-${entry.message}-${index}`}>
|
| 191 |
+
<b>{entry.level}</b>
|
| 192 |
+
<code>{entry.message}</code>
|
| 193 |
+
{entry.line !== undefined && <small>line {entry.line}{entry.column !== undefined ? `:${entry.column}` : ''}</small>}
|
| 194 |
+
</li>
|
| 195 |
+
))}
|
| 196 |
+
</ol>
|
| 197 |
+
</details>
|
| 198 |
+
)}
|
| 199 |
</section>
|
| 200 |
);
|
| 201 |
}
|
| 202 |
|
| 203 |
+
function artifactStatus(evaluation: ArtifactEvaluation | undefined): string {
|
| 204 |
+
if (!evaluation) return 'Not tested';
|
| 205 |
+
if (evaluation.status === 'timeout') return 'Test timed out';
|
| 206 |
+
const errors = evaluation.entries.filter((entry) => entry.level === 'error').length;
|
| 207 |
+
if (errors > 0) return `${errors} ${errors === 1 ? 'error' : 'errors'}`;
|
| 208 |
+
return 'Test passed';
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
function FullscreenIcon({ expanded }: { expanded: boolean }) {
|
| 212 |
return expanded ? (
|
| 213 |
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M8 3v5H3M12 3v5h5M8 17v-5H3M12 17v-5h5" /></svg>
|
src/app/components/ChatSurface.test.tsx
CHANGED
|
@@ -61,6 +61,13 @@ describe('ChatSurface message actions', () => {
|
|
| 61 |
expect(html).toContain('aria-label="Regenerate from this message"');
|
| 62 |
expect(html).toContain('aria-label="Regenerate this response"');
|
| 63 |
expect(html).not.toContain('Regenerate last');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
});
|
| 65 |
|
| 66 |
it('keeps text visible and identifies a structured tool call while streaming', () => {
|
|
@@ -126,6 +133,7 @@ describe('ChatSurface message actions', () => {
|
|
| 126 |
title: 'Counter app',
|
| 127 |
source: '<main>Counter</main>',
|
| 128 |
sandboxedSource: '<!doctype html><main>Counter</main>',
|
|
|
|
| 129 |
createdAt: 1,
|
| 130 |
}],
|
| 131 |
}]}
|
|
|
|
| 61 |
expect(html).toContain('aria-label="Regenerate from this message"');
|
| 62 |
expect(html).toContain('aria-label="Regenerate this response"');
|
| 63 |
expect(html).not.toContain('Regenerate last');
|
| 64 |
+
expect(html).toContain('aria-label="Show available tools"');
|
| 65 |
+
expect(html).toContain('<code>html_artifact</code>');
|
| 66 |
+
expect(html).toContain('<code>artifact_update</code>');
|
| 67 |
+
expect(html).toContain('<code>bar_chart</code>');
|
| 68 |
+
expect(html).toContain('<code>pie_chart</code>');
|
| 69 |
+
expect(html).toContain('<code>web_search</code>');
|
| 70 |
+
expect(html).toContain('Network tools ask before sending a query.');
|
| 71 |
});
|
| 72 |
|
| 73 |
it('keeps text visible and identifies a structured tool call while streaming', () => {
|
|
|
|
| 133 |
title: 'Counter app',
|
| 134 |
source: '<main>Counter</main>',
|
| 135 |
sandboxedSource: '<!doctype html><main>Counter</main>',
|
| 136 |
+
runtimeToken: 'artifact-one-runtime',
|
| 137 |
createdAt: 1,
|
| 138 |
}],
|
| 139 |
}]}
|
src/app/components/ChatSurface.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import type {
|
|
| 10 |
ToolRun,
|
| 11 |
} from '../../lib/contracts';
|
| 12 |
import type { CodeTheme } from '../../lib/code-highlighter';
|
|
|
|
| 13 |
import { ArtifactCard } from './ArtifactCard';
|
| 14 |
import { ComposerActivity } from './ComposerActivity';
|
| 15 |
import { MarkdownContent } from './MarkdownContent';
|
|
@@ -154,14 +155,34 @@ export function ChatSurface({
|
|
| 154 |
progress={modelLoadProgress}
|
| 155 |
/>
|
| 156 |
<div className="composer-meta">
|
| 157 |
-
<
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
<span>{runtimeStatus}</span>
|
| 166 |
</div>
|
| 167 |
<div className="composer-field">
|
|
@@ -328,6 +349,15 @@ function ToolIcon() {
|
|
| 328 |
);
|
| 329 |
}
|
| 330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
function CopyIcon() {
|
| 332 |
return (
|
| 333 |
<svg viewBox="0 0 20 20" aria-hidden="true">
|
|
|
|
| 10 |
ToolRun,
|
| 11 |
} from '../../lib/contracts';
|
| 12 |
import type { CodeTheme } from '../../lib/code-highlighter';
|
| 13 |
+
import { TOOL_CATALOG } from '../../lib/agent-tools';
|
| 14 |
import { ArtifactCard } from './ArtifactCard';
|
| 15 |
import { ComposerActivity } from './ComposerActivity';
|
| 16 |
import { MarkdownContent } from './MarkdownContent';
|
|
|
|
| 155 |
progress={modelLoadProgress}
|
| 156 |
/>
|
| 157 |
<div className="composer-meta">
|
| 158 |
+
<div className="tool-controls">
|
| 159 |
+
<button
|
| 160 |
+
className={`tool-toggle${toolsEnabled ? ' is-on' : ''}`}
|
| 161 |
+
type="button"
|
| 162 |
+
aria-pressed={toolsEnabled}
|
| 163 |
+
onClick={() => onToolsEnabledChange(!toolsEnabled)}
|
| 164 |
+
>
|
| 165 |
+
<ToolIcon /> Tools {toolsEnabled ? 'on' : 'off'}
|
| 166 |
+
</button>
|
| 167 |
+
<div className="tool-info">
|
| 168 |
+
<button type="button" aria-label="Show available tools" aria-describedby="tool-reference" title="Available tools"><InfoIcon /></button>
|
| 169 |
+
<div className="tool-popover" id="tool-reference" role="tooltip">
|
| 170 |
+
<header>
|
| 171 |
+
<strong>Available tools</strong>
|
| 172 |
+
<span>{TOOL_CATALOG.length} capabilities</span>
|
| 173 |
+
</header>
|
| 174 |
+
<ul>
|
| 175 |
+
{TOOL_CATALOG.map((tool) => (
|
| 176 |
+
<li key={tool.name}>
|
| 177 |
+
<div><code>{tool.name}</code><small>{tool.scope}</small></div>
|
| 178 |
+
<p>{tool.description}</p>
|
| 179 |
+
</li>
|
| 180 |
+
))}
|
| 181 |
+
</ul>
|
| 182 |
+
<footer>Inference and local tools stay in this browser. Network tools ask before sending a query.</footer>
|
| 183 |
+
</div>
|
| 184 |
+
</div>
|
| 185 |
+
</div>
|
| 186 |
<span>{runtimeStatus}</span>
|
| 187 |
</div>
|
| 188 |
<div className="composer-field">
|
|
|
|
| 349 |
);
|
| 350 |
}
|
| 351 |
|
| 352 |
+
function InfoIcon() {
|
| 353 |
+
return (
|
| 354 |
+
<svg viewBox="0 0 20 20" aria-hidden="true">
|
| 355 |
+
<circle cx="10" cy="10" r="7" />
|
| 356 |
+
<path d="M10 8.4v5M10 5.8h.01" />
|
| 357 |
+
</svg>
|
| 358 |
+
);
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
function CopyIcon() {
|
| 362 |
return (
|
| 363 |
<svg viewBox="0 0 20 20" aria-hidden="true">
|
src/app/styles.css
CHANGED
|
@@ -1467,6 +1467,12 @@ button:disabled {
|
|
| 1467 |
font: var(--type-utility)/1 var(--mono);
|
| 1468 |
}
|
| 1469 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1470 |
.tool-toggle {
|
| 1471 |
display: flex;
|
| 1472 |
align-items: center;
|
|
@@ -1491,6 +1497,130 @@ button:disabled {
|
|
| 1491 |
stroke-width: 1.3;
|
| 1492 |
}
|
| 1493 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1494 |
.composer-field {
|
| 1495 |
display: grid;
|
| 1496 |
grid-template-columns: 1fr auto;
|
|
@@ -2144,16 +2274,40 @@ button:disabled {
|
|
| 2144 |
box-shadow: inset 0 -2px 0 var(--shell-accent);
|
| 2145 |
}
|
| 2146 |
|
| 2147 |
-
.artifact-
|
| 2148 |
-
|
| 2149 |
-
|
|
|
|
|
|
|
|
|
|
| 2150 |
padding: 0 12px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2151 |
color: var(--canvas-muted);
|
| 2152 |
font: 600 var(--type-caption)/1.2 var(--body);
|
| 2153 |
text-overflow: ellipsis;
|
| 2154 |
white-space: nowrap;
|
| 2155 |
}
|
| 2156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2157 |
.artifact-fullscreen-button {
|
| 2158 |
width: 44px;
|
| 2159 |
height: 44px;
|
|
@@ -2241,6 +2395,73 @@ button:disabled {
|
|
| 2241 |
white-space: pre;
|
| 2242 |
}
|
| 2243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2244 |
@container model-rail (max-width: 220px) {
|
| 2245 |
.rail-heading p,
|
| 2246 |
.rail-footnote span:last-child,
|
|
@@ -2996,6 +3217,16 @@ button:disabled {
|
|
| 2996 |
display: none;
|
| 2997 |
}
|
| 2998 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2999 |
.composer-activity {
|
| 3000 |
padding-inline: 10px;
|
| 3001 |
}
|
|
|
|
| 1467 |
font: var(--type-utility)/1 var(--mono);
|
| 1468 |
}
|
| 1469 |
|
| 1470 |
+
.tool-controls {
|
| 1471 |
+
display: flex;
|
| 1472 |
+
align-items: center;
|
| 1473 |
+
gap: 3px;
|
| 1474 |
+
}
|
| 1475 |
+
|
| 1476 |
.tool-toggle {
|
| 1477 |
display: flex;
|
| 1478 |
align-items: center;
|
|
|
|
| 1497 |
stroke-width: 1.3;
|
| 1498 |
}
|
| 1499 |
|
| 1500 |
+
.tool-info {
|
| 1501 |
+
position: relative;
|
| 1502 |
+
}
|
| 1503 |
+
|
| 1504 |
+
.tool-info > button {
|
| 1505 |
+
width: 28px;
|
| 1506 |
+
height: 28px;
|
| 1507 |
+
display: grid;
|
| 1508 |
+
place-items: center;
|
| 1509 |
+
color: var(--canvas-muted);
|
| 1510 |
+
border: 0;
|
| 1511 |
+
border-radius: 50%;
|
| 1512 |
+
background: transparent;
|
| 1513 |
+
cursor: help;
|
| 1514 |
+
}
|
| 1515 |
+
|
| 1516 |
+
.tool-info > button:hover,
|
| 1517 |
+
.tool-info > button:focus-visible {
|
| 1518 |
+
color: var(--canvas-text);
|
| 1519 |
+
background: var(--canvas-field);
|
| 1520 |
+
}
|
| 1521 |
+
|
| 1522 |
+
.tool-info > button svg {
|
| 1523 |
+
width: 16px;
|
| 1524 |
+
height: 16px;
|
| 1525 |
+
fill: none;
|
| 1526 |
+
stroke: currentColor;
|
| 1527 |
+
stroke-linecap: round;
|
| 1528 |
+
stroke-width: 1.4;
|
| 1529 |
+
}
|
| 1530 |
+
|
| 1531 |
+
.tool-popover {
|
| 1532 |
+
width: min(470px, calc(100vw - 34px));
|
| 1533 |
+
max-height: min(560px, 70vh);
|
| 1534 |
+
display: none;
|
| 1535 |
+
position: absolute;
|
| 1536 |
+
z-index: 40;
|
| 1537 |
+
left: -4px;
|
| 1538 |
+
bottom: calc(100% + 8px);
|
| 1539 |
+
overflow: auto;
|
| 1540 |
+
color: var(--canvas-text);
|
| 1541 |
+
border: 1px solid var(--canvas-line);
|
| 1542 |
+
border-radius: 9px;
|
| 1543 |
+
background: var(--canvas-raised);
|
| 1544 |
+
box-shadow: 0 18px 50px rgba(17, 21, 18, 0.18);
|
| 1545 |
+
}
|
| 1546 |
+
|
| 1547 |
+
.tool-info:hover .tool-popover,
|
| 1548 |
+
.tool-info:focus-within .tool-popover {
|
| 1549 |
+
display: block;
|
| 1550 |
+
}
|
| 1551 |
+
|
| 1552 |
+
.tool-popover > header,
|
| 1553 |
+
.tool-popover > footer {
|
| 1554 |
+
display: flex;
|
| 1555 |
+
align-items: baseline;
|
| 1556 |
+
justify-content: space-between;
|
| 1557 |
+
gap: 12px;
|
| 1558 |
+
padding: 12px 14px;
|
| 1559 |
+
}
|
| 1560 |
+
|
| 1561 |
+
.tool-popover > header {
|
| 1562 |
+
border-bottom: 1px solid var(--canvas-line);
|
| 1563 |
+
}
|
| 1564 |
+
|
| 1565 |
+
.tool-popover > header strong {
|
| 1566 |
+
font: 650 var(--type-caption)/1.2 var(--body);
|
| 1567 |
+
}
|
| 1568 |
+
|
| 1569 |
+
.tool-popover > header span,
|
| 1570 |
+
.tool-popover > footer {
|
| 1571 |
+
color: var(--canvas-muted);
|
| 1572 |
+
font: var(--type-utility)/1.4 var(--mono);
|
| 1573 |
+
}
|
| 1574 |
+
|
| 1575 |
+
.tool-popover > footer {
|
| 1576 |
+
display: block;
|
| 1577 |
+
border-top: 1px solid var(--canvas-line);
|
| 1578 |
+
}
|
| 1579 |
+
|
| 1580 |
+
.tool-popover ul {
|
| 1581 |
+
margin: 0;
|
| 1582 |
+
padding: 0;
|
| 1583 |
+
list-style: none;
|
| 1584 |
+
}
|
| 1585 |
+
|
| 1586 |
+
.tool-popover li {
|
| 1587 |
+
display: grid;
|
| 1588 |
+
grid-template-columns: 150px minmax(0, 1fr);
|
| 1589 |
+
gap: 12px;
|
| 1590 |
+
padding: 10px 14px;
|
| 1591 |
+
border-bottom: 1px solid var(--canvas-line);
|
| 1592 |
+
}
|
| 1593 |
+
|
| 1594 |
+
.tool-popover li:last-child {
|
| 1595 |
+
border-bottom: 0;
|
| 1596 |
+
}
|
| 1597 |
+
|
| 1598 |
+
.tool-popover li > div {
|
| 1599 |
+
min-width: 0;
|
| 1600 |
+
display: flex;
|
| 1601 |
+
flex-direction: column;
|
| 1602 |
+
gap: 4px;
|
| 1603 |
+
}
|
| 1604 |
+
|
| 1605 |
+
.tool-popover code {
|
| 1606 |
+
overflow: hidden;
|
| 1607 |
+
color: var(--canvas-text);
|
| 1608 |
+
font: 650 var(--type-utility)/1.2 var(--mono);
|
| 1609 |
+
text-overflow: ellipsis;
|
| 1610 |
+
}
|
| 1611 |
+
|
| 1612 |
+
.tool-popover small {
|
| 1613 |
+
color: var(--canvas-muted);
|
| 1614 |
+
font: var(--type-utility)/1 var(--mono);
|
| 1615 |
+
text-transform: uppercase;
|
| 1616 |
+
}
|
| 1617 |
+
|
| 1618 |
+
.tool-popover li p {
|
| 1619 |
+
margin: 0;
|
| 1620 |
+
color: var(--canvas-muted);
|
| 1621 |
+
font: var(--type-utility)/1.45 var(--body);
|
| 1622 |
+
}
|
| 1623 |
+
|
| 1624 |
.composer-field {
|
| 1625 |
display: grid;
|
| 1626 |
grid-template-columns: 1fr auto;
|
|
|
|
| 2274 |
box-shadow: inset 0 -2px 0 var(--shell-accent);
|
| 2275 |
}
|
| 2276 |
|
| 2277 |
+
.artifact-title-block {
|
| 2278 |
+
min-width: 0;
|
| 2279 |
+
display: flex;
|
| 2280 |
+
align-items: center;
|
| 2281 |
+
justify-content: space-between;
|
| 2282 |
+
gap: 10px;
|
| 2283 |
padding: 0 12px;
|
| 2284 |
+
}
|
| 2285 |
+
|
| 2286 |
+
.artifact-title-block > strong {
|
| 2287 |
+
min-width: 0;
|
| 2288 |
+
overflow: hidden;
|
| 2289 |
color: var(--canvas-muted);
|
| 2290 |
font: 600 var(--type-caption)/1.2 var(--body);
|
| 2291 |
text-overflow: ellipsis;
|
| 2292 |
white-space: nowrap;
|
| 2293 |
}
|
| 2294 |
|
| 2295 |
+
.artifact-test-status {
|
| 2296 |
+
flex: 0 0 auto;
|
| 2297 |
+
color: var(--canvas-muted);
|
| 2298 |
+
font: 650 var(--type-utility)/1 var(--mono);
|
| 2299 |
+
white-space: nowrap;
|
| 2300 |
+
}
|
| 2301 |
+
|
| 2302 |
+
.artifact-test-status.is-passed {
|
| 2303 |
+
color: var(--moss);
|
| 2304 |
+
}
|
| 2305 |
+
|
| 2306 |
+
.artifact-test-status.is-failed,
|
| 2307 |
+
.artifact-test-status.is-timeout {
|
| 2308 |
+
color: var(--rust);
|
| 2309 |
+
}
|
| 2310 |
+
|
| 2311 |
.artifact-fullscreen-button {
|
| 2312 |
width: 44px;
|
| 2313 |
height: 44px;
|
|
|
|
| 2395 |
white-space: pre;
|
| 2396 |
}
|
| 2397 |
|
| 2398 |
+
.artifact-console {
|
| 2399 |
+
color: var(--canvas-text);
|
| 2400 |
+
border-top: 1px solid var(--canvas-line);
|
| 2401 |
+
background: var(--canvas-raised);
|
| 2402 |
+
}
|
| 2403 |
+
|
| 2404 |
+
.artifact-console summary {
|
| 2405 |
+
min-height: 36px;
|
| 2406 |
+
display: flex;
|
| 2407 |
+
align-items: center;
|
| 2408 |
+
justify-content: space-between;
|
| 2409 |
+
gap: 12px;
|
| 2410 |
+
padding: 0 12px;
|
| 2411 |
+
font: 650 var(--type-utility)/1 var(--mono);
|
| 2412 |
+
cursor: pointer;
|
| 2413 |
+
}
|
| 2414 |
+
|
| 2415 |
+
.artifact-console summary > span {
|
| 2416 |
+
color: var(--canvas-muted);
|
| 2417 |
+
font-weight: 500;
|
| 2418 |
+
}
|
| 2419 |
+
|
| 2420 |
+
.artifact-console ol {
|
| 2421 |
+
max-height: 210px;
|
| 2422 |
+
overflow: auto;
|
| 2423 |
+
margin: 0;
|
| 2424 |
+
padding: 0;
|
| 2425 |
+
list-style: none;
|
| 2426 |
+
border-top: 1px solid var(--canvas-line);
|
| 2427 |
+
}
|
| 2428 |
+
|
| 2429 |
+
.artifact-console li {
|
| 2430 |
+
display: grid;
|
| 2431 |
+
grid-template-columns: 48px minmax(0, 1fr) auto;
|
| 2432 |
+
gap: 9px;
|
| 2433 |
+
padding: 8px 12px;
|
| 2434 |
+
border-bottom: 1px solid var(--canvas-line);
|
| 2435 |
+
font: var(--type-utility)/1.4 var(--mono);
|
| 2436 |
+
}
|
| 2437 |
+
|
| 2438 |
+
.artifact-console li:last-child {
|
| 2439 |
+
border-bottom: 0;
|
| 2440 |
+
}
|
| 2441 |
+
|
| 2442 |
+
.artifact-console li b {
|
| 2443 |
+
color: var(--canvas-muted);
|
| 2444 |
+
text-transform: uppercase;
|
| 2445 |
+
}
|
| 2446 |
+
|
| 2447 |
+
.artifact-console li.is-error b {
|
| 2448 |
+
color: var(--rust);
|
| 2449 |
+
}
|
| 2450 |
+
|
| 2451 |
+
.artifact-console li.is-warn b {
|
| 2452 |
+
color: #9a611d;
|
| 2453 |
+
}
|
| 2454 |
+
|
| 2455 |
+
.artifact-console li code {
|
| 2456 |
+
overflow-wrap: anywhere;
|
| 2457 |
+
white-space: pre-wrap;
|
| 2458 |
+
}
|
| 2459 |
+
|
| 2460 |
+
.artifact-console li small {
|
| 2461 |
+
color: var(--canvas-muted);
|
| 2462 |
+
white-space: nowrap;
|
| 2463 |
+
}
|
| 2464 |
+
|
| 2465 |
@container model-rail (max-width: 220px) {
|
| 2466 |
.rail-heading p,
|
| 2467 |
.rail-footnote span:last-child,
|
|
|
|
| 3217 |
display: none;
|
| 3218 |
}
|
| 3219 |
|
| 3220 |
+
.tool-popover li {
|
| 3221 |
+
grid-template-columns: minmax(0, 1fr);
|
| 3222 |
+
gap: 5px;
|
| 3223 |
+
}
|
| 3224 |
+
|
| 3225 |
+
.tool-popover li > div {
|
| 3226 |
+
flex-direction: row;
|
| 3227 |
+
justify-content: space-between;
|
| 3228 |
+
}
|
| 3229 |
+
|
| 3230 |
.composer-activity {
|
| 3231 |
padding-inline: 10px;
|
| 3232 |
}
|
src/lib/agent-tools.test.ts
CHANGED
|
@@ -6,12 +6,13 @@ describe('prepareHtmlArtifact', () => {
|
|
| 6 |
const source = '<html><head><title>x</title></head><body><script>document.body.dataset.ok="1"</script></body></html>';
|
| 7 |
const artifact = prepareHtmlArtifact(source, 'Demo', 'artifact-1');
|
| 8 |
expect(artifact.source).toBe(source);
|
| 9 |
-
expect(artifact.sandboxedSource).toMatch(/^<
|
| 10 |
-
expect(artifact.sandboxedSource.indexOf('Content-Security-Policy')).toBeLessThan(artifact.sandboxedSource.indexOf(
|
| 11 |
expect(artifact.sandboxedSource).toContain("default-src 'none'");
|
| 12 |
expect(artifact.sandboxedSource).toContain("connect-src 'none'");
|
| 13 |
-
expect(artifact.sandboxedSource).toContain("script-src '
|
| 14 |
-
expect(artifact.sandboxedSource).
|
|
|
|
| 15 |
expect(artifact.title).toBe('Demo');
|
| 16 |
});
|
| 17 |
|
|
@@ -20,4 +21,13 @@ describe('prepareHtmlArtifact', () => {
|
|
| 20 |
'exceeds 256 KiB',
|
| 21 |
);
|
| 22 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
});
|
|
|
|
| 6 |
const source = '<html><head><title>x</title></head><body><script>document.body.dataset.ok="1"</script></body></html>';
|
| 7 |
const artifact = prepareHtmlArtifact(source, 'Demo', 'artifact-1');
|
| 8 |
expect(artifact.source).toBe(source);
|
| 9 |
+
expect(artifact.sandboxedSource).toMatch(/^<meta http-equiv="Content-Security-Policy"/);
|
| 10 |
+
expect(artifact.sandboxedSource.indexOf('Content-Security-Policy')).toBeLessThan(artifact.sandboxedSource.indexOf('document.body.dataset.ok'));
|
| 11 |
expect(artifact.sandboxedSource).toContain("default-src 'none'");
|
| 12 |
expect(artifact.sandboxedSource).toContain("connect-src 'none'");
|
| 13 |
+
expect(artifact.sandboxedSource).toContain("script-src 'unsafe-inline'");
|
| 14 |
+
expect(artifact.sandboxedSource).toContain('data-bonsai-artifact-runtime');
|
| 15 |
+
expect(artifact.runtimeToken).toBeTruthy();
|
| 16 |
expect(artifact.title).toBe('Demo');
|
| 17 |
});
|
| 18 |
|
|
|
|
| 21 |
'exceeds 256 KiB',
|
| 22 |
);
|
| 23 |
});
|
| 24 |
+
|
| 25 |
+
it('rejects direct document navigation while keeping ordinary inline scripts available', () => {
|
| 26 |
+
expect(() => prepareHtmlArtifact('<script>location.href="https://example.com"</script>'))
|
| 27 |
+
.toThrow('cannot navigate');
|
| 28 |
+
expect(() => prepareHtmlArtifact('<meta http-equiv="refresh" content="0;url=https://example.com">'))
|
| 29 |
+
.toThrow('navigation or refresh');
|
| 30 |
+
expect(() => prepareHtmlArtifact('<script>document.body.textContent = "ok"</script>'))
|
| 31 |
+
.not.toThrow();
|
| 32 |
+
});
|
| 33 |
});
|
src/lib/agent-tools.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
| 1 |
import type { EngineChatTool, EngineChatToolCall } from '../engine';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import { deleteMemory, getMemory, listMemory, putMemory } from './idb';
|
| 3 |
import { runJavaScript } from './js-sandbox';
|
|
|
|
| 4 |
|
| 5 |
-
export
|
| 6 |
-
|
| 7 |
-
title: string;
|
| 8 |
-
source: string;
|
| 9 |
-
sandboxedSource: string;
|
| 10 |
-
createdAt: number;
|
| 11 |
-
}
|
| 12 |
|
| 13 |
export interface ToolExecution {
|
| 14 |
call: EngineChatToolCall;
|
|
@@ -17,30 +21,40 @@ export interface ToolExecution {
|
|
| 17 |
failed: boolean;
|
| 18 |
}
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
const MAX_TOOL_RESULT_CHARACTERS = 64 * 1024;
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
]
|
| 34 |
|
| 35 |
export const HTML_ARTIFACT_TOOL: EngineChatTool = {
|
| 36 |
type: 'function',
|
| 37 |
function: {
|
| 38 |
name: 'html_artifact',
|
| 39 |
-
description: 'Create a self-contained HTML/CSS artifact
|
| 40 |
parameters: {
|
| 41 |
type: 'object',
|
| 42 |
properties: {
|
| 43 |
-
html: { type: 'string', description: 'Complete
|
| 44 |
title: { type: 'string', description: 'Short artifact title.' },
|
| 45 |
},
|
| 46 |
required: ['html'],
|
|
@@ -51,11 +65,94 @@ export const HTML_ARTIFACT_TOOL: EngineChatTool = {
|
|
| 51 |
|
| 52 |
export const AGENT_TOOLS: EngineChatTool[] = [
|
| 53 |
HTML_ARTIFACT_TOOL,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
{
|
| 55 |
type: 'function',
|
| 56 |
function: {
|
| 57 |
name: 'js_eval',
|
| 58 |
-
description: 'Evaluate deterministic JavaScript in a disposable worker with no network or browser storage.
|
| 59 |
parameters: {
|
| 60 |
type: 'object',
|
| 61 |
properties: {
|
|
@@ -70,7 +167,7 @@ export const AGENT_TOOLS: EngineChatTool[] = [
|
|
| 70 |
type: 'function',
|
| 71 |
function: {
|
| 72 |
name: 'memory',
|
| 73 |
-
description: 'Store, retrieve, list, or delete small user-approved notes in this browser profile.',
|
| 74 |
parameters: {
|
| 75 |
type: 'object',
|
| 76 |
properties: {
|
|
@@ -83,6 +180,23 @@ export const AGENT_TOOLS: EngineChatTool[] = [
|
|
| 83 |
},
|
| 84 |
},
|
| 85 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
];
|
| 87 |
|
| 88 |
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
@@ -94,6 +208,16 @@ function requiredString(value: unknown, field: string): string {
|
|
| 94 |
return value;
|
| 95 |
}
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
function parseArguments(call: EngineChatToolCall): Record<string, unknown> {
|
| 98 |
const parsed: unknown = JSON.parse(call.function.arguments);
|
| 99 |
if (!isRecord(parsed)) throw new Error('tool arguments must be a JSON object');
|
|
@@ -110,27 +234,31 @@ function boundedJson(value: unknown): string {
|
|
| 110 |
});
|
| 111 |
}
|
| 112 |
|
| 113 |
-
function
|
| 114 |
-
|
| 115 |
-
return `<!doctype html><html><head>${meta}</head><body>${html}</body></html>`;
|
| 116 |
-
}
|
| 117 |
-
|
| 118 |
-
export function prepareHtmlArtifact(
|
| 119 |
-
html: string,
|
| 120 |
-
title = 'Untitled artifact',
|
| 121 |
-
id: string = crypto.randomUUID(),
|
| 122 |
-
): ArtifactDocument {
|
| 123 |
-
const bytes = new TextEncoder().encode(html).byteLength;
|
| 124 |
-
if (bytes > MAX_ARTIFACT_BYTES) throw new Error('html_artifact source exceeds 256 KiB');
|
| 125 |
return {
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
|
|
|
|
|
|
| 131 |
};
|
| 132 |
}
|
| 133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
async function executeMemory(args: Record<string, unknown>): Promise<unknown> {
|
| 135 |
const action = requiredString(args.action, 'memory.action');
|
| 136 |
if (action === 'list') {
|
|
@@ -151,9 +279,7 @@ async function executeMemory(args: Record<string, unknown>): Promise<unknown> {
|
|
| 151 |
}
|
| 152 |
return { action, record: await putMemory(key, value) };
|
| 153 |
}
|
| 154 |
-
if (action === 'get') {
|
| 155 |
-
return { action, record: await getMemory(key) ?? null };
|
| 156 |
-
}
|
| 157 |
if (action === 'delete') {
|
| 158 |
if (!window.confirm(`Allow Bonsai to delete the local memory note “${key}”?`)) {
|
| 159 |
throw new Error('operator declined memory deletion');
|
|
@@ -164,20 +290,113 @@ async function executeMemory(args: Record<string, unknown>): Promise<unknown> {
|
|
| 164 |
throw new Error(`unsupported memory action: ${action}`);
|
| 165 |
}
|
| 166 |
|
| 167 |
-
export async function executeAgentTool(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
try {
|
| 169 |
if (signal?.aborted) throw new DOMException('The tool operation was aborted.', 'AbortError');
|
| 170 |
const args = parseArguments(call);
|
| 171 |
if (call.function.name === 'html_artifact') {
|
| 172 |
-
const artifact =
|
| 173 |
requiredString(args.html, 'html_artifact.html'),
|
| 174 |
-
typeof args.title === 'string' ? args.title :
|
| 175 |
call.id,
|
|
|
|
| 176 |
);
|
|
|
|
| 177 |
return {
|
| 178 |
call,
|
| 179 |
artifact,
|
| 180 |
-
output: boundedJson({ ok: true, artifactId: artifact.id, title: artifact.title, bytes: artifact.source.length }),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
failed: false,
|
| 182 |
};
|
| 183 |
}
|
|
@@ -190,6 +409,19 @@ export async function executeAgentTool(call: EngineChatToolCall, signal?: AbortS
|
|
| 190 |
if (signal?.aborted) throw new DOMException('The tool operation was aborted.', 'AbortError');
|
| 191 |
return { call, output: boundedJson({ ok: true, ...(result as object) }), failed: false };
|
| 192 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
throw new Error(`unsupported tool: ${call.function.name}`);
|
| 194 |
} catch (error) {
|
| 195 |
const message = error instanceof Error ? error.message : String(error);
|
|
|
|
| 1 |
import type { EngineChatTool, EngineChatToolCall } from '../engine';
|
| 2 |
+
import {
|
| 3 |
+
evaluateHtmlArtifact,
|
| 4 |
+
getArtifactDiagnostics,
|
| 5 |
+
prepareHtmlArtifact,
|
| 6 |
+
type ArtifactDocument,
|
| 7 |
+
type ArtifactEvaluation,
|
| 8 |
+
} from './artifact-runtime';
|
| 9 |
+
import { generateBarChartHtml, generatePieChartHtml } from './chart-tools';
|
| 10 |
import { deleteMemory, getMemory, listMemory, putMemory } from './idb';
|
| 11 |
import { runJavaScript } from './js-sandbox';
|
| 12 |
+
import { searchWikipedia } from './web-search';
|
| 13 |
|
| 14 |
+
export type { ArtifactDocument, ArtifactEvaluation } from './artifact-runtime';
|
| 15 |
+
export { prepareHtmlArtifact } from './artifact-runtime';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
export interface ToolExecution {
|
| 18 |
call: EngineChatToolCall;
|
|
|
|
| 21 |
failed: boolean;
|
| 22 |
}
|
| 23 |
|
| 24 |
+
export interface AgentToolContext {
|
| 25 |
+
artifacts: Map<string, ArtifactDocument>;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
export interface ToolCatalogEntry {
|
| 29 |
+
name: string;
|
| 30 |
+
label: string;
|
| 31 |
+
description: string;
|
| 32 |
+
scope: 'local' | 'network';
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
const MAX_TOOL_RESULT_CHARACTERS = 64 * 1024;
|
| 36 |
+
|
| 37 |
+
export const TOOL_CATALOG: ToolCatalogEntry[] = [
|
| 38 |
+
{ name: 'html_artifact', label: 'HTML artifact', description: 'Build and test any programmatic interface or visualization.', scope: 'local' },
|
| 39 |
+
{ name: 'artifact_update', label: 'Update artifact', description: 'Replace an existing artifact in place and rerun it.', scope: 'local' },
|
| 40 |
+
{ name: 'artifact_test', label: 'Test artifact', description: 'Rerun an artifact and collect console and DOM diagnostics.', scope: 'local' },
|
| 41 |
+
{ name: 'artifact_inspect', label: 'Inspect artifacts', description: 'List artifacts or read source and the latest live errors.', scope: 'local' },
|
| 42 |
+
{ name: 'bar_chart', label: 'Bar chart', description: 'Turn labelled numeric data into an accessible bar-chart artifact.', scope: 'local' },
|
| 43 |
+
{ name: 'pie_chart', label: 'Pie chart', description: 'Turn parts of a whole into an accessible pie-chart artifact.', scope: 'local' },
|
| 44 |
+
{ name: 'js_eval', label: 'JavaScript eval', description: 'Run deterministic calculations in a disposable worker.', scope: 'local' },
|
| 45 |
+
{ name: 'memory', label: 'Local memory', description: 'Store and retrieve user-approved notes in this browser.', scope: 'local' },
|
| 46 |
+
{ name: 'web_search', label: 'Web search · Wikipedia', description: 'Search Wikipedia after confirmation; the query leaves this browser.', scope: 'network' },
|
| 47 |
+
];
|
| 48 |
|
| 49 |
export const HTML_ARTIFACT_TOOL: EngineChatTool = {
|
| 50 |
type: 'function',
|
| 51 |
function: {
|
| 52 |
name: 'html_artifact',
|
| 53 |
+
description: 'Create and immediately test a self-contained HTML/CSS/JavaScript artifact. Use for any programmatic visualization, interactive UI, webpage, mini-app, diagram, or custom visual output. The artifact runs in an opaque-origin sandbox: external resources and browser storage are blocked, navigation primitives are rejected, and console plus DOM diagnostics are returned.',
|
| 54 |
parameters: {
|
| 55 |
type: 'object',
|
| 56 |
properties: {
|
| 57 |
+
html: { type: 'string', description: 'Complete self-contained HTML, CSS, and optional inline JavaScript.' },
|
| 58 |
title: { type: 'string', description: 'Short artifact title.' },
|
| 59 |
},
|
| 60 |
required: ['html'],
|
|
|
|
| 65 |
|
| 66 |
export const AGENT_TOOLS: EngineChatTool[] = [
|
| 67 |
HTML_ARTIFACT_TOOL,
|
| 68 |
+
{
|
| 69 |
+
type: 'function',
|
| 70 |
+
function: {
|
| 71 |
+
name: 'artifact_update',
|
| 72 |
+
description: 'Replace the complete source of an existing artifact by artifact_id, rerender the same inline block live, and return fresh diagnostics. Use after html_artifact or artifact_test reports an error, or when the user requests a revision.',
|
| 73 |
+
parameters: {
|
| 74 |
+
type: 'object',
|
| 75 |
+
properties: {
|
| 76 |
+
artifact_id: { type: 'string', description: 'Stable ID returned by an artifact tool.' },
|
| 77 |
+
html: { type: 'string', description: 'Complete replacement HTML, CSS, and optional inline JavaScript.' },
|
| 78 |
+
title: { type: 'string', description: 'Optional replacement title.' },
|
| 79 |
+
},
|
| 80 |
+
required: ['artifact_id', 'html'],
|
| 81 |
+
additionalProperties: false,
|
| 82 |
+
},
|
| 83 |
+
},
|
| 84 |
+
},
|
| 85 |
+
{
|
| 86 |
+
type: 'function',
|
| 87 |
+
function: {
|
| 88 |
+
name: 'artifact_test',
|
| 89 |
+
description: 'Rerun an existing artifact by ID without changing its source. Use to reproduce current console errors, unhandled rejections, and basic DOM output before or after a repair.',
|
| 90 |
+
parameters: {
|
| 91 |
+
type: 'object',
|
| 92 |
+
properties: {
|
| 93 |
+
artifact_id: { type: 'string', description: 'Stable artifact ID.' },
|
| 94 |
+
},
|
| 95 |
+
required: ['artifact_id'],
|
| 96 |
+
additionalProperties: false,
|
| 97 |
+
},
|
| 98 |
+
},
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
type: 'function',
|
| 102 |
+
function: {
|
| 103 |
+
name: 'artifact_inspect',
|
| 104 |
+
description: 'List identifiable artifacts, or inspect one artifact and its latest live console diagnostics. Use before updating an older artifact or when the user asks what failed. Set include_source only when the source is needed for a rewrite.',
|
| 105 |
+
parameters: {
|
| 106 |
+
type: 'object',
|
| 107 |
+
properties: {
|
| 108 |
+
artifact_id: { type: 'string', description: 'Artifact ID. Omit to list all artifacts.' },
|
| 109 |
+
include_source: { type: 'boolean', description: 'Include the complete current HTML source.' },
|
| 110 |
+
},
|
| 111 |
+
additionalProperties: false,
|
| 112 |
+
},
|
| 113 |
+
},
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
type: 'function',
|
| 117 |
+
function: {
|
| 118 |
+
name: 'bar_chart',
|
| 119 |
+
description: 'Create and test an accessible bar-chart artifact from labelled non-negative values. Use for comparing magnitudes across categories; use html_artifact for bespoke or interactive visualizations.',
|
| 120 |
+
parameters: {
|
| 121 |
+
type: 'object',
|
| 122 |
+
properties: {
|
| 123 |
+
title: { type: 'string', description: 'Chart title.' },
|
| 124 |
+
labels: { type: 'array', description: 'Category labels.', items: { type: 'string' }, minItems: 1, maxItems: 32 },
|
| 125 |
+
values: { type: 'array', description: 'Non-negative numeric values aligned with labels.', items: { type: 'number', minimum: 0 }, minItems: 1, maxItems: 32 },
|
| 126 |
+
colors: { type: 'array', description: 'Optional #RRGGBB colors aligned with labels.', items: { type: 'string' } },
|
| 127 |
+
},
|
| 128 |
+
required: ['title', 'labels', 'values'],
|
| 129 |
+
additionalProperties: false,
|
| 130 |
+
},
|
| 131 |
+
},
|
| 132 |
+
},
|
| 133 |
+
{
|
| 134 |
+
type: 'function',
|
| 135 |
+
function: {
|
| 136 |
+
name: 'pie_chart',
|
| 137 |
+
description: 'Create and test an accessible pie-chart artifact from labelled non-negative parts. Use only for parts of one positive total; prefer bar_chart for precise comparison.',
|
| 138 |
+
parameters: {
|
| 139 |
+
type: 'object',
|
| 140 |
+
properties: {
|
| 141 |
+
title: { type: 'string', description: 'Chart title.' },
|
| 142 |
+
labels: { type: 'array', description: 'Slice labels.', items: { type: 'string' }, minItems: 1, maxItems: 32 },
|
| 143 |
+
values: { type: 'array', description: 'Non-negative slice values aligned with labels.', items: { type: 'number', minimum: 0 }, minItems: 1, maxItems: 32 },
|
| 144 |
+
colors: { type: 'array', description: 'Optional #RRGGBB colors aligned with labels.', items: { type: 'string' } },
|
| 145 |
+
},
|
| 146 |
+
required: ['title', 'labels', 'values'],
|
| 147 |
+
additionalProperties: false,
|
| 148 |
+
},
|
| 149 |
+
},
|
| 150 |
+
},
|
| 151 |
{
|
| 152 |
type: 'function',
|
| 153 |
function: {
|
| 154 |
name: 'js_eval',
|
| 155 |
+
description: 'Evaluate deterministic JavaScript in a disposable worker with no network, DOM, or browser storage. Use for calculations, parsing, transformations, and verification that are awkward to do mentally; return the result explicitly.',
|
| 156 |
parameters: {
|
| 157 |
type: 'object',
|
| 158 |
properties: {
|
|
|
|
| 167 |
type: 'function',
|
| 168 |
function: {
|
| 169 |
name: 'memory',
|
| 170 |
+
description: 'Store, retrieve, list, or delete small user-approved notes in this browser profile. Use only for durable user preferences or facts that the user asks to remember; writes and deletes require confirmation.',
|
| 171 |
parameters: {
|
| 172 |
type: 'object',
|
| 173 |
properties: {
|
|
|
|
| 180 |
},
|
| 181 |
},
|
| 182 |
},
|
| 183 |
+
{
|
| 184 |
+
type: 'function',
|
| 185 |
+
function: {
|
| 186 |
+
name: 'web_search',
|
| 187 |
+
description: 'Search the public Wikipedia knowledge index after operator confirmation. Use for factual background or references that may benefit from retrieval. This first provider is not a general web crawler and should not be described as exhaustive or real-time web coverage.',
|
| 188 |
+
parameters: {
|
| 189 |
+
type: 'object',
|
| 190 |
+
properties: {
|
| 191 |
+
query: { type: 'string', description: 'Concise search query sent to Wikipedia after confirmation.' },
|
| 192 |
+
language: { type: 'string', enum: ['en', 'ru'], description: 'Wikipedia language; inferred from the query when omitted.' },
|
| 193 |
+
limit: { type: 'number', description: 'Number of results from 1 to 8.' },
|
| 194 |
+
},
|
| 195 |
+
required: ['query'],
|
| 196 |
+
additionalProperties: false,
|
| 197 |
+
},
|
| 198 |
+
},
|
| 199 |
+
},
|
| 200 |
];
|
| 201 |
|
| 202 |
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
|
|
| 208 |
return value;
|
| 209 |
}
|
| 210 |
|
| 211 |
+
function stringArray(value: unknown, field: string): string[] {
|
| 212 |
+
if (!Array.isArray(value)) throw new Error(`${field} must be an array`);
|
| 213 |
+
return value.map((item) => String(item));
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
function numberArray(value: unknown, field: string): number[] {
|
| 217 |
+
if (!Array.isArray(value)) throw new Error(`${field} must be an array`);
|
| 218 |
+
return value.map((item) => Number(item));
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
function parseArguments(call: EngineChatToolCall): Record<string, unknown> {
|
| 222 |
const parsed: unknown = JSON.parse(call.function.arguments);
|
| 223 |
if (!isRecord(parsed)) throw new Error('tool arguments must be a JSON object');
|
|
|
|
| 234 |
});
|
| 235 |
}
|
| 236 |
|
| 237 |
+
function evaluationResult(evaluation: ArtifactEvaluation | undefined) {
|
| 238 |
+
if (!evaluation) return null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
return {
|
| 240 |
+
status: evaluation.status,
|
| 241 |
+
errors: evaluation.entries.filter((entry) => entry.level === 'error'),
|
| 242 |
+
warnings: evaluation.entries.filter((entry) => entry.level === 'warn'),
|
| 243 |
+
console: evaluation.entries,
|
| 244 |
+
dom: evaluation.dom ?? null,
|
| 245 |
+
durationMs: Math.round(evaluation.durationMs),
|
| 246 |
+
testedAt: evaluation.testedAt,
|
| 247 |
};
|
| 248 |
}
|
| 249 |
|
| 250 |
+
async function testedArtifact(
|
| 251 |
+
source: string,
|
| 252 |
+
title: string,
|
| 253 |
+
id: string,
|
| 254 |
+
signal: AbortSignal | undefined,
|
| 255 |
+
createdAt?: number,
|
| 256 |
+
): Promise<ArtifactDocument> {
|
| 257 |
+
const prepared = prepareHtmlArtifact(source, title, id);
|
| 258 |
+
const evaluation = await evaluateHtmlArtifact(prepared, 2500, signal);
|
| 259 |
+
return { ...prepared, ...(createdAt ? { createdAt } : {}), evaluation };
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
async function executeMemory(args: Record<string, unknown>): Promise<unknown> {
|
| 263 |
const action = requiredString(args.action, 'memory.action');
|
| 264 |
if (action === 'list') {
|
|
|
|
| 279 |
}
|
| 280 |
return { action, record: await putMemory(key, value) };
|
| 281 |
}
|
| 282 |
+
if (action === 'get') return { action, record: await getMemory(key) ?? null };
|
|
|
|
|
|
|
| 283 |
if (action === 'delete') {
|
| 284 |
if (!window.confirm(`Allow Bonsai to delete the local memory note “${key}”?`)) {
|
| 285 |
throw new Error('operator declined memory deletion');
|
|
|
|
| 290 |
throw new Error(`unsupported memory action: ${action}`);
|
| 291 |
}
|
| 292 |
|
| 293 |
+
export async function executeAgentTool(
|
| 294 |
+
call: EngineChatToolCall,
|
| 295 |
+
signal?: AbortSignal,
|
| 296 |
+
context: AgentToolContext = { artifacts: new Map() },
|
| 297 |
+
): Promise<ToolExecution> {
|
| 298 |
try {
|
| 299 |
if (signal?.aborted) throw new DOMException('The tool operation was aborted.', 'AbortError');
|
| 300 |
const args = parseArguments(call);
|
| 301 |
if (call.function.name === 'html_artifact') {
|
| 302 |
+
const artifact = await testedArtifact(
|
| 303 |
requiredString(args.html, 'html_artifact.html'),
|
| 304 |
+
typeof args.title === 'string' ? args.title : 'Untitled artifact',
|
| 305 |
call.id,
|
| 306 |
+
signal,
|
| 307 |
);
|
| 308 |
+
context.artifacts.set(artifact.id, artifact);
|
| 309 |
return {
|
| 310 |
call,
|
| 311 |
artifact,
|
| 312 |
+
output: boundedJson({ ok: true, artifactId: artifact.id, title: artifact.title, bytes: artifact.source.length, evaluation: evaluationResult(artifact.evaluation) }),
|
| 313 |
+
failed: false,
|
| 314 |
+
};
|
| 315 |
+
}
|
| 316 |
+
if (call.function.name === 'artifact_update') {
|
| 317 |
+
const artifactId = requiredString(args.artifact_id, 'artifact_update.artifact_id');
|
| 318 |
+
const current = context.artifacts.get(artifactId);
|
| 319 |
+
if (!current) throw new Error(`artifact ${artifactId} is not available in this chat`);
|
| 320 |
+
const artifact = await testedArtifact(
|
| 321 |
+
requiredString(args.html, 'artifact_update.html'),
|
| 322 |
+
typeof args.title === 'string' ? args.title : current.title,
|
| 323 |
+
current.id,
|
| 324 |
+
signal,
|
| 325 |
+
current.createdAt,
|
| 326 |
+
);
|
| 327 |
+
context.artifacts.set(artifact.id, artifact);
|
| 328 |
+
return {
|
| 329 |
+
call,
|
| 330 |
+
artifact,
|
| 331 |
+
output: boundedJson({ ok: true, artifactId: artifact.id, title: artifact.title, updated: true, bytes: artifact.source.length, evaluation: evaluationResult(artifact.evaluation) }),
|
| 332 |
+
failed: false,
|
| 333 |
+
};
|
| 334 |
+
}
|
| 335 |
+
if (call.function.name === 'artifact_test') {
|
| 336 |
+
const artifactId = requiredString(args.artifact_id, 'artifact_test.artifact_id');
|
| 337 |
+
const current = context.artifacts.get(artifactId);
|
| 338 |
+
if (!current) throw new Error(`artifact ${artifactId} is not available in this chat`);
|
| 339 |
+
const evaluation = await evaluateHtmlArtifact(current, 2500, signal);
|
| 340 |
+
const artifact = { ...current, evaluation };
|
| 341 |
+
context.artifacts.set(artifact.id, artifact);
|
| 342 |
+
return {
|
| 343 |
+
call,
|
| 344 |
+
artifact,
|
| 345 |
+
output: boundedJson({ ok: true, artifactId, evaluation: evaluationResult(evaluation) }),
|
| 346 |
+
failed: false,
|
| 347 |
+
};
|
| 348 |
+
}
|
| 349 |
+
if (call.function.name === 'artifact_inspect') {
|
| 350 |
+
const artifactId = typeof args.artifact_id === 'string' ? args.artifact_id.trim() : '';
|
| 351 |
+
if (!artifactId) {
|
| 352 |
+
return {
|
| 353 |
+
call,
|
| 354 |
+
output: boundedJson({
|
| 355 |
+
ok: true,
|
| 356 |
+
artifacts: [...context.artifacts.values()].map((artifact) => ({
|
| 357 |
+
id: artifact.id,
|
| 358 |
+
title: artifact.title,
|
| 359 |
+
bytes: artifact.source.length,
|
| 360 |
+
evaluation: evaluationResult(getArtifactDiagnostics(artifact)),
|
| 361 |
+
})),
|
| 362 |
+
}),
|
| 363 |
+
failed: false,
|
| 364 |
+
};
|
| 365 |
+
}
|
| 366 |
+
const artifact = context.artifacts.get(artifactId);
|
| 367 |
+
if (!artifact) throw new Error(`artifact ${artifactId} is not available in this chat`);
|
| 368 |
+
return {
|
| 369 |
+
call,
|
| 370 |
+
output: boundedJson({
|
| 371 |
+
ok: true,
|
| 372 |
+
artifact: {
|
| 373 |
+
id: artifact.id,
|
| 374 |
+
title: artifact.title,
|
| 375 |
+
bytes: artifact.source.length,
|
| 376 |
+
evaluation: evaluationResult(getArtifactDiagnostics(artifact)),
|
| 377 |
+
...(args.include_source === true ? { source: artifact.source } : {}),
|
| 378 |
+
},
|
| 379 |
+
}),
|
| 380 |
+
failed: false,
|
| 381 |
+
};
|
| 382 |
+
}
|
| 383 |
+
if (call.function.name === 'bar_chart' || call.function.name === 'pie_chart') {
|
| 384 |
+
const title = requiredString(args.title, `${call.function.name}.title`);
|
| 385 |
+
const input = {
|
| 386 |
+
title,
|
| 387 |
+
labels: stringArray(args.labels, `${call.function.name}.labels`),
|
| 388 |
+
values: numberArray(args.values, `${call.function.name}.values`),
|
| 389 |
+
...(Array.isArray(args.colors) ? { colors: stringArray(args.colors, `${call.function.name}.colors`) } : {}),
|
| 390 |
+
};
|
| 391 |
+
const source = call.function.name === 'bar_chart'
|
| 392 |
+
? generateBarChartHtml(input)
|
| 393 |
+
: generatePieChartHtml(input);
|
| 394 |
+
const artifact = await testedArtifact(source, title, call.id, signal);
|
| 395 |
+
context.artifacts.set(artifact.id, artifact);
|
| 396 |
+
return {
|
| 397 |
+
call,
|
| 398 |
+
artifact,
|
| 399 |
+
output: boundedJson({ ok: true, artifactId: artifact.id, title, chart: call.function.name, evaluation: evaluationResult(artifact.evaluation) }),
|
| 400 |
failed: false,
|
| 401 |
};
|
| 402 |
}
|
|
|
|
| 409 |
if (signal?.aborted) throw new DOMException('The tool operation was aborted.', 'AbortError');
|
| 410 |
return { call, output: boundedJson({ ok: true, ...(result as object) }), failed: false };
|
| 411 |
}
|
| 412 |
+
if (call.function.name === 'web_search') {
|
| 413 |
+
const query = requiredString(args.query, 'web_search.query');
|
| 414 |
+
if (!window.confirm(`Allow Bonsai to send the search query “${query}” to Wikipedia?`)) {
|
| 415 |
+
throw new Error('operator declined network search');
|
| 416 |
+
}
|
| 417 |
+
const result = await searchWikipedia(
|
| 418 |
+
query,
|
| 419 |
+
typeof args.language === 'string' ? args.language : undefined,
|
| 420 |
+
typeof args.limit === 'number' ? args.limit : undefined,
|
| 421 |
+
signal,
|
| 422 |
+
);
|
| 423 |
+
return { call, output: boundedJson({ ok: true, ...result }), failed: false };
|
| 424 |
+
}
|
| 425 |
throw new Error(`unsupported tool: ${call.function.name}`);
|
| 426 |
} catch (error) {
|
| 427 |
const message = error instanceof Error ? error.message : String(error);
|
src/lib/artifact-runtime.ts
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export type ArtifactConsoleLevel = 'log' | 'info' | 'warn' | 'error';
|
| 2 |
+
|
| 3 |
+
export interface ArtifactConsoleEntry {
|
| 4 |
+
level: ArtifactConsoleLevel;
|
| 5 |
+
message: string;
|
| 6 |
+
source?: string;
|
| 7 |
+
line?: number;
|
| 8 |
+
column?: number;
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
export interface ArtifactEvaluation {
|
| 12 |
+
status: 'passed' | 'failed' | 'timeout';
|
| 13 |
+
entries: ArtifactConsoleEntry[];
|
| 14 |
+
dom?: {
|
| 15 |
+
title: string;
|
| 16 |
+
textPreview: string;
|
| 17 |
+
elementCount: number;
|
| 18 |
+
};
|
| 19 |
+
durationMs: number;
|
| 20 |
+
testedAt: number;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
export interface ArtifactDocument {
|
| 24 |
+
id: string;
|
| 25 |
+
title: string;
|
| 26 |
+
source: string;
|
| 27 |
+
sandboxedSource: string;
|
| 28 |
+
runtimeToken: string;
|
| 29 |
+
createdAt: number;
|
| 30 |
+
evaluation?: ArtifactEvaluation;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
interface RuntimeDiagnostics {
|
| 34 |
+
token: string;
|
| 35 |
+
evaluation: ArtifactEvaluation;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
const MAX_ARTIFACT_BYTES = 256 * 1024;
|
| 39 |
+
const MAX_CONSOLE_ENTRIES = 100;
|
| 40 |
+
const ARTIFACT_DIAGNOSTICS_EVENT = 'bonsai-artifact-diagnostics';
|
| 41 |
+
const diagnostics = new Map<string, RuntimeDiagnostics>();
|
| 42 |
+
const META_REFRESH = /<meta\b(?=[^>]*\bhttp-equiv\s*=\s*["']?refresh\b)[^>]*>/iu;
|
| 43 |
+
const JAVASCRIPT_URL = /\b(?:href|src)\s*=\s*["']\s*javascript:/iu;
|
| 44 |
+
const SCRIPT_BLOCK = /<script\b[^>]*>([\s\S]*?)<\/script\s*>/giu;
|
| 45 |
+
const SCRIPT_NAVIGATION = /(?:\b(?:window\s*\.\s*)?location\s*(?:=|\.\s*href\s*=|\.\s*(?:assign|replace|reload)\s*\()|\bwindow\s*\.\s*open\s*\()/iu;
|
| 46 |
+
|
| 47 |
+
export const ARTIFACT_CONTENT_SECURITY_POLICY = [
|
| 48 |
+
"default-src 'none'",
|
| 49 |
+
"base-uri 'none'",
|
| 50 |
+
"connect-src 'none'",
|
| 51 |
+
"form-action 'none'",
|
| 52 |
+
"frame-src 'none'",
|
| 53 |
+
"img-src data: blob:",
|
| 54 |
+
"font-src data:",
|
| 55 |
+
"media-src data: blob:",
|
| 56 |
+
"object-src 'none'",
|
| 57 |
+
"style-src 'unsafe-inline'",
|
| 58 |
+
"script-src 'unsafe-inline'",
|
| 59 |
+
"worker-src 'none'",
|
| 60 |
+
].join('; ');
|
| 61 |
+
|
| 62 |
+
export function configureArtifactIframe(iframe: HTMLIFrameElement): void {
|
| 63 |
+
iframe.setAttribute('sandbox', 'allow-scripts');
|
| 64 |
+
iframe.setAttribute('credentialless', '');
|
| 65 |
+
iframe.setAttribute('csp', ARTIFACT_CONTENT_SECURITY_POLICY);
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
function runtimeBridge(artifactId: string, runtimeToken: string): string {
|
| 69 |
+
return `<script data-bonsai-artifact-runtime>
|
| 70 |
+
(() => {
|
| 71 |
+
const artifactId = ${JSON.stringify(artifactId)};
|
| 72 |
+
const runtimeToken = ${JSON.stringify(runtimeToken)};
|
| 73 |
+
const startedAt = performance.now();
|
| 74 |
+
const entries = [];
|
| 75 |
+
const render = (value) => {
|
| 76 |
+
if (value instanceof Error) return value.stack || value.message;
|
| 77 |
+
if (typeof value === 'string') return value;
|
| 78 |
+
try { return JSON.stringify(value); } catch { return String(value); }
|
| 79 |
+
};
|
| 80 |
+
const send = (phase) => parent.postMessage({
|
| 81 |
+
channel: 'bonsai-artifact-runtime',
|
| 82 |
+
artifactId,
|
| 83 |
+
runtimeToken,
|
| 84 |
+
phase,
|
| 85 |
+
entries,
|
| 86 |
+
dom: phase === 'settled' ? {
|
| 87 |
+
title: document.title,
|
| 88 |
+
textPreview: (document.body?.innerText || '').replace(/\\s+/g, ' ').trim().slice(0, 1000),
|
| 89 |
+
elementCount: document.querySelectorAll('*').length,
|
| 90 |
+
} : undefined,
|
| 91 |
+
durationMs: performance.now() - startedAt,
|
| 92 |
+
}, '*');
|
| 93 |
+
const record = (level, values, location = {}) => {
|
| 94 |
+
entries.push({
|
| 95 |
+
level,
|
| 96 |
+
message: values.map(render).join(' ').slice(0, 2048),
|
| 97 |
+
...location,
|
| 98 |
+
});
|
| 99 |
+
if (entries.length > ${MAX_CONSOLE_ENTRIES}) entries.shift();
|
| 100 |
+
send('live');
|
| 101 |
+
};
|
| 102 |
+
const blockNavigation = (event) => {
|
| 103 |
+
const target = event.target instanceof Element ? event.target.closest('a[href], form') : null;
|
| 104 |
+
if (!target) return;
|
| 105 |
+
const anchor = target instanceof HTMLAnchorElement ? target : null;
|
| 106 |
+
if (anchor && (anchor.getAttribute('href') || '').startsWith('#')) return;
|
| 107 |
+
event.preventDefault();
|
| 108 |
+
record('warn', ['Artifact navigation blocked']);
|
| 109 |
+
};
|
| 110 |
+
addEventListener('click', blockNavigation, true);
|
| 111 |
+
addEventListener('submit', blockNavigation, true);
|
| 112 |
+
window.open = () => { record('warn', ['Artifact popup blocked']); return null; };
|
| 113 |
+
new MutationObserver((records) => {
|
| 114 |
+
for (const mutation of records) {
|
| 115 |
+
for (const node of mutation.addedNodes) {
|
| 116 |
+
if (!(node instanceof Element)) continue;
|
| 117 |
+
const candidates = [node, ...node.querySelectorAll('meta[http-equiv]')];
|
| 118 |
+
for (const candidate of candidates) {
|
| 119 |
+
if (candidate instanceof HTMLMetaElement && candidate.httpEquiv.toLowerCase() === 'refresh') {
|
| 120 |
+
candidate.remove();
|
| 121 |
+
record('error', ['Artifact meta refresh blocked']);
|
| 122 |
+
}
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
}).observe(document, { childList: true, subtree: true });
|
| 127 |
+
for (const level of ['log', 'info', 'warn', 'error']) {
|
| 128 |
+
const original = console[level].bind(console);
|
| 129 |
+
console[level] = (...values) => { record(level, values); original(...values); };
|
| 130 |
+
}
|
| 131 |
+
addEventListener('error', (event) => {
|
| 132 |
+
const target = event.target;
|
| 133 |
+
const fallback = target && target !== window
|
| 134 |
+
? (target.tagName || 'resource') + ' failed to load'
|
| 135 |
+
: 'Unknown artifact error';
|
| 136 |
+
record('error', [event.error || event.message || fallback], {
|
| 137 |
+
source: event.filename || undefined,
|
| 138 |
+
line: event.lineno || undefined,
|
| 139 |
+
column: event.colno || undefined,
|
| 140 |
+
});
|
| 141 |
+
}, true);
|
| 142 |
+
addEventListener('unhandledrejection', (event) => {
|
| 143 |
+
record('error', ['Unhandled promise rejection:', event.reason]);
|
| 144 |
+
});
|
| 145 |
+
addEventListener('DOMContentLoaded', () => setTimeout(() => send('settled'), 250), { once: true });
|
| 146 |
+
setTimeout(() => send('settled'), 1200);
|
| 147 |
+
})();
|
| 148 |
+
<\/script>`;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
function instrumentHtml(source: string, artifactId: string, runtimeToken: string): string {
|
| 152 |
+
const injection = `<meta http-equiv="Content-Security-Policy" content="${ARTIFACT_CONTENT_SECURITY_POLICY}">${runtimeBridge(artifactId, runtimeToken)}`;
|
| 153 |
+
const doctype = /^\s*<!doctype\s+html[^>]*>/iu.exec(source);
|
| 154 |
+
if (!doctype) return `${injection}${source}`;
|
| 155 |
+
return `${doctype[0]}${injection}${source.slice(doctype[0].length)}`;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
export function prepareHtmlArtifact(
|
| 159 |
+
source: string,
|
| 160 |
+
title = 'Untitled artifact',
|
| 161 |
+
id: string = crypto.randomUUID(),
|
| 162 |
+
runtimeToken: string = crypto.randomUUID(),
|
| 163 |
+
): ArtifactDocument {
|
| 164 |
+
const bytes = new TextEncoder().encode(source).byteLength;
|
| 165 |
+
if (bytes > MAX_ARTIFACT_BYTES) throw new Error('html_artifact source exceeds 256 KiB');
|
| 166 |
+
if (META_REFRESH.test(source) || JAVASCRIPT_URL.test(source)) {
|
| 167 |
+
throw new Error('html_artifact cannot contain document navigation or refresh directives');
|
| 168 |
+
}
|
| 169 |
+
for (const match of source.matchAll(SCRIPT_BLOCK)) {
|
| 170 |
+
if (SCRIPT_NAVIGATION.test(match[1] ?? '')) {
|
| 171 |
+
throw new Error('html_artifact scripts cannot navigate or open another document');
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
return {
|
| 175 |
+
id,
|
| 176 |
+
title: title.trim().slice(0, 120) || 'Untitled artifact',
|
| 177 |
+
source,
|
| 178 |
+
sandboxedSource: instrumentHtml(source, id, runtimeToken),
|
| 179 |
+
runtimeToken,
|
| 180 |
+
createdAt: Date.now(),
|
| 181 |
+
};
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
export function normalizeArtifactDocument(artifact: ArtifactDocument): ArtifactDocument {
|
| 185 |
+
const normalized = prepareHtmlArtifact(
|
| 186 |
+
artifact.source,
|
| 187 |
+
artifact.title,
|
| 188 |
+
artifact.id,
|
| 189 |
+
typeof artifact.runtimeToken === 'string' && artifact.runtimeToken
|
| 190 |
+
? artifact.runtimeToken
|
| 191 |
+
: crypto.randomUUID(),
|
| 192 |
+
);
|
| 193 |
+
return {
|
| 194 |
+
...normalized,
|
| 195 |
+
createdAt: typeof artifact.createdAt === 'number' ? artifact.createdAt : normalized.createdAt,
|
| 196 |
+
...(artifact.evaluation ? { evaluation: artifact.evaluation } : {}),
|
| 197 |
+
};
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
export function evaluationFromRuntimeMessage(
|
| 201 |
+
data: unknown,
|
| 202 |
+
artifactId: string,
|
| 203 |
+
runtimeToken: string,
|
| 204 |
+
): ArtifactEvaluation | null {
|
| 205 |
+
if (!data || typeof data !== 'object') return null;
|
| 206 |
+
const payload = data as Record<string, unknown>;
|
| 207 |
+
if (payload.channel !== 'bonsai-artifact-runtime'
|
| 208 |
+
|| payload.artifactId !== artifactId
|
| 209 |
+
|| payload.runtimeToken !== runtimeToken
|
| 210 |
+
|| (payload.phase !== 'live' && payload.phase !== 'settled')) return null;
|
| 211 |
+
const entries = normalizeConsoleEntries(payload.entries);
|
| 212 |
+
const dom = payload.dom && typeof payload.dom === 'object'
|
| 213 |
+
? payload.dom as Record<string, unknown>
|
| 214 |
+
: null;
|
| 215 |
+
return {
|
| 216 |
+
status: entries.some((entry) => entry.level === 'error') ? 'failed' : 'passed',
|
| 217 |
+
entries,
|
| 218 |
+
...(dom ? {
|
| 219 |
+
dom: {
|
| 220 |
+
title: String(dom.title ?? '').slice(0, 200),
|
| 221 |
+
textPreview: String(dom.textPreview ?? '').slice(0, 1000),
|
| 222 |
+
elementCount: typeof dom.elementCount === 'number' ? Math.max(0, Math.round(dom.elementCount)) : 0,
|
| 223 |
+
},
|
| 224 |
+
} : {}),
|
| 225 |
+
durationMs: typeof payload.durationMs === 'number' && Number.isFinite(payload.durationMs)
|
| 226 |
+
? Math.max(0, payload.durationMs)
|
| 227 |
+
: 0,
|
| 228 |
+
testedAt: Date.now(),
|
| 229 |
+
};
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
function normalizeConsoleEntries(value: unknown): ArtifactConsoleEntry[] {
|
| 233 |
+
if (!Array.isArray(value)) return [];
|
| 234 |
+
const seen = new Set<string>();
|
| 235 |
+
const result: ArtifactConsoleEntry[] = [];
|
| 236 |
+
for (const raw of value) {
|
| 237 |
+
if (!raw || typeof raw !== 'object') continue;
|
| 238 |
+
const entry = raw as Record<string, unknown>;
|
| 239 |
+
const level = ['log', 'info', 'warn', 'error'].includes(String(entry.level))
|
| 240 |
+
? String(entry.level) as ArtifactConsoleLevel
|
| 241 |
+
: 'log';
|
| 242 |
+
const message = String(entry.message ?? '').slice(0, 2048);
|
| 243 |
+
if (!message) continue;
|
| 244 |
+
const normalized: ArtifactConsoleEntry = {
|
| 245 |
+
level,
|
| 246 |
+
message,
|
| 247 |
+
...(typeof entry.source === 'string' && entry.source ? { source: entry.source.slice(0, 512) } : {}),
|
| 248 |
+
...(typeof entry.line === 'number' ? { line: entry.line } : {}),
|
| 249 |
+
...(typeof entry.column === 'number' ? { column: entry.column } : {}),
|
| 250 |
+
};
|
| 251 |
+
const key = `${normalized.level}\u0000${normalized.message}\u0000${normalized.source ?? ''}\u0000${normalized.line ?? ''}`;
|
| 252 |
+
if (seen.has(key)) continue;
|
| 253 |
+
seen.add(key);
|
| 254 |
+
result.push(normalized);
|
| 255 |
+
if (result.length >= MAX_CONSOLE_ENTRIES) break;
|
| 256 |
+
}
|
| 257 |
+
return result;
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
export function recordArtifactDiagnostics(
|
| 261 |
+
artifactId: string,
|
| 262 |
+
runtimeToken: string,
|
| 263 |
+
evaluation: ArtifactEvaluation,
|
| 264 |
+
): void {
|
| 265 |
+
diagnostics.set(artifactId, { token: runtimeToken, evaluation });
|
| 266 |
+
if (typeof window !== 'undefined') {
|
| 267 |
+
window.dispatchEvent(new CustomEvent(ARTIFACT_DIAGNOSTICS_EVENT, {
|
| 268 |
+
detail: { artifactId, runtimeToken, evaluation },
|
| 269 |
+
}));
|
| 270 |
+
}
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
export function getArtifactDiagnostics(artifact: ArtifactDocument): ArtifactEvaluation | undefined {
|
| 274 |
+
const current = diagnostics.get(artifact.id);
|
| 275 |
+
return current?.token === artifact.runtimeToken ? current.evaluation : artifact.evaluation;
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
export function artifactDiagnosticsEventName(): string {
|
| 279 |
+
return ARTIFACT_DIAGNOSTICS_EVENT;
|
| 280 |
+
}
|
| 281 |
+
|
| 282 |
+
export async function evaluateHtmlArtifact(
|
| 283 |
+
artifact: ArtifactDocument,
|
| 284 |
+
timeoutMs = 2500,
|
| 285 |
+
signal?: AbortSignal,
|
| 286 |
+
): Promise<ArtifactEvaluation> {
|
| 287 |
+
if (typeof document === 'undefined' || !document.documentElement) {
|
| 288 |
+
throw new Error('artifact evaluation requires a browser document');
|
| 289 |
+
}
|
| 290 |
+
const iframe = document.createElement('iframe');
|
| 291 |
+
configureArtifactIframe(iframe);
|
| 292 |
+
iframe.setAttribute('aria-hidden', 'true');
|
| 293 |
+
iframe.style.position = 'fixed';
|
| 294 |
+
iframe.style.left = '-10000px';
|
| 295 |
+
iframe.style.top = '0';
|
| 296 |
+
iframe.style.width = '1024px';
|
| 297 |
+
iframe.style.height = '768px';
|
| 298 |
+
iframe.style.visibility = 'hidden';
|
| 299 |
+
iframe.style.pointerEvents = 'none';
|
| 300 |
+
iframe.srcdoc = artifact.sandboxedSource;
|
| 301 |
+
const startedAt = performance.now();
|
| 302 |
+
|
| 303 |
+
return new Promise((resolve, reject) => {
|
| 304 |
+
const cleanup = () => {
|
| 305 |
+
window.removeEventListener('message', onMessage);
|
| 306 |
+
signal?.removeEventListener('abort', onAbort);
|
| 307 |
+
iframe.remove();
|
| 308 |
+
};
|
| 309 |
+
const finish = (evaluation: ArtifactEvaluation) => {
|
| 310 |
+
window.clearTimeout(timer);
|
| 311 |
+
cleanup();
|
| 312 |
+
recordArtifactDiagnostics(artifact.id, artifact.runtimeToken, evaluation);
|
| 313 |
+
resolve(evaluation);
|
| 314 |
+
};
|
| 315 |
+
const timer = window.setTimeout(() => finish({
|
| 316 |
+
status: 'timeout',
|
| 317 |
+
entries: [{ level: 'error', message: `Artifact evaluation exceeded ${timeoutMs} ms` }],
|
| 318 |
+
durationMs: performance.now() - startedAt,
|
| 319 |
+
testedAt: Date.now(),
|
| 320 |
+
}), timeoutMs);
|
| 321 |
+
const onMessage = (event: MessageEvent) => {
|
| 322 |
+
if (event.source !== iframe.contentWindow) return;
|
| 323 |
+
const evaluation = evaluationFromRuntimeMessage(event.data, artifact.id, artifact.runtimeToken);
|
| 324 |
+
if (!evaluation || event.data?.phase !== 'settled') return;
|
| 325 |
+
finish(evaluation);
|
| 326 |
+
};
|
| 327 |
+
const onAbort = () => {
|
| 328 |
+
window.clearTimeout(timer);
|
| 329 |
+
cleanup();
|
| 330 |
+
reject(new DOMException('The artifact evaluation was aborted.', 'AbortError'));
|
| 331 |
+
};
|
| 332 |
+
window.addEventListener('message', onMessage);
|
| 333 |
+
if (signal?.aborted) {
|
| 334 |
+
onAbort();
|
| 335 |
+
return;
|
| 336 |
+
}
|
| 337 |
+
signal?.addEventListener('abort', onAbort, { once: true });
|
| 338 |
+
document.documentElement.append(iframe);
|
| 339 |
+
});
|
| 340 |
+
}
|
src/lib/chart-tools.test.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { describe, expect, it } from 'vitest';
|
| 2 |
+
import { generateBarChartHtml, generatePieChartHtml } from './chart-tools';
|
| 3 |
+
|
| 4 |
+
describe('chart artifact generators', () => {
|
| 5 |
+
it('renders escaped aligned data as a responsive bar chart', () => {
|
| 6 |
+
const html = generateBarChartHtml({
|
| 7 |
+
title: 'Build & test',
|
| 8 |
+
labels: ['Alpha <script>', 'Beta'],
|
| 9 |
+
values: [10, 5],
|
| 10 |
+
});
|
| 11 |
+
expect(html).toContain('Build & test');
|
| 12 |
+
expect(html).toContain('Alpha <script>');
|
| 13 |
+
expect(html).toContain('width:100.0000%');
|
| 14 |
+
expect(html).toContain('width:50.0000%');
|
| 15 |
+
});
|
| 16 |
+
|
| 17 |
+
it('renders parts of a positive whole as a pie chart', () => {
|
| 18 |
+
const html = generatePieChartHtml({ title: 'Share', labels: ['One', 'Two'], values: [1, 3] });
|
| 19 |
+
expect(html).toContain('conic-gradient(');
|
| 20 |
+
expect(html).toContain('25.0%');
|
| 21 |
+
expect(html).toContain('75.0%');
|
| 22 |
+
});
|
| 23 |
+
|
| 24 |
+
it('rejects mismatched or zero-only pie data', () => {
|
| 25 |
+
expect(() => generateBarChartHtml({ title: 'Bad', labels: ['One'], values: [1, 2] })).toThrow('same length');
|
| 26 |
+
expect(() => generatePieChartHtml({ title: 'Bad', labels: ['One'], values: [0] })).toThrow('positive total');
|
| 27 |
+
});
|
| 28 |
+
});
|
src/lib/chart-tools.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const CHART_PALETTE = ['#6f9f48', '#d07b50', '#7d8c72', '#b7d889', '#53684b', '#d7ad77', '#8a6f58', '#9eb0a0'];
|
| 2 |
+
|
| 3 |
+
export interface ChartInput {
|
| 4 |
+
title: string;
|
| 5 |
+
labels: string[];
|
| 6 |
+
values: number[];
|
| 7 |
+
colors?: string[];
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
function escapeHtml(value: string): string {
|
| 11 |
+
return value
|
| 12 |
+
.replaceAll('&', '&')
|
| 13 |
+
.replaceAll('<', '<')
|
| 14 |
+
.replaceAll('>', '>')
|
| 15 |
+
.replaceAll('"', '"')
|
| 16 |
+
.replaceAll("'", ''');
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
function normalizedInput(input: ChartInput): Required<ChartInput> {
|
| 20 |
+
const title = input.title.trim().slice(0, 120) || 'Untitled chart';
|
| 21 |
+
if (!Array.isArray(input.labels) || !Array.isArray(input.values)) {
|
| 22 |
+
throw new Error('chart labels and values must be arrays');
|
| 23 |
+
}
|
| 24 |
+
if (input.labels.length === 0 || input.labels.length > 32) {
|
| 25 |
+
throw new Error('chart requires 1–32 data points');
|
| 26 |
+
}
|
| 27 |
+
if (input.labels.length !== input.values.length) {
|
| 28 |
+
throw new Error('chart labels and values must have the same length');
|
| 29 |
+
}
|
| 30 |
+
const labels = input.labels.map((label) => String(label).trim().slice(0, 80));
|
| 31 |
+
const values = input.values.map((value) => {
|
| 32 |
+
const numeric = Number(value);
|
| 33 |
+
if (!Number.isFinite(numeric) || numeric < 0) {
|
| 34 |
+
throw new Error('chart values must be finite non-negative numbers');
|
| 35 |
+
}
|
| 36 |
+
return numeric;
|
| 37 |
+
});
|
| 38 |
+
const colors = labels.map((_, index) => {
|
| 39 |
+
const candidate = input.colors?.[index];
|
| 40 |
+
return typeof candidate === 'string' && /^#[0-9a-f]{6}$/iu.test(candidate)
|
| 41 |
+
? candidate
|
| 42 |
+
: CHART_PALETTE[index % CHART_PALETTE.length]!;
|
| 43 |
+
});
|
| 44 |
+
return { title, labels, values, colors };
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
function chartShell(title: string, body: string): string {
|
| 48 |
+
return `<!doctype html>
|
| 49 |
+
<html lang="en">
|
| 50 |
+
<head>
|
| 51 |
+
<meta charset="utf-8">
|
| 52 |
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
| 53 |
+
<title>${escapeHtml(title)}</title>
|
| 54 |
+
<style>
|
| 55 |
+
:root { color-scheme: light; font-family: ui-sans-serif, system-ui, sans-serif; }
|
| 56 |
+
* { box-sizing: border-box; }
|
| 57 |
+
body { margin: 0; padding: clamp(20px, 4vw, 44px); color: #182018; background: #f4f7f2; }
|
| 58 |
+
main { max-width: 960px; margin: 0 auto; }
|
| 59 |
+
h1 { margin: 0 0 26px; font-size: clamp(24px, 4vw, 42px); line-height: 1.05; letter-spacing: -.035em; }
|
| 60 |
+
.chart-note { margin: 20px 0 0; color: #647064; font-size: 13px; }
|
| 61 |
+
</style>
|
| 62 |
+
</head>
|
| 63 |
+
<body><main><h1>${escapeHtml(title)}</h1>${body}</main></body>
|
| 64 |
+
</html>`;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
export function generateBarChartHtml(input: ChartInput): string {
|
| 68 |
+
const { title, labels, values, colors } = normalizedInput(input);
|
| 69 |
+
const maximum = Math.max(...values, 1);
|
| 70 |
+
const rows = labels.map((label, index) => {
|
| 71 |
+
const value = values[index]!;
|
| 72 |
+
const percentage = value / maximum * 100;
|
| 73 |
+
return `<li>
|
| 74 |
+
<span class="label">${escapeHtml(label)}</span>
|
| 75 |
+
<span class="track"><i style="width:${percentage.toFixed(4)}%;background:${colors[index]!}"></i></span>
|
| 76 |
+
<strong>${escapeHtml(value.toLocaleString('en-US'))}</strong>
|
| 77 |
+
</li>`;
|
| 78 |
+
}).join('');
|
| 79 |
+
return chartShell(title, `<style>
|
| 80 |
+
ol { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
|
| 81 |
+
li { display: grid; grid-template-columns: minmax(90px, 180px) minmax(120px, 1fr) auto; align-items: center; gap: 12px; }
|
| 82 |
+
.label { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
|
| 83 |
+
.track { height: 26px; overflow: hidden; border: 1px solid #c9d1c8; background: #fff; }
|
| 84 |
+
.track i { display: block; min-width: 2px; height: 100%; }
|
| 85 |
+
strong { min-width: 64px; font-variant-numeric: tabular-nums; text-align: right; }
|
| 86 |
+
@media (max-width: 560px) { li { grid-template-columns: minmax(70px, 1fr) 2fr; } li strong { grid-column: 2; text-align: left; } }
|
| 87 |
+
</style><ol aria-label="${escapeHtml(title)}">${rows}</ol><p class="chart-note">Scale maximum: ${escapeHtml(maximum.toLocaleString('en-US'))}</p>`);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
export function generatePieChartHtml(input: ChartInput): string {
|
| 91 |
+
const { title, labels, values, colors } = normalizedInput(input);
|
| 92 |
+
const total = values.reduce((sum, value) => sum + value, 0);
|
| 93 |
+
if (total <= 0) throw new Error('pie_chart requires a positive total');
|
| 94 |
+
let cursor = 0;
|
| 95 |
+
const stops = values.map((value, index) => {
|
| 96 |
+
const start = cursor;
|
| 97 |
+
cursor += value / total * 100;
|
| 98 |
+
return `${colors[index]!} ${start.toFixed(4)}% ${cursor.toFixed(4)}%`;
|
| 99 |
+
}).join(', ');
|
| 100 |
+
const legend = labels.map((label, index) => {
|
| 101 |
+
const value = values[index]!;
|
| 102 |
+
const percentage = value / total * 100;
|
| 103 |
+
return `<li><i style="background:${colors[index]!}"></i><span>${escapeHtml(label)}</span><strong>${percentage.toFixed(1)}%</strong><small>${escapeHtml(value.toLocaleString('en-US'))}</small></li>`;
|
| 104 |
+
}).join('');
|
| 105 |
+
return chartShell(title, `<style>
|
| 106 |
+
.layout { display: grid; grid-template-columns: minmax(220px, 360px) minmax(260px, 1fr); align-items: center; gap: clamp(26px, 6vw, 70px); }
|
| 107 |
+
.pie { width: min(100%, 360px); aspect-ratio: 1; border: 1px solid #b9c3b8; border-radius: 50%; background: conic-gradient(${stops}); }
|
| 108 |
+
ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
|
| 109 |
+
li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding-bottom: 9px; border-bottom: 1px solid #d8ded7; }
|
| 110 |
+
li i { width: 12px; height: 12px; }
|
| 111 |
+
li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
| 112 |
+
li strong, li small { font-variant-numeric: tabular-nums; }
|
| 113 |
+
li small { min-width: 58px; color: #687368; text-align: right; }
|
| 114 |
+
@media (max-width: 680px) { .layout { grid-template-columns: 1fr; } .pie { justify-self: center; } }
|
| 115 |
+
</style><div class="layout"><div class="pie" role="img" aria-label="${escapeHtml(title)}"></div><ul>${legend}</ul></div><p class="chart-note">Total: ${escapeHtml(total.toLocaleString('en-US'))}</p>`);
|
| 116 |
+
}
|
src/lib/tool-routing.test.ts
CHANGED
|
@@ -32,13 +32,19 @@ describe('HTML artifact intent routing', () => {
|
|
| 32 |
expect(plan.minimumMaxTokens).toBe(4_096);
|
| 33 |
expect(plan.systemInstruction).toContain('compact enough to finish');
|
| 34 |
expect(plan.systemInstruction).toContain('Do not answer with a Markdown code block');
|
|
|
|
|
|
|
| 35 |
});
|
| 36 |
|
| 37 |
-
it('
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
});
|
| 43 |
|
| 44 |
it('keeps ordinary tool use on auto and honors the off switch', () => {
|
|
|
|
| 32 |
expect(plan.minimumMaxTokens).toBe(4_096);
|
| 33 |
expect(plan.systemInstruction).toContain('compact enough to finish');
|
| 34 |
expect(plan.systemInstruction).toContain('Do not answer with a Markdown code block');
|
| 35 |
+
expect(plan.systemInstruction).toContain('artifact_update');
|
| 36 |
+
expect(plan.systemInstruction).toContain('until it passes');
|
| 37 |
});
|
| 38 |
|
| 39 |
+
it('returns control to the model with repair tools after the artifact result', () => {
|
| 40 |
+
const plan = planClientTools('Create an HTML app', true, 1);
|
| 41 |
+
expect(plan.toolChoice).toBe('auto');
|
| 42 |
+
expect(plan.minimumMaxTokens).toBe(0);
|
| 43 |
+
expect(plan.tools?.map((tool) => tool.function.name)).toEqual(expect.arrayContaining([
|
| 44 |
+
'artifact_update',
|
| 45 |
+
'artifact_test',
|
| 46 |
+
'artifact_inspect',
|
| 47 |
+
]));
|
| 48 |
});
|
| 49 |
|
| 50 |
it('keeps ordinary tool use on auto and honors the off switch', () => {
|
src/lib/tool-routing.ts
CHANGED
|
@@ -31,13 +31,13 @@ export function planClientTools(prompt: string, enabled: boolean, completedToolR
|
|
| 31 |
return { tools: AGENT_TOOLS, toolChoice: 'auto', minimumMaxTokens: 0 };
|
| 32 |
}
|
| 33 |
if (completedToolRounds > 0) {
|
| 34 |
-
return { toolChoice: '
|
| 35 |
}
|
| 36 |
return {
|
| 37 |
tools: [HTML_ARTIFACT_TOOL],
|
| 38 |
toolChoice: 'required',
|
| 39 |
minimumMaxTokens: HTML_ARTIFACT_MIN_TOKENS,
|
| 40 |
requiredToolName: HTML_ARTIFACT_TOOL.function.name,
|
| 41 |
-
systemInstruction: 'The user explicitly requested an HTML artifact. Call html_artifact exactly once with complete, self-contained HTML and
|
| 42 |
};
|
| 43 |
}
|
|
|
|
| 31 |
return { tools: AGENT_TOOLS, toolChoice: 'auto', minimumMaxTokens: 0 };
|
| 32 |
}
|
| 33 |
if (completedToolRounds > 0) {
|
| 34 |
+
return { tools: AGENT_TOOLS, toolChoice: 'auto', minimumMaxTokens: 0 };
|
| 35 |
}
|
| 36 |
return {
|
| 37 |
tools: [HTML_ARTIFACT_TOOL],
|
| 38 |
toolChoice: 'required',
|
| 39 |
minimumMaxTokens: HTML_ARTIFACT_MIN_TOKENS,
|
| 40 |
requiredToolName: HTML_ARTIFACT_TOOL.function.name,
|
| 41 |
+
systemInstruction: 'The user explicitly requested an HTML artifact. Call html_artifact exactly once with complete, self-contained HTML, CSS, and any needed inline JavaScript. Keep the source compact enough to finish within the completion budget. Do not answer with a Markdown code block instead. Read the returned evaluation before claiming success. If it reports errors, call artifact_update with the returned artifact ID, then inspect the new evaluation and continue until it passes or you can clearly explain the remaining limitation.',
|
| 42 |
};
|
| 43 |
}
|
src/lib/web-search.test.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { describe, expect, it, vi } from 'vitest';
|
| 2 |
+
import { searchWikipedia } from './web-search';
|
| 3 |
+
|
| 4 |
+
describe('Wikipedia search provider', () => {
|
| 5 |
+
it('uses anonymous CORS search and returns plain-text results', async () => {
|
| 6 |
+
const fetchMock = vi.fn(async () => new Response(JSON.stringify({
|
| 7 |
+
query: { search: [{ title: 'WebGPU', snippet: '<span>GPU</span> API & browser', timestamp: '2026-01-01T00:00:00Z' }] },
|
| 8 |
+
}), { status: 200 })) as unknown as typeof fetch;
|
| 9 |
+
|
| 10 |
+
const result = await searchWikipedia(' WebGPU ', 'en', 3, undefined, fetchMock);
|
| 11 |
+
const [url, init] = vi.mocked(fetchMock).mock.calls[0] ?? [];
|
| 12 |
+
expect(String(url)).toContain('en.wikipedia.org/w/api.php');
|
| 13 |
+
expect(String(url)).toContain('list=search');
|
| 14 |
+
expect(String(url)).toContain('origin=*');
|
| 15 |
+
expect(init).toMatchObject({ credentials: 'omit', referrerPolicy: 'no-referrer' });
|
| 16 |
+
expect(result).toEqual({
|
| 17 |
+
provider: 'wikipedia',
|
| 18 |
+
query: 'WebGPU',
|
| 19 |
+
language: 'en',
|
| 20 |
+
results: [{
|
| 21 |
+
title: 'WebGPU',
|
| 22 |
+
snippet: 'GPU API & browser',
|
| 23 |
+
url: 'https://en.wikipedia.org/wiki/WebGPU',
|
| 24 |
+
updatedAt: '2026-01-01T00:00:00Z',
|
| 25 |
+
}],
|
| 26 |
+
});
|
| 27 |
+
});
|
| 28 |
+
|
| 29 |
+
it('infers Russian and bounds the requested result count', async () => {
|
| 30 |
+
const fetchMock = vi.fn(async () => new Response('{"query":{"search":[]}}', { status: 200 })) as unknown as typeof fetch;
|
| 31 |
+
const result = await searchWikipedia('браузер', undefined, 99, undefined, fetchMock);
|
| 32 |
+
const [url] = vi.mocked(fetchMock).mock.calls[0] ?? [];
|
| 33 |
+
expect(result.language).toBe('ru');
|
| 34 |
+
expect(String(url)).toContain('ru.wikipedia.org');
|
| 35 |
+
expect(String(url)).toContain('srlimit=8');
|
| 36 |
+
});
|
| 37 |
+
});
|
src/lib/web-search.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export interface WebSearchResult {
|
| 2 |
+
title: string;
|
| 3 |
+
snippet: string;
|
| 4 |
+
url: string;
|
| 5 |
+
updatedAt?: string;
|
| 6 |
+
}
|
| 7 |
+
|
| 8 |
+
export interface WebSearchResponse {
|
| 9 |
+
provider: 'wikipedia';
|
| 10 |
+
query: string;
|
| 11 |
+
language: 'en' | 'ru';
|
| 12 |
+
results: WebSearchResult[];
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
function plainText(value: unknown): string {
|
| 16 |
+
return String(value ?? '')
|
| 17 |
+
.replace(/<[^>]*>/gu, '')
|
| 18 |
+
.replaceAll('"', '"')
|
| 19 |
+
.replaceAll(''', "'")
|
| 20 |
+
.replaceAll('&', '&')
|
| 21 |
+
.replaceAll('<', '<')
|
| 22 |
+
.replaceAll('>', '>')
|
| 23 |
+
.replace(/\s+/gu, ' ')
|
| 24 |
+
.trim()
|
| 25 |
+
.slice(0, 1200);
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
export async function searchWikipedia(
|
| 29 |
+
query: string,
|
| 30 |
+
requestedLanguage?: string,
|
| 31 |
+
requestedLimit?: number,
|
| 32 |
+
signal?: AbortSignal,
|
| 33 |
+
fetchImpl: typeof fetch = fetch,
|
| 34 |
+
): Promise<WebSearchResponse> {
|
| 35 |
+
const normalizedQuery = query.trim().slice(0, 500);
|
| 36 |
+
if (!normalizedQuery) throw new Error('web_search.query must be a non-empty string');
|
| 37 |
+
const language: 'en' | 'ru' = requestedLanguage === 'ru'
|
| 38 |
+
|| (requestedLanguage !== 'en' && /\p{Script=Cyrillic}/u.test(normalizedQuery))
|
| 39 |
+
? 'ru'
|
| 40 |
+
: 'en';
|
| 41 |
+
const limit = Math.min(8, Math.max(1, Math.round(requestedLimit ?? 5)));
|
| 42 |
+
const params = new URLSearchParams({
|
| 43 |
+
action: 'query',
|
| 44 |
+
list: 'search',
|
| 45 |
+
srsearch: normalizedQuery,
|
| 46 |
+
srlimit: String(limit),
|
| 47 |
+
srprop: 'snippet|timestamp',
|
| 48 |
+
format: 'json',
|
| 49 |
+
formatversion: '2',
|
| 50 |
+
origin: '*',
|
| 51 |
+
});
|
| 52 |
+
const controller = new AbortController();
|
| 53 |
+
const abort = () => controller.abort(signal?.reason);
|
| 54 |
+
signal?.addEventListener('abort', abort, { once: true });
|
| 55 |
+
const timer = setTimeout(() => controller.abort(new DOMException('web_search timed out', 'TimeoutError')), 8000);
|
| 56 |
+
try {
|
| 57 |
+
const response = await fetchImpl(`https://${language}.wikipedia.org/w/api.php?${params}`, {
|
| 58 |
+
method: 'GET',
|
| 59 |
+
credentials: 'omit',
|
| 60 |
+
referrerPolicy: 'no-referrer',
|
| 61 |
+
signal: controller.signal,
|
| 62 |
+
});
|
| 63 |
+
if (!response.ok) throw new Error(`web_search provider returned HTTP ${response.status}`);
|
| 64 |
+
const payload = await response.json() as {
|
| 65 |
+
query?: { search?: Array<{ title?: unknown; snippet?: unknown; timestamp?: unknown }> };
|
| 66 |
+
error?: { info?: unknown };
|
| 67 |
+
};
|
| 68 |
+
if (payload.error) throw new Error(`web_search provider error: ${String(payload.error.info ?? 'unknown error')}`);
|
| 69 |
+
const results = (payload.query?.search ?? []).slice(0, limit).map((item) => {
|
| 70 |
+
const title = plainText(item.title);
|
| 71 |
+
return {
|
| 72 |
+
title,
|
| 73 |
+
snippet: plainText(item.snippet),
|
| 74 |
+
url: `https://${language}.wikipedia.org/wiki/${encodeURIComponent(title.replaceAll(' ', '_'))}`,
|
| 75 |
+
...(typeof item.timestamp === 'string' ? { updatedAt: item.timestamp } : {}),
|
| 76 |
+
};
|
| 77 |
+
});
|
| 78 |
+
return { provider: 'wikipedia', query: normalizedQuery, language, results };
|
| 79 |
+
} finally {
|
| 80 |
+
clearTimeout(timer);
|
| 81 |
+
signal?.removeEventListener('abort', abort);
|
| 82 |
+
}
|
| 83 |
+
}
|