@enjoys/context-engine 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/data/commands/linux.json +826 -21
  2. package/data/commands/manifest.json +3 -1
  3. package/data/completion/awk.json +203 -0
  4. package/data/completion/crontab.json +203 -0
  5. package/data/completion/dotenv.json +170 -0
  6. package/data/completion/go.json +9464 -773
  7. package/data/completion/graphql.json +181 -0
  8. package/data/completion/hcl.json +192 -0
  9. package/data/completion/ini.json +137 -0
  10. package/data/completion/json.json +170 -0
  11. package/data/completion/makefile.json +203 -0
  12. package/data/completion/markdown.json +225 -0
  13. package/data/completion/nginx.json +280 -0
  14. package/data/completion/perl.json +203 -0
  15. package/data/completion/powershell.json +225 -0
  16. package/data/completion/protobuf.json +181 -0
  17. package/data/completion/ssh_config.json +159 -0
  18. package/data/completion/systemd.json +170 -0
  19. package/data/completion/xml.json +159 -0
  20. package/data/completion/zsh.json +214 -0
  21. package/data/defination/awk.json +125 -0
  22. package/data/defination/crontab.json +107 -0
  23. package/data/defination/dotenv.json +71 -0
  24. package/data/defination/go.json +14555 -380
  25. package/data/defination/graphql.json +119 -0
  26. package/data/defination/hcl.json +125 -0
  27. package/data/defination/ini.json +77 -0
  28. package/data/defination/json.json +83 -0
  29. package/data/defination/makefile.json +113 -0
  30. package/data/defination/markdown.json +107 -0
  31. package/data/defination/nginx.json +131 -0
  32. package/data/defination/perl.json +101 -0
  33. package/data/defination/powershell.json +119 -0
  34. package/data/defination/protobuf.json +119 -0
  35. package/data/defination/ssh_config.json +89 -0
  36. package/data/defination/systemd.json +107 -0
  37. package/data/defination/xml.json +83 -0
  38. package/data/defination/zsh.json +113 -0
  39. package/data/hover/awk.json +47 -0
  40. package/data/hover/crontab.json +47 -0
  41. package/data/hover/dotenv.json +47 -0
  42. package/data/hover/go.json +4324 -202
  43. package/data/hover/graphql.json +47 -0
  44. package/data/hover/hcl.json +75 -0
  45. package/data/hover/ini.json +68 -0
  46. package/data/hover/json.json +89 -0
  47. package/data/hover/makefile.json +68 -0
  48. package/data/hover/markdown.json +68 -0
  49. package/data/hover/nginx.json +89 -0
  50. package/data/hover/perl.json +47 -0
  51. package/data/hover/powershell.json +54 -0
  52. package/data/hover/protobuf.json +47 -0
  53. package/data/hover/ssh_config.json +47 -0
  54. package/data/hover/systemd.json +54 -0
  55. package/data/hover/xml.json +61 -0
  56. package/data/hover/zsh.json +61 -0
  57. package/data/manifest.json +210 -6
  58. package/package.json +1 -1
@@ -0,0 +1,83 @@
1
+ {
2
+ "language": "xml",
3
+ "definitions": {
4
+ "element": {
5
+ "signature": "<tag>content</tag>",
6
+ "description": "An XML element is the basic building block. Elements can contain text, attributes, and other elements.",
7
+ "type": "structure",
8
+ "module": "XML 1.0"
9
+ },
10
+ "attribute": {
11
+ "signature": "name=\"value\"",
12
+ "description": "Attributes provide additional information about elements. Values must be quoted.",
13
+ "type": "syntax",
14
+ "module": "XML 1.0"
15
+ },
16
+ "namespace": {
17
+ "signature": "xmlns:prefix=\"URI\"",
18
+ "description": "XML namespaces prevent element name conflicts by qualifying names with a URI.",
19
+ "type": "syntax",
20
+ "module": "XML Namespaces"
21
+ },
22
+ "CDATA": {
23
+ "signature": "<![CDATA[ ... ]]>",
24
+ "description": "CDATA sections contain text that should not be parsed. Useful for embedding code or special characters.",
25
+ "type": "structure",
26
+ "module": "XML 1.0"
27
+ },
28
+ "comment": {
29
+ "signature": "<!-- comment -->",
30
+ "description": "XML comments are ignored by parsers. Cannot contain the sequence --.",
31
+ "type": "syntax",
32
+ "module": "XML 1.0"
33
+ },
34
+ "declaration": {
35
+ "signature": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>",
36
+ "description": "The XML declaration specifies the XML version and character encoding. Must be the first line.",
37
+ "type": "syntax",
38
+ "module": "XML 1.0"
39
+ },
40
+ "DOCTYPE": {
41
+ "signature": "<!DOCTYPE root SYSTEM \"file.dtd\">",
42
+ "description": "Document Type Declaration defines the document structure and can reference an external DTD.",
43
+ "type": "syntax",
44
+ "module": "XML 1.0"
45
+ },
46
+ "processing_instruction": {
47
+ "signature": "<?target data?>",
48
+ "description": "Processing instructions provide information to the application processing the XML.",
49
+ "type": "syntax",
50
+ "module": "XML 1.0"
51
+ },
52
+ "well_formed": {
53
+ "signature": "Well-formed XML rules",
54
+ "description": "XML must have a single root element, properly nested tags, quoted attributes, and case-sensitive tag names.",
55
+ "type": "concept",
56
+ "module": "XML 1.0"
57
+ },
58
+ "XPath": {
59
+ "signature": "//element[@attr='value']",
60
+ "description": "XPath is a query language for selecting nodes from an XML document. Supports axes, predicates, and functions.",
61
+ "type": "standard",
62
+ "module": "XPath 1.0"
63
+ },
64
+ "XSLT": {
65
+ "signature": "xsl:stylesheet",
66
+ "description": "XSLT is a language for transforming XML documents into other formats (HTML, text, other XML).",
67
+ "type": "standard",
68
+ "module": "XSLT 1.0"
69
+ },
70
+ "DTD": {
71
+ "signature": "Document Type Definition",
72
+ "description": "DTD defines the structure and legal elements/attributes of an XML document. Can be internal or external.",
73
+ "type": "standard",
74
+ "module": "XML 1.0"
75
+ },
76
+ "XSD": {
77
+ "signature": "XML Schema Definition",
78
+ "description": "XSD is an XML-based alternative to DTD for describing the structure of XML documents with data types.",
79
+ "type": "standard",
80
+ "module": "XML Schema"
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "language": "zsh",
3
+ "definitions": {
4
+ "alias": {
5
+ "signature": "alias name='command'",
6
+ "description": "Creates a shortcut for a command. Aliases are expanded before execution.",
7
+ "type": "builtin",
8
+ "module": "zsh"
9
+ },
10
+ "function": {
11
+ "signature": "fname() { ... }",
12
+ "description": "Defines a shell function. Functions can accept arguments accessed via $1, $2, etc.",
13
+ "type": "syntax",
14
+ "module": "zsh"
15
+ },
16
+ "export": {
17
+ "signature": "export NAME=value",
18
+ "description": "Sets and exports an environment variable, making it available to child processes.",
19
+ "type": "builtin",
20
+ "module": "zsh"
21
+ },
22
+ "source": {
23
+ "signature": "source file",
24
+ "description": "Read and execute commands from a file in the current shell environment. Also: . file",
25
+ "type": "builtin",
26
+ "module": "zsh"
27
+ },
28
+ "setopt": {
29
+ "signature": "setopt OPTION_NAME",
30
+ "description": "Enable a zsh shell option. Use unsetopt to disable.",
31
+ "type": "builtin",
32
+ "module": "zsh"
33
+ },
34
+ "autoload": {
35
+ "signature": "autoload -Uz function",
36
+ "description": "Mark a function for autoloading. -U suppresses alias expansion, -z forces zsh-style.",
37
+ "type": "builtin",
38
+ "module": "zsh"
39
+ },
40
+ "bindkey": {
41
+ "signature": "bindkey 'key' widget",
42
+ "description": "Bind a key sequence to a ZLE (Zsh Line Editor) widget.",
43
+ "type": "builtin",
44
+ "module": "zsh"
45
+ },
46
+ "zstyle": {
47
+ "signature": "zstyle ':pattern' key value",
48
+ "description": "Set context-sensitive style for the completion system and other modules.",
49
+ "type": "builtin",
50
+ "module": "zsh"
51
+ },
52
+ "compdef": {
53
+ "signature": "compdef function command",
54
+ "description": "Associate a completion function with a command.",
55
+ "type": "builtin",
56
+ "module": "zsh/compctl"
57
+ },
58
+ "PROMPT": {
59
+ "signature": "PROMPT='format'",
60
+ "description": "The primary prompt string. Supports escape sequences: %n (username), %m (hostname), %~ (cwd), %F{color}...%f.",
61
+ "type": "variable",
62
+ "module": "zsh"
63
+ },
64
+ "RPROMPT": {
65
+ "signature": "RPROMPT='format'",
66
+ "description": "Right-side prompt. Disappears when typing reaches it. Useful for git status, time, etc.",
67
+ "type": "variable",
68
+ "module": "zsh"
69
+ },
70
+ "HISTFILE": {
71
+ "signature": "HISTFILE=~/.zsh_history",
72
+ "description": "File where command history is saved.",
73
+ "type": "variable",
74
+ "module": "zsh"
75
+ },
76
+ "HISTSIZE": {
77
+ "signature": "HISTSIZE=10000",
78
+ "description": "Maximum number of history entries kept in memory.",
79
+ "type": "variable",
80
+ "module": "zsh"
81
+ },
82
+ "SAVEHIST": {
83
+ "signature": "SAVEHIST=10000",
84
+ "description": "Maximum number of history entries saved to HISTFILE.",
85
+ "type": "variable",
86
+ "module": "zsh"
87
+ },
88
+ "ZSH_THEME": {
89
+ "signature": "ZSH_THEME=\"theme_name\"",
90
+ "description": "Oh My Zsh theme selector. Set before sourcing oh-my-zsh.sh.",
91
+ "type": "variable",
92
+ "module": "Oh My Zsh"
93
+ },
94
+ "AUTO_CD": {
95
+ "signature": "setopt AUTO_CD",
96
+ "description": "If a command is a directory name, cd into it automatically.",
97
+ "type": "option",
98
+ "module": "zsh"
99
+ },
100
+ "GLOB_DOTS": {
101
+ "signature": "setopt GLOB_DOTS",
102
+ "description": "Include dotfiles in glob patterns without explicitly specifying the dot.",
103
+ "type": "option",
104
+ "module": "zsh"
105
+ },
106
+ "SHARE_HISTORY": {
107
+ "signature": "setopt SHARE_HISTORY",
108
+ "description": "Share history between all running zsh sessions.",
109
+ "type": "option",
110
+ "module": "zsh"
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "language": "awk",
3
+ "hovers": {
4
+ "fields": {
5
+ "contents": [
6
+ {
7
+ "value": "```awk\n# input: \"John 30 Engineer\"\n# $0 = \"John 30 Engineer\" (whole line)\n# $1 = \"John\" (1st field)\n# $2 = \"30\" (2nd field)\n# $NF = \"Engineer\" (last field)\n# NF = 3 (field count)\n```\n**Fields** - Awk splits each line into fields by FS (default: whitespace). Access with `$1`, `$2`, etc."
8
+ }
9
+ ]
10
+ },
11
+ "pattern_action": {
12
+ "contents": [
13
+ {
14
+ "value": "```awk\n/error/ { print } # regex match\n$3 > 100 { print $1, $3 } # field condition\nNR == 1 { print \"Header:\", $0 }\nNR > 1 { sum += $2 } # skip header\nEND { print sum } # final output\n```\n**pattern { action }** is the fundamental awk structure. If pattern matches, action executes. Omit pattern to match all lines."
15
+ }
16
+ ]
17
+ },
18
+ "arrays": {
19
+ "contents": [
20
+ {
21
+ "value": "```awk\n# Associative arrays (like hash maps)\n{ count[$1]++ } # count occurrences\n{ total[$1] += $2 } # sum by group\nEND {\n for (k in count)\n print k, count[k]\n}\n\n# Check existence:\nif (\"key\" in arr) ...\ndelete arr[\"key\"]\n```\n**Arrays** are associative (string-indexed). No declaration needed. Use `for (k in arr)` to iterate."
22
+ }
23
+ ]
24
+ },
25
+ "one_liners": {
26
+ "contents": [
27
+ {
28
+ "value": "```bash\n# Print 2nd column:\nawk '{print $2}' file.txt\n\n# Sum column:\nawk '{s+=$1} END{print s}' data.txt\n\n# CSV with header skip:\nawk -F, 'NR>1 {print $1}' data.csv\n\n# Unique values:\nawk '!seen[$0]++' file.txt\n\n# Replace text:\nawk '{gsub(/old/,\"new\")}1' file.txt\n```\n**One-liners** - awk excels as a command-line data processor. `-F` sets field separator."
29
+ }
30
+ ]
31
+ },
32
+ "printf": {
33
+ "contents": [
34
+ {
35
+ "value": "```awk\nprintf \"%-20s %5d %8.2f\\n\", $1, $2, $3\n\n# Format specifiers:\n# %s string %-20s left-aligned, 20 wide\n# %d integer %5d right-aligned, 5 wide\n# %f float %8.2f 8 wide, 2 decimal\n# %x hex %o octal\n```\n**printf** provides C-style formatted output. Unlike print, it does NOT add a newline automatically."
36
+ }
37
+ ]
38
+ },
39
+ "built_in_vars": {
40
+ "contents": [
41
+ {
42
+ "value": "```awk\nNR # total record (line) number\nFNR # record number in current file\nNF # number of fields in current line\nFS # input field separator (default: space)\nOFS # output field separator (default: space)\nRS # input record separator (default: newline)\nORS # output record separator (default: newline)\nFILENAME # current input filename\n```\n**Built-in variables** control how awk reads and writes data."
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "language": "crontab",
3
+ "hovers": {
4
+ "format": {
5
+ "contents": [
6
+ {
7
+ "value": "```\n# .---------------- minute (0-59)\n# | .------------- hour (0-23)\n# | | .---------- day of month (1-31)\n# | | | .------- month (1-12 or jan-dec)\n# | | | | .---- day of week (0-7 or sun-sat)\n# | | | | |\n * * * * * command\n```\n**Cron expression** has 5 time fields followed by the command. Fields support `*`, ranges (`1-5`), lists (`1,3,5`), and steps (`*/5`)."
8
+ }
9
+ ]
10
+ },
11
+ "examples": {
12
+ "contents": [
13
+ {
14
+ "value": "```cron\n*/5 * * * * # every 5 minutes\n0 */2 * * * # every 2 hours\n0 9 * * 1-5 # weekdays at 9 AM\n0 0 1 * * # monthly (1st at midnight)\n0 0 * * 0 # weekly (Sunday midnight)\n30 2 * * * # daily at 2:30 AM\n```\n**Common schedules** - The most frequently used cron patterns for server tasks."
15
+ }
16
+ ]
17
+ },
18
+ "special": {
19
+ "contents": [
20
+ {
21
+ "value": "```cron\n@reboot command # run once at startup\n@hourly command # 0 * * * *\n@daily command # 0 0 * * *\n@weekly command # 0 0 * * 0\n@monthly command # 0 0 1 * *\n@yearly command # 0 0 1 1 *\n```\n**Special strings** are shortcuts for common schedules. `@reboot` is particularly useful for startup tasks."
22
+ }
23
+ ]
24
+ },
25
+ "logging": {
26
+ "contents": [
27
+ {
28
+ "value": "```cron\n# Log stdout and stderr to file:\n0 2 * * * /opt/backup.sh >> /var/log/backup.log 2>&1\n\n# Silence output:\n0 * * * * /opt/check.sh > /dev/null 2>&1\n\n# Email output:\nMAILTO=admin@example.com\n```\n**Logging** - Redirect output to files. Without redirection, cron emails output to MAILTO."
29
+ }
30
+ ]
31
+ },
32
+ "PATH": {
33
+ "contents": [
34
+ {
35
+ "value": "```cron\n# Cron has minimal PATH by default!\n# Always set PATH or use absolute paths:\nPATH=/usr/local/bin:/usr/bin:/bin\n\n# Or use absolute command paths:\n0 * * * * /usr/local/bin/node /opt/app/task.js\n```\n**PATH** - Cron's default PATH is minimal. Commands that work in your shell may fail in cron without setting PATH."
36
+ }
37
+ ]
38
+ },
39
+ "flock": {
40
+ "contents": [
41
+ {
42
+ "value": "```cron\n# Prevent overlapping runs:\n*/5 * * * * flock -n /tmp/myjob.lock /opt/slow-task.sh\n\n# With timeout:\n*/5 * * * * flock -w 10 /tmp/myjob.lock /opt/task.sh\n```\n**flock** prevents concurrent execution. Use `-n` to skip if locked, `-w N` to wait up to N seconds."
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "language": "dotenv",
3
+ "hovers": {
4
+ "variable": {
5
+ "contents": [
6
+ {
7
+ "value": "```bash\nKEY=value\nDATABASE_URL=postgres://localhost/mydb\nPORT=3000\n```\n**Environment variables** are key-value pairs. No spaces around `=`. Values are strings by default. Apps parse types themselves."
8
+ }
9
+ ]
10
+ },
11
+ "comment": {
12
+ "contents": [
13
+ {
14
+ "value": "```bash\n# This is a comment\n# DATABASE_URL=old-value # disabled\n```\n**Comments** start with `#`. Used for documentation and temporarily disabling variables."
15
+ }
16
+ ]
17
+ },
18
+ "quoted": {
19
+ "contents": [
20
+ {
21
+ "value": "```bash\nSINGLE='literal $value'\nDOUBLE=\"expanded ${VAR}\"\nUNQUOTED=no-spaces-allowed\n```\n**Quoting** rules: Single quotes are literal. Double quotes allow variable expansion. Unquoted values end at whitespace/newline."
22
+ }
23
+ ]
24
+ },
25
+ "DATABASE_URL": {
26
+ "contents": [
27
+ {
28
+ "value": "```bash\n# PostgreSQL\nDATABASE_URL=postgres://user:pass@host:5432/db\n# MySQL\nDATABASE_URL=mysql://user:pass@host:3306/db\n# SQLite\nDATABASE_URL=sqlite:///path/to/db.sqlite3\n```\n**DATABASE_URL** is the standard connection string format used by ORMs and database tools."
29
+ }
30
+ ]
31
+ },
32
+ "security": {
33
+ "contents": [
34
+ {
35
+ "value": "```bash\n# .gitignore:\n.env\n.env.local\n.env.*.local\n\n# .env.example (commit this):\nDATABASE_URL=\nAPI_KEY=\nSECRET_KEY=\n```\n**Security** - Never commit `.env` files with secrets. Use `.env.example` as a template for required variables."
36
+ }
37
+ ]
38
+ },
39
+ "loading": {
40
+ "contents": [
41
+ {
42
+ "value": "```bash\n# Load order (typical):\n# 1. .env (shared defaults)\n# 2. .env.local (local overrides)\n# 3. .env.development (environment-specific)\n# 4. .env.development.local\n```\n**Loading priority** varies by framework. Later files override earlier ones. System env vars usually take highest priority."
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ }