pair-mode 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +209 -0
- package/assets/syntax/c.yaml +59 -0
- package/assets/syntax/css.yaml +43 -0
- package/assets/syntax/dockerfile.yaml +35 -0
- package/assets/syntax/elixir.yaml +30 -0
- package/assets/syntax/fish.yaml +47 -0
- package/assets/syntax/go.yaml +62 -0
- package/assets/syntax/html.yaml +70 -0
- package/assets/syntax/javascript.yaml +75 -0
- package/assets/syntax/json.yaml +39 -0
- package/assets/syntax/lua.yaml +111 -0
- package/assets/syntax/markdown.yaml +49 -0
- package/assets/syntax/proto.yaml +40 -0
- package/assets/syntax/python3.yaml +62 -0
- package/assets/syntax/ruby.yaml +73 -0
- package/assets/syntax/rust.yaml +78 -0
- package/assets/syntax/sh.yaml +69 -0
- package/assets/syntax/sql.yaml +35 -0
- package/assets/syntax/terraform.yaml +87 -0
- package/assets/syntax/toml.yaml +56 -0
- package/assets/syntax/typescript.yaml +49 -0
- package/assets/syntax/yaml.yaml +34 -0
- package/assets/syntax/zsh.yaml +51 -0
- package/dist/claude-code.js +9294 -0
- package/dist/cli.js +13701 -0
- package/dist/codex.js +9448 -0
- package/dist/opencode.js +9268 -0
- package/dist/pair-tui.js +2729 -0
- package/dist/pi.js +9354 -0
- package/package.json +65 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#
|
|
2
|
+
# This syntax definition is based on the Terraform guide:
|
|
3
|
+
# https://www.terraform.io/docs/configuration/index.html
|
|
4
|
+
#
|
|
5
|
+
# Formatting is loosely based on Sublime's and VSCode's syntax highlighting for Terraform:
|
|
6
|
+
# https://github.com/totoroot/Terraform.tmLanguage/blob/master/Terraform.sublime-syntax
|
|
7
|
+
# https://github.com/hashicorp/vscode-terraform/blob/main/syntaxes/terraform.tmGrammar.json
|
|
8
|
+
#
|
|
9
|
+
|
|
10
|
+
filetype: terraform
|
|
11
|
+
|
|
12
|
+
detect:
|
|
13
|
+
# File Extensions:
|
|
14
|
+
#
|
|
15
|
+
# - ".tf": the standard file extension
|
|
16
|
+
# https://www.terraform.io/docs/configuration/index.html#code-organization
|
|
17
|
+
#
|
|
18
|
+
# - ".hcl": non-terraform tools often use this HCL syntax, i.e. Vault
|
|
19
|
+
# https://www.vaultproject.io/docs/configuration/
|
|
20
|
+
filename: "\\.tf$|\\.hcl$"
|
|
21
|
+
|
|
22
|
+
rules:
|
|
23
|
+
# Named Values
|
|
24
|
+
#
|
|
25
|
+
# https://www.terraform.io/docs/language/expressions/references.html
|
|
26
|
+
- identifier: "\\b(var|local|module|data|path|terraform)\\b"
|
|
27
|
+
|
|
28
|
+
# Block types
|
|
29
|
+
#
|
|
30
|
+
# resource: https://www.terraform.io/docs/language/resources/syntax.html
|
|
31
|
+
# provider: https://www.terraform.io/docs/language/providers/configuration.html
|
|
32
|
+
# variable: https://www.terraform.io/docs/language/values/variables.html
|
|
33
|
+
# output: https://www.terraform.io/docs/language/values/outputs.html
|
|
34
|
+
# locals: https://www.terraform.io/docs/language/values/locals.html
|
|
35
|
+
# module: https://www.terraform.io/docs/language/modules/syntax.html
|
|
36
|
+
# data: https://www.terraform.io/docs/language/data-sources/index.html
|
|
37
|
+
# terraform: https://www.terraform.io/docs/language/settings/index.html#terraform-block-syntax
|
|
38
|
+
- special: "\\b(resource|provider|variable|output|locals|module|terraform)\\b"
|
|
39
|
+
|
|
40
|
+
# Built-In type keywords
|
|
41
|
+
#
|
|
42
|
+
# https://www.terraform.io/docs/language/expressions/type-constraints.html#primitive-types
|
|
43
|
+
# https://www.terraform.io/docs/language/expressions/type-constraints.html#dynamic-types-the-quot-any-quot-constraint
|
|
44
|
+
- type.keyword: "\\b(any|string|number|bool)\\b"
|
|
45
|
+
|
|
46
|
+
# Built-In Functions
|
|
47
|
+
#
|
|
48
|
+
# https://www.terraform.io/docs/language/functions/index.html
|
|
49
|
+
- statement: "\\b(abs|ceil|floor|log|max|min|parseint|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trim|trimprefix|trimsuffix|trimspace|upper|alltrue|anytrue|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|one|range|reverse|setintersection|setproduct|setsubtract|setunion|slice|sort|sum|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|textdecodebase64|textencodebase64|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filesha1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|cidrsubnets|can|defaults|nonsensitive|sensitive|tobool|tolist|tomap|tonumber|toset|tostring|try)\\b"
|
|
50
|
+
|
|
51
|
+
- symbol.operator: "([~^.:;,+*|=!\\%@]|<|>|/|-|&)"
|
|
52
|
+
|
|
53
|
+
- symbol.brackets: "([(){}]|\\[|\\])"
|
|
54
|
+
|
|
55
|
+
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b|'.'"
|
|
56
|
+
|
|
57
|
+
- constant.bool: "\\b(true|false|null)\\b"
|
|
58
|
+
|
|
59
|
+
- constant.string:
|
|
60
|
+
start: '"'
|
|
61
|
+
end: '"'
|
|
62
|
+
skip: "\\\\."
|
|
63
|
+
rules:
|
|
64
|
+
- constant.specialChar: "%."
|
|
65
|
+
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
|
|
66
|
+
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
|
67
|
+
|
|
68
|
+
- constant.string:
|
|
69
|
+
start: "''"
|
|
70
|
+
end: "''"
|
|
71
|
+
skip: "\\\\."
|
|
72
|
+
rules:
|
|
73
|
+
- constant.specialChar: "%."
|
|
74
|
+
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
|
|
75
|
+
- constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
|
|
76
|
+
|
|
77
|
+
- comment:
|
|
78
|
+
start: "#|//"
|
|
79
|
+
end: "$\\n?"
|
|
80
|
+
rules:
|
|
81
|
+
- todo: "(TODO|XXX|FIXME):?"
|
|
82
|
+
|
|
83
|
+
- comment:
|
|
84
|
+
start: "/\\*"
|
|
85
|
+
end: "\\*/"
|
|
86
|
+
rules:
|
|
87
|
+
- todo: "(TODO|XXX|FIXME):?"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
filetype: toml
|
|
2
|
+
|
|
3
|
+
detect:
|
|
4
|
+
filename: "\\.toml"
|
|
5
|
+
|
|
6
|
+
rules:
|
|
7
|
+
# Punctuation
|
|
8
|
+
- symbol: '[=,\.]'
|
|
9
|
+
- symbol.brackets: '[{\[\]}]'
|
|
10
|
+
# Strings
|
|
11
|
+
- constant.string:
|
|
12
|
+
start: '"""'
|
|
13
|
+
end: '\"{3,5}'
|
|
14
|
+
skip: '\\.'
|
|
15
|
+
rules:
|
|
16
|
+
- constant.specialChar: '\\u[[:xdigit:]]{4}'
|
|
17
|
+
- constant.specialChar: '\\U[[:xdigit:]]{8}'
|
|
18
|
+
- constant.specialChar: '\\[btnfr"\\]'
|
|
19
|
+
- constant.string:
|
|
20
|
+
start: '"'
|
|
21
|
+
end: '"'
|
|
22
|
+
skip: '\\.'
|
|
23
|
+
rules:
|
|
24
|
+
- constant.specialChar: '\\u[[:xdigit:]]{4}'
|
|
25
|
+
- constant.specialChar: '\\U[[:xdigit:]]{8}'
|
|
26
|
+
- constant.specialChar: '\\[btnfr"\\]'
|
|
27
|
+
- constant.string:
|
|
28
|
+
start: "'''"
|
|
29
|
+
end: "'{3,5}"
|
|
30
|
+
rules: []
|
|
31
|
+
- constant.string:
|
|
32
|
+
start: "'"
|
|
33
|
+
end: "'"
|
|
34
|
+
rules: []
|
|
35
|
+
# Integer
|
|
36
|
+
- constant.number: '[+-]?(\d+_)*\d+\b'
|
|
37
|
+
- constant.number: "(0x([[:xdigit:]]+_)*[[:xdigit:]]+|0o([0-7]_)*[0-7]+|0b([01]+_)*[01]+)"
|
|
38
|
+
# Float
|
|
39
|
+
- constant.number: '[+-]?(\d+_)*\d+\.(\d+_)*\d+'
|
|
40
|
+
- constant.number: '[+-]?(\d+_)*\d+(\.(\d+_)*\d+)?[Ee][+-]?(\d+_)*\d+'
|
|
41
|
+
- constant.number: '(\+|-)(inf|nan)'
|
|
42
|
+
# Bare key, keys starting with a digit or dash are ambiguous with numbers and are skipped
|
|
43
|
+
- identifier: '\b[A-Za-z_][A-Za-z0-9_-]*\b'
|
|
44
|
+
# Boolean and inf, nan without sign
|
|
45
|
+
- constant.bool.true: '\btrue\b'
|
|
46
|
+
- constant.bool.false: '\bfalse\b'
|
|
47
|
+
- constant.number: '\b(inf|nan)\b'
|
|
48
|
+
# Date and Time
|
|
49
|
+
- constant: '\d+-\d{2}-\d{2}([T ]\d{2}:\d{2}:\d{2}(\.\d+)?([+-]\d{2}:\d{2}|Z)?)?'
|
|
50
|
+
- constant: '\d{2}:\d{2}:\d{2}(\.\d+)?'
|
|
51
|
+
# Comments
|
|
52
|
+
- comment:
|
|
53
|
+
start: "#"
|
|
54
|
+
end: "$"
|
|
55
|
+
rules:
|
|
56
|
+
- todo: "(TODO|XXX|FIXME):?"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
filetype: typescript
|
|
2
|
+
|
|
3
|
+
detect:
|
|
4
|
+
filename: "\\.tsx?$"
|
|
5
|
+
|
|
6
|
+
rules:
|
|
7
|
+
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
|
|
8
|
+
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
|
|
9
|
+
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
|
|
10
|
+
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
|
|
11
|
+
- statement: "\\b(abstract|as|async|await|break|case|catch|class|const|constructor|continue)\\b"
|
|
12
|
+
- statement: "\\b(debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from)\\b"
|
|
13
|
+
- statement: "\\b(function|get|if|implements|import|in|instanceof|interface|is|let|module|namespace)\\b"
|
|
14
|
+
- statement: "\\b(new|of|package|private|protected|public|require|return|set|static|super|switch)\\b"
|
|
15
|
+
- statement: "\\b(this|throw|try|type|typeof|var|void|while|with|yield)\\b"
|
|
16
|
+
- constant: "\\b(false|true|null|undefined|NaN)\\b"
|
|
17
|
+
- type: "\\b(Array|Boolean|Date|Enumerator|Error|Function|Math)\\b"
|
|
18
|
+
- type: "\\b(Number|Object|RegExp|String|Symbol)\\b"
|
|
19
|
+
- type: "\\b(any|unknown|boolean|never|number|string|symbol)\\b"
|
|
20
|
+
- statement: "[-+/*=<>!~%?:&|]"
|
|
21
|
+
- constant: "/[^*]([^/]|(\\\\/))*[^\\\\]/[gim]*"
|
|
22
|
+
- constant: "\\\\[0-7][0-7]?[0-7]?|\\\\x[0-9a-fA-F]+|\\\\[bfnrt'\"\\?\\\\]"
|
|
23
|
+
- comment:
|
|
24
|
+
start: "//"
|
|
25
|
+
end: "$"
|
|
26
|
+
rules: []
|
|
27
|
+
- comment:
|
|
28
|
+
start: "/\\*"
|
|
29
|
+
end: "\\*/"
|
|
30
|
+
rules:
|
|
31
|
+
- todo: "TODO:?"
|
|
32
|
+
- constant.string:
|
|
33
|
+
start: '"'
|
|
34
|
+
end: '"'
|
|
35
|
+
skip: "\\\\."
|
|
36
|
+
rules:
|
|
37
|
+
- constant.specialChar: "\\\\."
|
|
38
|
+
- constant.string:
|
|
39
|
+
start: "'"
|
|
40
|
+
end: "'"
|
|
41
|
+
skip: "\\\\."
|
|
42
|
+
rules:
|
|
43
|
+
- constant.specialChar: "\\\\."
|
|
44
|
+
- constant.string:
|
|
45
|
+
start: "`"
|
|
46
|
+
end: "`"
|
|
47
|
+
rules:
|
|
48
|
+
- constant.specialChar: "\\\\."
|
|
49
|
+
- identifier: "\\x24\\{.*?\\}"
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
filetype: yaml
|
|
2
|
+
|
|
3
|
+
detect:
|
|
4
|
+
filename: "\\.ya?ml$"
|
|
5
|
+
header: "%YAML"
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
- type: "(^| )!!(binary|bool|float|int|map|null|omap|seq|set|str) "
|
|
9
|
+
- constant: "\\b(YES|yes|Y|y|ON|on|TRUE|True|true|NO|no|N|n|OFF|off|FALSE|False|false)\\b"
|
|
10
|
+
- statement: "(:[[:space:]]|\\[|\\]|:[[:space:]]+[|>]|^[[:space:]]*- )"
|
|
11
|
+
- identifier: "[[:space:]][\\*&][A-Za-z0-9]+"
|
|
12
|
+
- type: "[-.\\w]+:"
|
|
13
|
+
- statement: ":"
|
|
14
|
+
- special: "(^---|^\\.\\.\\.|^%YAML|^%TAG)"
|
|
15
|
+
|
|
16
|
+
- constant.string:
|
|
17
|
+
start: '(^| )"'
|
|
18
|
+
end: '"'
|
|
19
|
+
skip: "\\\\."
|
|
20
|
+
rules:
|
|
21
|
+
- constant.specialChar: "\\\\."
|
|
22
|
+
|
|
23
|
+
- constant.string:
|
|
24
|
+
start: "(^| )'"
|
|
25
|
+
end: "'"
|
|
26
|
+
skip: "(\\\\.)|('')"
|
|
27
|
+
rules:
|
|
28
|
+
- constant.specialChar: "\\\\."
|
|
29
|
+
|
|
30
|
+
- comment:
|
|
31
|
+
start: "#"
|
|
32
|
+
end: "$"
|
|
33
|
+
rules:
|
|
34
|
+
- todo: "(TODO|XXX|FIXME):?"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
filetype: zsh
|
|
2
|
+
|
|
3
|
+
detect:
|
|
4
|
+
filename: "(\\.zsh$|\\.?(zshenv|zprofile|zshrc|zlogin|zlogout)$)"
|
|
5
|
+
header: "^#!.*/(env +)?zsh( |$)"
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
## Numbers
|
|
9
|
+
- constant.number: "\\b[0-9]+\\b"
|
|
10
|
+
|
|
11
|
+
## Conditionals and control flow
|
|
12
|
+
- statement: "\\b(always|break|bye|case|continue|disown|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\\b"
|
|
13
|
+
|
|
14
|
+
- statement: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|!|=|&|\\|)"
|
|
15
|
+
## Conditional flags
|
|
16
|
+
- special: "-[Ldefgruwx]\\b"
|
|
17
|
+
- special: "-(eq|ne|gt|lt|ge|le|s|n|z)\\b"
|
|
18
|
+
|
|
19
|
+
## Bash-inherited
|
|
20
|
+
- statement: "\\b((un)?alias|bindkey|builtin|cd|declare|eval|exec|export|jobs|let|popd|pushd|set|source|typeset|umask|unset)\\b"
|
|
21
|
+
## ZSH-specific
|
|
22
|
+
- type: "\\b(add-zsh-hook|autoload|chdir|compinit|dirs|(dis|en)able|echotc|emulate|print|prompt(init)?|(un)?setopt|zle|zmodload|zstyle|whence)\\b"
|
|
23
|
+
|
|
24
|
+
## Common linux commands
|
|
25
|
+
- statement: "\\b((g|ig)?awk|find|\\w{0,4}grep|kill|killall|\\w{0,4}less|make|pkill|sed|tar)\\b"
|
|
26
|
+
|
|
27
|
+
## Coreutils commands
|
|
28
|
+
- statement: "\\b(base64|basename|cat|chcon|chgrp|chmod|chown|chroot|cksum|comm|cp|csplit|cut|date|dd|df|dir|dircolors|dirname|du|echo|env|expand|expr|factor|false|fmt|fold|head|hostid|id|install|join|link|ln|logname|ls|md5sum|mkdir|mkfifo|mknod|mktemp|mv|nice|nl|nohup|nproc|numfmt|od|paste|pathchk|pinky|pr|printenv|printf|ptx|pwd|readlink|realpath|rm|rmdir|runcon|seq|(sha1|sha224|sha256|sha384|sha512)sum|shred|shuf|sleep|sort|split|stat|stdbuf|stty|sum|sync|tac|tail|tee|test|timeout|touch|tr|true|truncate|tsort|tty|uname|unexpand|uniq|unlink|users|vdir|wc|who|whoami|yes)\\b"
|
|
29
|
+
|
|
30
|
+
## Function definition
|
|
31
|
+
- identifier: "^\\s+(function\\s+)[0-9A-Z_]+\\s+\\(\\)" # (i)
|
|
32
|
+
|
|
33
|
+
## Variables
|
|
34
|
+
- identifier: "\\$\\{?[0-9A-Z_!@#$*?-]+\\}?" #(i)
|
|
35
|
+
|
|
36
|
+
- constant.string:
|
|
37
|
+
start: '"'
|
|
38
|
+
end: '"'
|
|
39
|
+
skip: "\\\\."
|
|
40
|
+
rules:
|
|
41
|
+
- constant.specialChar: "\\\\."
|
|
42
|
+
|
|
43
|
+
- constant.string:
|
|
44
|
+
start: "'"
|
|
45
|
+
end: "'"
|
|
46
|
+
rules: []
|
|
47
|
+
|
|
48
|
+
- comment:
|
|
49
|
+
start: "(^|\\s)#"
|
|
50
|
+
end: "$"
|
|
51
|
+
rules: []
|