perchai-cli 2.4.117 → 2.4.119

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.
@@ -0,0 +1,208 @@
1
+ ; ---------------------------------------------------------------------------
2
+ ; From tree-sitter-javascript 0.25.0, queries/tags.scm, with one Perch change:
3
+ ; an object literal's members (pairs and method shorthand) are properties,
4
+ ; not functions or methods, so the map does not list them as definitions
5
+ ; of their own (methods count only in a class body).
6
+ ; https://github.com/tree-sitter/tree-sitter-javascript
7
+ ;
8
+ ; The MIT License (MIT)
9
+ ;
10
+ ; Copyright (c) 2014 Max Brunsfeld
11
+ ;
12
+ ; Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ ; of this software and associated documentation files (the "Software"), to deal
14
+ ; in the Software without restriction, including without limitation the rights
15
+ ; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ ; copies of the Software, and to permit persons to whom the Software is
17
+ ; furnished to do so, subject to the following conditions:
18
+ ;
19
+ ; The above copyright notice and this permission notice shall be included in all
20
+ ; copies or substantial portions of the Software.
21
+ ;
22
+ ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ ; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ ; SOFTWARE.
29
+ ; ---------------------------------------------------------------------------
30
+
31
+ (class_body
32
+ (comment)* @doc
33
+ .
34
+ (method_definition
35
+ name: (property_identifier) @name) @definition.method
36
+ (#not-eq? @name "constructor")
37
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
38
+ (#select-adjacent! @doc @definition.method)
39
+ )
40
+
41
+ (object
42
+ (method_definition
43
+ name: (property_identifier) @name) @definition.property)
44
+
45
+ (
46
+ (comment)* @doc
47
+ .
48
+ [
49
+ (class
50
+ name: (_) @name)
51
+ (class_declaration
52
+ name: (_) @name)
53
+ ] @definition.class
54
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
55
+ (#select-adjacent! @doc @definition.class)
56
+ )
57
+
58
+ (
59
+ (comment)* @doc
60
+ .
61
+ [
62
+ (function_expression
63
+ name: (identifier) @name)
64
+ (function_declaration
65
+ name: (identifier) @name)
66
+ (generator_function
67
+ name: (identifier) @name)
68
+ (generator_function_declaration
69
+ name: (identifier) @name)
70
+ ] @definition.function
71
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
72
+ (#select-adjacent! @doc @definition.function)
73
+ )
74
+
75
+ (
76
+ (comment)* @doc
77
+ .
78
+ (lexical_declaration
79
+ (variable_declarator
80
+ name: (identifier) @name
81
+ value: [(arrow_function) (function_expression)]) @definition.function)
82
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
83
+ (#select-adjacent! @doc @definition.function)
84
+ )
85
+
86
+ (
87
+ (comment)* @doc
88
+ .
89
+ (variable_declaration
90
+ (variable_declarator
91
+ name: (identifier) @name
92
+ value: [(arrow_function) (function_expression)]) @definition.function)
93
+ (#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
94
+ (#select-adjacent! @doc @definition.function)
95
+ )
96
+
97
+ (assignment_expression
98
+ left: [
99
+ (identifier) @name
100
+ (member_expression
101
+ property: (property_identifier) @name)
102
+ ]
103
+ right: [(arrow_function) (function_expression)]
104
+ ) @definition.function
105
+
106
+ (pair
107
+ key: (property_identifier) @name
108
+ value: [(arrow_function) (function_expression)]) @definition.property
109
+
110
+ (
111
+ (call_expression
112
+ function: (identifier) @name) @reference.call
113
+ (#not-match? @name "^(require)$")
114
+ )
115
+
116
+ (call_expression
117
+ function: (member_expression
118
+ property: (property_identifier) @name)
119
+ arguments: (_) @reference.call)
120
+
121
+ (new_expression
122
+ constructor: (_) @name) @reference.class
123
+
124
+ (export_statement value: (assignment_expression left: (identifier) @name right: ([
125
+ (number)
126
+ (string)
127
+ (identifier)
128
+ (undefined)
129
+ (null)
130
+ (new_expression)
131
+ (binary_expression)
132
+ (call_expression)
133
+ ]))) @definition.constant
134
+
135
+ ; ---------------------------------------------------------------------------
136
+ ; From tree-sitter-typescript 0.23.2, queries/tags.scm, unchanged.
137
+ ; https://github.com/tree-sitter/tree-sitter-typescript
138
+ ;
139
+ ; The MIT License (MIT)
140
+ ;
141
+ ; Copyright (c) 2017 Max Brunsfeld
142
+ ;
143
+ ; Permission is hereby granted, free of charge, to any person obtaining a copy
144
+ ; of this software and associated documentation files (the "Software"), to deal
145
+ ; in the Software without restriction, including without limitation the rights
146
+ ; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
147
+ ; copies of the Software, and to permit persons to whom the Software is
148
+ ; furnished to do so, subject to the following conditions:
149
+ ;
150
+ ; The above copyright notice and this permission notice shall be included in all
151
+ ; copies or substantial portions of the Software.
152
+ ;
153
+ ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
154
+ ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
155
+ ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
156
+ ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
157
+ ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
158
+ ; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
159
+ ; SOFTWARE.
160
+ ; ---------------------------------------------------------------------------
161
+
162
+ (function_signature
163
+ name: (identifier) @name) @definition.function
164
+
165
+ (method_signature
166
+ name: (property_identifier) @name) @definition.method
167
+
168
+ (abstract_method_signature
169
+ name: (property_identifier) @name) @definition.method
170
+
171
+ (abstract_class_declaration
172
+ name: (type_identifier) @name) @definition.class
173
+
174
+ (module
175
+ name: (identifier) @name) @definition.module
176
+
177
+ (interface_declaration
178
+ name: (type_identifier) @name) @definition.interface
179
+
180
+ (type_annotation
181
+ (type_identifier) @name) @reference.type
182
+
183
+ (new_expression
184
+ constructor: (identifier) @name) @reference.class
185
+
186
+ ; ---------------------------------------------------------------------------
187
+ ; Perch additions (MIT): module imports (@import), exported constants and
188
+ ; types, and a few more definitions and references.
189
+ ; ---------------------------------------------------------------------------
190
+ (import_statement source: (string (string_fragment) @import))
191
+ (export_statement source: (string (string_fragment) @import))
192
+ ((call_expression
193
+ function: (identifier) @_require
194
+ arguments: (arguments . (string (string_fragment) @import)))
195
+ (#eq? @_require "require"))
196
+ (call_expression
197
+ function: (import)
198
+ arguments: (arguments . (string (string_fragment) @import)))
199
+ (export_statement
200
+ declaration: (lexical_declaration
201
+ (variable_declarator name: (identifier) @name) @definition.constant))
202
+
203
+ (type_alias_declaration name: (type_identifier) @name) @definition.type
204
+ (enum_declaration name: (identifier) @name) @definition.enum
205
+ (generic_type name: (type_identifier) @name) @reference.type
206
+ (type_arguments (type_identifier) @name) @reference.type
207
+ (extends_type_clause (type_identifier) @name) @reference.type
208
+ (implements_clause (type_identifier) @name) @reference.implementation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perchai-cli",
3
- "version": "2.4.117",
3
+ "version": "2.4.119",
4
4
  "description": "Perch AI command-line interface",
5
5
  "bin": {
6
6
  "perch": "bin/perch"
@@ -14,6 +14,7 @@
14
14
  "dependencies": {
15
15
  "@mozilla/readability": "^0.6.0",
16
16
  "@napi-rs/canvas": "^0.1.100",
17
+ "@vscode/ripgrep": "1.18.0",
17
18
  "jsdom": "^29.1.1"
18
19
  },
19
20
  "engines": {