@mrclrchtr/supi-code-intelligence 9.1.1 → 10.0.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.
Files changed (94) hide show
  1. package/README.md +24 -8
  2. package/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  3. package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  4. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  5. package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  6. package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
  7. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager-workspace-symbol.ts +29 -0
  8. package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +25 -22
  9. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +1 -1
  10. package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
  11. package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
  12. package/node_modules/ignore/LICENSE-MIT +21 -0
  13. package/node_modules/ignore/README.md +501 -0
  14. package/node_modules/ignore/index.d.ts +81 -0
  15. package/node_modules/ignore/index.js +1566 -0
  16. package/node_modules/ignore/legacy.js +1346 -0
  17. package/node_modules/ignore/package.json +93 -0
  18. package/node_modules/smol-toml/LICENSE +24 -0
  19. package/node_modules/smol-toml/README.md +605 -0
  20. package/node_modules/smol-toml/dist/date.d.ts +41 -0
  21. package/node_modules/smol-toml/dist/date.js +156 -0
  22. package/node_modules/smol-toml/dist/error.d.ts +37 -0
  23. package/node_modules/smol-toml/dist/error.js +67 -0
  24. package/node_modules/smol-toml/dist/extract.js +293 -0
  25. package/node_modules/smol-toml/dist/index.cjs +771 -0
  26. package/node_modules/smol-toml/dist/index.d.ts +44 -0
  27. package/node_modules/smol-toml/dist/index.js +34 -0
  28. package/node_modules/smol-toml/dist/parse.d.ts +73 -0
  29. package/node_modules/smol-toml/dist/parse.js +164 -0
  30. package/node_modules/smol-toml/dist/primitive.js +151 -0
  31. package/node_modules/smol-toml/dist/stringify.d.ts +32 -0
  32. package/node_modules/smol-toml/dist/stringify.js +219 -0
  33. package/node_modules/smol-toml/dist/struct.js +156 -0
  34. package/node_modules/smol-toml/dist/util.d.ts +43 -0
  35. package/node_modules/smol-toml/dist/util.js +57 -0
  36. package/node_modules/smol-toml/package.json +68 -0
  37. package/package.json +9 -5
  38. package/src/analysis/evidence.ts +2 -0
  39. package/src/analysis/target/symbol.ts +19 -8
  40. package/src/analysis/target/types.ts +2 -0
  41. package/src/analysis/workspace/exclusions.ts +35 -0
  42. package/src/analysis/workspace/git.ts +130 -0
  43. package/src/analysis/workspace/go-parser.ts +330 -0
  44. package/src/analysis/workspace/go.ts +154 -0
  45. package/src/analysis/workspace/index.ts +28 -0
  46. package/src/analysis/workspace/inventory.ts +316 -0
  47. package/src/analysis/workspace/membership.ts +223 -0
  48. package/src/analysis/workspace/metadata-types.ts +56 -0
  49. package/src/analysis/workspace/metadata-utils.ts +60 -0
  50. package/src/analysis/workspace/metadata.ts +148 -0
  51. package/src/analysis/workspace/node.ts +214 -0
  52. package/src/analysis/workspace/observe.ts +161 -0
  53. package/src/analysis/workspace/paths.ts +65 -0
  54. package/src/analysis/workspace/python.ts +158 -0
  55. package/src/analysis/workspace/relationships.ts +87 -0
  56. package/src/analysis/workspace/rust.ts +238 -0
  57. package/src/analysis/workspace/safe-path.ts +20 -0
  58. package/src/analysis/workspace/types.ts +245 -0
  59. package/src/app/app.ts +1 -0
  60. package/src/config.ts +4 -4
  61. package/src/extension.ts +16 -49
  62. package/src/overview/budget.ts +23 -0
  63. package/src/overview/collect.ts +22 -0
  64. package/src/session/orientation/workspace-context.ts +166 -0
  65. package/src/session/orientation-types.ts +8 -1
  66. package/src/session/orientation-workflow.ts +16 -3
  67. package/src/session/session.ts +2 -3
  68. package/src/session/target-workflow.ts +2 -0
  69. package/src/tool/code_find/execute.ts +1 -1
  70. package/src/tool/code_find/result.ts +10 -3
  71. package/src/tool/code_graph/result.ts +7 -2
  72. package/src/tool/code_orientation/execute.ts +8 -1
  73. package/src/tool/code_orientation/markdown.ts +58 -8
  74. package/src/tool/code_orientation/result.ts +17 -5
  75. package/src/tool/code_orientation/workspace-format.ts +74 -0
  76. package/src/tool/code_orientation/workspace-instructions.ts +105 -0
  77. package/src/tool/code_orientation/workspace-output.ts +118 -0
  78. package/src/tool/code_orientation/workspace-projects.ts +177 -0
  79. package/src/tool/code_orientation/workspace-sections.ts +217 -0
  80. package/src/tool/code_resolve/execute.ts +1 -1
  81. package/src/tool/code_resolve/markdown.ts +4 -1
  82. package/src/tool/code_resolve/result.ts +14 -2
  83. package/src/tool/register.ts +2 -0
  84. package/src/tool/result/candidate-row.ts +22 -0
  85. package/src/tool/result/display.ts +6 -0
  86. package/src/tool/result/errors.ts +12 -0
  87. package/src/tool/result/types.ts +2 -0
  88. package/src/types/execution.ts +2 -0
  89. package/src/ui/tui/candidate-disclosure.ts +43 -0
  90. package/src/ui/tui/candidate-selection.ts +24 -5
  91. package/src/ui/tui/common.ts +3 -0
  92. package/src/overview/overview-data.ts +0 -154
  93. package/src/overview/overview.ts +0 -91
  94. package/src/overview/types.ts +0 -23
@@ -0,0 +1,219 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ let BARE_KEY = /^[a-z0-9-_]+$/i;
29
+ let HAS_WELLFORMED = !!(''.isWellFormed);
30
+ function extendedTypeOf(obj) {
31
+ let type = typeof obj;
32
+ if (type === 'object') {
33
+ if (Array.isArray(obj))
34
+ return 'array';
35
+ if (typeof obj.getUTCDate === 'function' && obj instanceof Date)
36
+ return 'date';
37
+ if (globalThis.Temporal) {
38
+ if (obj.until) {
39
+ if (obj instanceof Temporal.ZonedDateTime)
40
+ return 'temporal/tz+uc';
41
+ if (obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainDate)
42
+ return 'temporal/uc';
43
+ if (obj instanceof Temporal.PlainTime || obj instanceof Temporal.Instant)
44
+ return 'temporal';
45
+ if (obj instanceof Temporal.PlainYearMonth)
46
+ return 'temporal/x';
47
+ }
48
+ else if ((obj.toPlainDate && obj instanceof Temporal.PlainMonthDay) ||
49
+ (obj.negated && obj instanceof Temporal.Duration)) {
50
+ return 'temporal/x';
51
+ }
52
+ }
53
+ }
54
+ return type;
55
+ }
56
+ function isArrayOfTables(obj) {
57
+ for (let i = 0; i < obj.length; i++) {
58
+ if (extendedTypeOf(obj[i]) !== 'object')
59
+ return false;
60
+ }
61
+ return obj.length != 0;
62
+ }
63
+ function formatWellFormedStringUnchecked(s) {
64
+ return JSON.stringify(s).replaceAll('\x7f', '\\u007f');
65
+ }
66
+ function formatString(s) {
67
+ return formatWellFormedStringUnchecked(HAS_WELLFORMED ? s.toWellFormed() : s);
68
+ }
69
+ function formatKey(s) {
70
+ if (BARE_KEY.test(s))
71
+ return s;
72
+ if (HAS_WELLFORMED && !s.isWellFormed())
73
+ throw new RangeError('key contains illegal lone surrogates');
74
+ return formatWellFormedStringUnchecked(s);
75
+ }
76
+ function stringifyValue(val, type, depth, numberAsFloat, strictTemporal) {
77
+ if (depth === 0) {
78
+ throw new Error('Could not stringify the object: maximum object depth exceeded');
79
+ }
80
+ switch (type) {
81
+ // @ts-expect-error -- intentional fallthrough case
82
+ case 'number':
83
+ if (isNaN(val))
84
+ return 'nan';
85
+ if (val === Infinity)
86
+ return 'inf';
87
+ if (val === -Infinity)
88
+ return '-inf';
89
+ if (Number.isInteger(val) && (numberAsFloat || !Number.isSafeInteger(val)))
90
+ return val.toFixed(1);
91
+ case 'bigint':
92
+ case 'boolean':
93
+ case 'temporal':
94
+ return val.toString();
95
+ case 'string':
96
+ return formatString(val);
97
+ case 'date':
98
+ if (isNaN(val.getTime()))
99
+ throw new TypeError('cannot serialize invalid date');
100
+ return val.toISOString();
101
+ case 'object':
102
+ return stringifyInlineTable(val, depth, numberAsFloat, strictTemporal);
103
+ case 'array':
104
+ return stringifyArray(val, depth, numberAsFloat, strictTemporal);
105
+ // @ts-expect-error -- intentional fallthrough case
106
+ case 'temporal/tz+uc':
107
+ if (strictTemporal) {
108
+ let tz = val.timeZoneId;
109
+ let tzc = tz.charCodeAt(0);
110
+ if (
111
+ // Classic offset
112
+ tzc !== 0x2b /* + */ && tzc !== 0x2d /* - */ &&
113
+ (
114
+ // Fast pre-check pass; see below for the actually accepted values
115
+ (tzc !== 0x55 /* U */ && tzc !== 0x47 /* G */ && tzc !== 0x5a /* Z */ && tzc !== 0x45 /* E */) ||
116
+ (
117
+ // UTC and its aliases; Temporal implementations don't all canonicalise unfortunately
118
+ tz !== 'UTC' && tz !== 'UCT' && tz !== 'Universal' && tz !== 'Zulu' &&
119
+ // GMT is a TZ but it's for all intents and purposes equivalent to UTC. Safe to downgrade.
120
+ !tz.startsWith('GMT') && tz !== 'Greenwich' &&
121
+ // Etc/* are all safe to downgrade to offset (either UTC, GMT, or offset)
122
+ !tz.startsWith('Etc/')))) {
123
+ throw new TypeError('Temporal objects with an IANA timezone are not allowed in Temporal strict mode');
124
+ }
125
+ }
126
+ case 'temporal/uc':
127
+ if (strictTemporal && val.calendarId !== 'iso8601')
128
+ throw new TypeError('Temporal objects with a non-default calendar are not allowed in Temporal strict mode');
129
+ return val.toString({
130
+ calendarName: 'never',
131
+ timeZoneName: 'never',
132
+ });
133
+ case 'temporal/x':
134
+ throw new TypeError('Unsupported ' + val[Symbol.toStringTag]);
135
+ }
136
+ }
137
+ function stringifyInlineTable(obj, depth, numberAsFloat, strictTemporal) {
138
+ let keys = Object.keys(obj);
139
+ if (keys.length === 0)
140
+ return '{}';
141
+ let res = '{ ';
142
+ for (let i = 0; i < keys.length; i++) {
143
+ let k = keys[i];
144
+ if (i)
145
+ res += ', ';
146
+ res += formatKey(k) + ' = ' + stringifyValue(obj[k], extendedTypeOf(obj[k]), depth - 1, numberAsFloat, strictTemporal);
147
+ }
148
+ return res + ' }';
149
+ }
150
+ function stringifyArray(array, depth, numberAsFloat, strictTemporal) {
151
+ if (array.length === 0)
152
+ return '[]';
153
+ let res = '[ ';
154
+ for (let i = 0; i < array.length; i++) {
155
+ if (i)
156
+ res += ', ';
157
+ if (array[i] === null || array[i] === void 0) {
158
+ throw new TypeError('arrays cannot contain null or undefined values');
159
+ }
160
+ res += stringifyValue(array[i], extendedTypeOf(array[i]), depth - 1, numberAsFloat, strictTemporal);
161
+ }
162
+ return res + ' ]';
163
+ }
164
+ function stringifyArrayTable(array, key, depth, numberAsFloat, strictTemporal) {
165
+ if (depth === 0) {
166
+ throw new Error('Could not stringify the object: maximum object depth exceeded');
167
+ }
168
+ let res = '';
169
+ for (let i = 0; i < array.length; i++) {
170
+ res += `${res && '\n'}[[${key}]]\n`;
171
+ res += stringifyTable(0, array[i], key, depth, numberAsFloat, strictTemporal);
172
+ }
173
+ return res;
174
+ }
175
+ function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat, strictTemporal) {
176
+ if (depth === 0) {
177
+ throw new Error('Could not stringify the object: maximum object depth exceeded');
178
+ }
179
+ let preamble = '';
180
+ let tables = '';
181
+ let keys = Object.keys(obj);
182
+ for (let i = 0; i < keys.length; i++) {
183
+ let k = keys[i];
184
+ if (obj[k] !== null && obj[k] !== void 0) {
185
+ let type = extendedTypeOf(obj[k]);
186
+ if (type === 'symbol' || type === 'function') {
187
+ throw new TypeError(`cannot serialize values of type '${type}'`);
188
+ }
189
+ let key = formatKey(k);
190
+ if (type === 'array' && isArrayOfTables(obj[k])) {
191
+ tables += (tables && '\n') + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat, strictTemporal);
192
+ }
193
+ else if (type === 'object') {
194
+ let tblKey = prefix ? `${prefix}.${key}` : key;
195
+ tables += (tables && '\n') + stringifyTable(tblKey, obj[k], tblKey, depth - 1, numberAsFloat, strictTemporal);
196
+ }
197
+ else {
198
+ preamble += key;
199
+ preamble += ' = ';
200
+ preamble += stringifyValue(obj[k], type, depth, numberAsFloat, strictTemporal);
201
+ preamble += '\n';
202
+ }
203
+ }
204
+ }
205
+ if (tableKey && (preamble || !tables)) // Create table only if necessary
206
+ preamble = preamble ? `[${tableKey}]\n${preamble}` : `[${tableKey}]`;
207
+ return preamble && tables
208
+ ? `${preamble}\n${tables}`
209
+ : preamble || tables;
210
+ }
211
+ export function stringify(obj, { maxDepth = 1000, numbersAsFloat = false, strictTemporal = false } = {}) {
212
+ if (extendedTypeOf(obj) !== 'object') {
213
+ throw new TypeError('stringify can only be called with an object');
214
+ }
215
+ let str = stringifyTable(0, obj, '', maxDepth, numbersAsFloat, strictTemporal);
216
+ if (str[str.length - 1] !== '\n')
217
+ return str + '\n';
218
+ return str;
219
+ }
@@ -0,0 +1,156 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import { parseString } from './primitive.js';
29
+ import { extractValue } from './extract.js';
30
+ import { skipVoid } from './util.js';
31
+ import { TomlError } from './error.js';
32
+ /** @internal */
33
+ export function parseKey(ctx, end = 0x3d /* = */) {
34
+ // States:
35
+ // 0: before first char
36
+ // 1: parsing bare key
37
+ // 2: after key component
38
+ let startPtr;
39
+ let state = 0;
40
+ let parsed = [];
41
+ let sliceStart;
42
+ let c = ctx.s.charCodeAt(startPtr = ctx.p);
43
+ do {
44
+ // End of key
45
+ if (c === end) {
46
+ if (!state)
47
+ TomlError.x('unexpected end of key', ctx);
48
+ if (state === 1)
49
+ parsed.push(ctx.s.slice(sliceStart, ctx.p));
50
+ return ctx.p++, parsed;
51
+ }
52
+ // Dotted key separator
53
+ else if (c === 0x2e /* . */) {
54
+ if (!state)
55
+ TomlError.x('illegal empty bare key', ctx);
56
+ if (state === 1)
57
+ parsed.push(ctx.s.slice(sliceStart, ctx.p));
58
+ state = 0;
59
+ }
60
+ // Quoted key
61
+ else if (!state && (c === 0x22 /* " */ || c === 0x27 /* ' */)) {
62
+ if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2))
63
+ TomlError.x('illegal quoted key: multiline strings are not allowed', ctx);
64
+ parsed.push(parseString(ctx));
65
+ state = 2;
66
+ ctx.p--;
67
+ }
68
+ // Whitespace; no-op in state 0 and 2, end of bare key in state 1
69
+ else if (c === 0x20 || c === 0x9 /* \t */) {
70
+ if (state === 1) {
71
+ parsed.push(ctx.s.slice(sliceStart, ctx.p));
72
+ state = 2;
73
+ }
74
+ }
75
+ // If state is post-key, no character is allowed; otherwise ensure it's a bare-key component
76
+ else if (state === 2 || (c < 0x30 && c !== 0x2d /* - */) || (c > 0x39 && c < 0x41) || (c > 0x5a && c < 0x61 && c !== 0x5f /* _ */) || c > 0x7a) {
77
+ TomlError.x('illegal character in key', ctx);
78
+ }
79
+ // Illegal character
80
+ else if (!state) {
81
+ state = 1;
82
+ sliceStart = ctx.p;
83
+ }
84
+ } while (c = ctx.s.charCodeAt(++ctx.p));
85
+ TomlError.x('incomplete key-value: cannot find end of key', ctx, startPtr);
86
+ }
87
+ /** @internal */
88
+ export function parseInlineTable(ctx) {
89
+ let startPtr = ctx.p++;
90
+ let res = Object.create(null);
91
+ let seen = new Set();
92
+ let c;
93
+ while (ctx.p < ctx.s.length) {
94
+ skipVoid(ctx);
95
+ if ((c = ctx.s.charCodeAt(ctx.p)) === 0x7d /* } */) {
96
+ ctx.p++;
97
+ return res;
98
+ }
99
+ let k;
100
+ let t = res;
101
+ let hasOwn = false;
102
+ let errPtr = ctx.p;
103
+ let key = parseKey(ctx);
104
+ for (let i = 0; i < key.length; i++) {
105
+ if (i)
106
+ t = hasOwn ? t[k] : (t[k] = Object.create(null));
107
+ k = key[i];
108
+ if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== 'object' || seen.has(t[k]))) {
109
+ TomlError.x('trying to redefine an already defined value', ctx, errPtr);
110
+ }
111
+ let unsafe = k === '__proto__';
112
+ if (ctx.uk && (unsafe || k === 'constructor')) {
113
+ t = ctx.uk !== 1 && TomlError.x('document contains an unsafe property', ctx, errPtr);
114
+ break;
115
+ }
116
+ if (!hasOwn && unsafe) {
117
+ Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
118
+ }
119
+ }
120
+ if (hasOwn) {
121
+ TomlError.x('trying to redefine an already defined value', ctx, errPtr);
122
+ }
123
+ skipVoid(ctx, true, true);
124
+ let value = extractValue(ctx, 0x7d /* } */);
125
+ if (t && typeof (t[k] = value) === 'object')
126
+ seen.add(value);
127
+ skipVoid(ctx);
128
+ if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x7d /* } */) {
129
+ return res;
130
+ }
131
+ if (c !== 0x2c /* , */)
132
+ TomlError.x('expected comma or end of structure', ctx, ctx.p - 1);
133
+ }
134
+ TomlError.x('unfinished table', ctx, startPtr);
135
+ }
136
+ /** @internal */
137
+ export function parseArray(ctx) {
138
+ let startPtr = ctx.p++;
139
+ let res = [];
140
+ let c;
141
+ while (ctx.p < ctx.s.length) {
142
+ skipVoid(ctx);
143
+ if ((c = ctx.s.charCodeAt(ctx.p)) === 0x5d /* ] */) {
144
+ ctx.p++;
145
+ return res;
146
+ }
147
+ res.push(extractValue(ctx, 0x5d /* ] */));
148
+ skipVoid(ctx);
149
+ if ((c = ctx.s.charCodeAt(ctx.p++)) === 0x5d /* ] */) {
150
+ return res;
151
+ }
152
+ if (c !== 0x2c /* , */)
153
+ TomlError.x('expected comma or end of structure', ctx, ctx.p - 1);
154
+ }
155
+ TomlError.x('unfinished array', ctx, startPtr);
156
+ }
@@ -0,0 +1,43 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import type { TomlDate } from './date.js';
29
+ type _Temporal = typeof globalThis extends {
30
+ Temporal: infer T;
31
+ } ? T : never;
32
+ type AnyTemporalDateTime = InstanceType<_Temporal['Instant']> | InstanceType<_Temporal['PlainDate']> | InstanceType<_Temporal['PlainDateTime']> | InstanceType<_Temporal['PlainTime']> | InstanceType<_Temporal['ZonedDateTime']>;
33
+ export type IntegersAsBigInt = undefined | boolean | 'asNeeded';
34
+ export type TomlPrimitive = string | number | bigint | boolean | TomlDate | AnyTemporalDateTime;
35
+ export type TomlTable = {
36
+ [key: string]: TomlValue;
37
+ };
38
+ export type TomlValue = TomlPrimitive | TomlValue[] | TomlTable;
39
+ export type TomlTableWithoutBigInt = {
40
+ [key: string]: TomlValueWithoutBigInt;
41
+ };
42
+ export type TomlValueWithoutBigInt = Exclude<TomlPrimitive, bigint> | TomlValueWithoutBigInt[] | TomlTableWithoutBigInt;
43
+ export {};
@@ -0,0 +1,57 @@
1
+ /*!
2
+ * Copyright (c) Squirrel Chat et al., All rights reserved.
3
+ * SPDX-License-Identifier: BSD-3-Clause
4
+ *
5
+ * Redistribution and use in source and binary forms, with or without
6
+ * modification, are permitted provided that the following conditions are met:
7
+ *
8
+ * 1. Redistributions of source code must retain the above copyright notice, this
9
+ * list of conditions and the following disclaimer.
10
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ * this list of conditions and the following disclaimer in the
12
+ * documentation and/or other materials provided with the distribution.
13
+ * 3. Neither the name of the copyright holder nor the names of its contributors
14
+ * may be used to endorse or promote products derived from this software without
15
+ * specific prior written permission.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ */
28
+ import { TomlError } from './error.js';
29
+ /** @internal */
30
+ export function skipComment(ctx) {
31
+ for (; ctx.p < ctx.s.length; ctx.p++) {
32
+ let c = ctx.s.charCodeAt(ctx.p);
33
+ if (c === 0xa /* \n */)
34
+ break;
35
+ if (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */) {
36
+ ctx.p++;
37
+ break;
38
+ }
39
+ if ((c < 0x20 && c !== 0x9 /* \t */) || c === 0x7f) {
40
+ TomlError.x('control characters are not allowed in comments', ctx);
41
+ }
42
+ }
43
+ }
44
+ /** @internal */
45
+ export function skipVoid(ctx, banNewLines, banComments) {
46
+ let c;
47
+ while (ctx.p < ctx.s.length) {
48
+ while (ctx.p < ctx.s.length && ((c = ctx.s.charCodeAt(ctx.p)) === 0x20 ||
49
+ c === 0x9 /* \t */ ||
50
+ (!banNewLines &&
51
+ (c === 0xa /* \n */ || (c === 0xd /* \r */ && ctx.s.charCodeAt(ctx.p + 1) === 0xa /* \n */)))))
52
+ ctx.p++;
53
+ if (banComments || c !== 0x23 /* # */)
54
+ break;
55
+ skipComment(ctx);
56
+ }
57
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "smol-toml",
3
+ "version": "1.9.1",
4
+ "description": "A small, fast, and correct TOML parser/serializer",
5
+ "keywords": [
6
+ "parser",
7
+ "serializer",
8
+ "toml"
9
+ ],
10
+ "bugs": "https://github.com/squirrelchat/smol-toml/issues",
11
+ "license": "BSD-3-Clause",
12
+ "author": "Cynthia Rey <cynthia@cynthia.dev>",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "github:squirrelchat/smol-toml"
16
+ },
17
+ "funding": "https://github.com/sponsors/cyyynthia",
18
+ "files": [
19
+ "README.md",
20
+ "LICENSE",
21
+ "dist"
22
+ ],
23
+ "type": "module",
24
+ "main": "./dist/index.cjs",
25
+ "module": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
27
+ "exports": {
28
+ "types": "./dist/index.d.ts",
29
+ "import": "./dist/index.js",
30
+ "require": "./dist/index.cjs"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public",
34
+ "provenance": true
35
+ },
36
+ "devDependencies": {
37
+ "@mitata/counters": "^0.0.8",
38
+ "@tsconfig/node-lts": "^24.0.1",
39
+ "@tsconfig/node-ts": "^23.6.4",
40
+ "@tsconfig/strictest": "^2.0.8",
41
+ "@types/node": "^26.6.4",
42
+ "mitata": "^1.0.34",
43
+ "pin-github-action": "^3.5.2",
44
+ "rolldown": "^1.2.13",
45
+ "typescript": "^7.0.2",
46
+ "vite": "^8.3.3",
47
+ "vitest": "^5.0.3"
48
+ },
49
+ "devEngines": {
50
+ "packageManager": {
51
+ "name": "pnpm",
52
+ "version": "12.10.1",
53
+ "onFail": "error"
54
+ },
55
+ "runtime": {
56
+ "name": "node",
57
+ "version": "^26",
58
+ "onFail": "warn"
59
+ }
60
+ },
61
+ "engines": {
62
+ "node": ">= 18"
63
+ },
64
+ "scripts": {
65
+ "test": "vitest",
66
+ "update-gha": "pin-github-action .github/workflows"
67
+ }
68
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-code-intelligence",
3
- "version": "9.1.1",
3
+ "version": "10.0.0",
4
4
  "description": "LSP and AST navigation, search, diagnostics, and refactoring",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,17 +34,21 @@
34
34
  "src/**/*.ts"
35
35
  ],
36
36
  "dependencies": {
37
+ "ignore": "^7.0.12",
38
+ "smol-toml": "^1.9.1",
37
39
  "yaml": "^2.9.0",
38
- "@mrclrchtr/supi-code-runtime": "9.1.1",
39
- "@mrclrchtr/supi-core": "9.1.1",
40
- "@mrclrchtr/supi-lsp": "9.1.1",
41
- "@mrclrchtr/supi-tree-sitter": "9.1.1"
40
+ "@mrclrchtr/supi-code-runtime": "10.0.0",
41
+ "@mrclrchtr/supi-core": "10.0.0",
42
+ "@mrclrchtr/supi-tree-sitter": "10.0.0",
43
+ "@mrclrchtr/supi-lsp": "10.0.0"
42
44
  },
43
45
  "bundledDependencies": [
44
46
  "@mrclrchtr/supi-code-runtime",
45
47
  "@mrclrchtr/supi-core",
46
48
  "@mrclrchtr/supi-lsp",
47
49
  "@mrclrchtr/supi-tree-sitter",
50
+ "ignore",
51
+ "smol-toml",
48
52
  "yaml"
49
53
  ],
50
54
  "peerDependencies": {
@@ -27,6 +27,8 @@ export interface EvidenceListMetadata {
27
27
  /** Known collected atoms hidden by presentation; null when not tracked. */
28
28
  omittedCount: number | null;
29
29
  partialReason: EvidencePartialReason | null;
30
+ /** Provider explanation for incomplete collection, when available. */
31
+ partialMessage?: string;
30
32
  /** Unusable semantic-provider locations excluded from valid evidence totals. */
31
33
  invalidLocationCount?: number;
32
34
  }
@@ -133,9 +133,9 @@ export async function resolveSymbolTarget(
133
133
  }
134
134
  if (result.data.length === 0) return emptySymbolOutcome(symbol, result, options?.path);
135
135
 
136
- const scoped = result.data.filter((candidate) =>
137
- scopePath ? isWithinOrEqual(scopePath, candidate.file) : true,
138
- );
136
+ const scoped = result.data
137
+ .filter((candidate) => (scopePath ? isWithinOrEqual(scopePath, candidate.file) : true))
138
+ .sort((a, b) => Number(b.name === symbol) - Number(a.name === symbol));
139
139
  const eligible = options?.exportedOnly
140
140
  ? scoped.filter((candidate) => !NON_EXPORTED_KINDS.has(candidate.kind))
141
141
  : scoped;
@@ -187,9 +187,18 @@ function normalizeProviderKind(kind: string): string {
187
187
  }
188
188
 
189
189
  async function resolveCandidates(
190
- options: CandidateOutcomeBase & Pick<TargetCandidateCompleteness, "totalCount" | "partialReason">,
190
+ options: CandidateOutcomeBase & Omit<TargetCandidateCompleteness, "omittedCount">,
191
191
  ): Promise<TargetOutcome> {
192
- const { candidates, semantic, cwd, maxResults, control, totalCount, partialReason } = options;
192
+ const {
193
+ candidates,
194
+ semantic,
195
+ cwd,
196
+ maxResults,
197
+ control,
198
+ totalCount,
199
+ partialReason,
200
+ partialMessage,
201
+ } = options;
193
202
  const ranged = candidates.filter(
194
203
  (candidate) =>
195
204
  candidate.declarationAnchor.line > 0 || candidate.declarationAnchor.character > 0,
@@ -205,6 +214,7 @@ async function resolveCandidates(
205
214
  maxResults,
206
215
  totalCount,
207
216
  partialReason,
217
+ partialMessage,
208
218
  control,
209
219
  });
210
220
  }
@@ -241,14 +251,14 @@ interface CandidateOutcomeBase {
241
251
  function candidateCompleteness(
242
252
  result: Exclude<CodeQueryResult<CodeSymbol[]>, { kind: "unavailable" }>,
243
253
  totalCount: number,
244
- ): Pick<TargetCandidateCompleteness, "totalCount" | "partialReason"> {
254
+ ): Omit<TargetCandidateCompleteness, "omittedCount"> {
245
255
  return result.kind === "partial"
246
- ? { totalCount: null, partialReason: "provider-limited" }
256
+ ? { totalCount: null, partialReason: "provider-limited", partialMessage: result.reason }
247
257
  : { totalCount, partialReason: null };
248
258
  }
249
259
 
250
260
  type CandidateOutcomeOptions = CandidateOutcomeBase &
251
- Pick<TargetCandidateCompleteness, "totalCount" | "partialReason"> &
261
+ Omit<TargetCandidateCompleteness, "omittedCount"> &
252
262
  (
253
263
  | { kind: "disambiguation"; requestedKind?: never }
254
264
  | { kind: "kind-mismatch"; requestedKind: TargetSymbolKind }
@@ -290,6 +300,7 @@ async function buildCandidateOutcome(
290
300
  totalCount: options.totalCount,
291
301
  omittedCount: Math.max(0, options.candidates.length - cap),
292
302
  partialReason: options.partialReason,
303
+ partialMessage: options.partialMessage,
293
304
  };
294
305
  return options.kind === "kind-mismatch"
295
306
  ? {
@@ -144,6 +144,8 @@ export interface TargetCandidateCompleteness {
144
144
  omittedCount: number;
145
145
  /** Why the provider cannot establish an exact candidate total. */
146
146
  partialReason: "provider-limited" | null;
147
+ /** Provider explanation for incomplete discovery, when available. */
148
+ partialMessage?: string;
147
149
  }
148
150
 
149
151
  /**