@ksm0709/context 0.0.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 zenobi.us
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # context
2
+
3
+ Context plugin for Bun
4
+
5
+ > A Bun module created from the [bun-module](https://github.com/zenobi-us/bun-module) template
6
+
7
+ ## Usage
8
+
9
+ <!-- Example usage code goes here -->
10
+
11
+ ## Installation
12
+
13
+ <!-- Installation instructions go here -->
14
+
15
+ ## Development
16
+
17
+ - `mise run build` - Build the module
18
+ - `mise run test` - Run tests
19
+ - `mise run lint` - Lint code
20
+ - `mise run lint:fix` - Fix linting issues
21
+ - `mise run format` - Format code with Prettier
22
+
23
+ ## Release
24
+
25
+ See the [RELEASE.md](RELEASE.md) file for instructions on how to release a new version of the module.
26
+
27
+ ## Contributing
28
+
29
+ Contributions are welcome! Please file issues or submit pull requests on the GitHub repository.
30
+
31
+ ## License
32
+
33
+ See the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,14 @@
1
+ export declare const DEFAULTS: {
2
+ readonly configPath: ".opencode/context/config.jsonc";
3
+ readonly promptDir: ".opencode/context/prompts";
4
+ readonly turnStartFile: "turn-start.md";
5
+ readonly turnEndFile: "turn-end.md";
6
+ readonly knowledgeSources: readonly ["AGENTS.md"];
7
+ };
8
+ export declare const LIMITS: {
9
+ readonly maxPromptFileSize: number;
10
+ readonly maxIndexEntries: 100;
11
+ readonly maxTotalInjectionSize: number;
12
+ readonly maxScanDepth: 3;
13
+ readonly maxSummaryLength: 100;
14
+ };
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,1036 @@
1
+ // @bun
2
+ // src/index.ts
3
+ import { join as join4 } from "path";
4
+
5
+ // node_modules/jsonc-parser/lib/esm/impl/scanner.js
6
+ function createScanner(text, ignoreTrivia = false) {
7
+ const len = text.length;
8
+ let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
9
+ function scanHexDigits(count, exact) {
10
+ let digits = 0;
11
+ let value2 = 0;
12
+ while (digits < count || !exact) {
13
+ let ch = text.charCodeAt(pos);
14
+ if (ch >= 48 && ch <= 57) {
15
+ value2 = value2 * 16 + ch - 48;
16
+ } else if (ch >= 65 && ch <= 70) {
17
+ value2 = value2 * 16 + ch - 65 + 10;
18
+ } else if (ch >= 97 && ch <= 102) {
19
+ value2 = value2 * 16 + ch - 97 + 10;
20
+ } else {
21
+ break;
22
+ }
23
+ pos++;
24
+ digits++;
25
+ }
26
+ if (digits < count) {
27
+ value2 = -1;
28
+ }
29
+ return value2;
30
+ }
31
+ function setPosition(newPosition) {
32
+ pos = newPosition;
33
+ value = "";
34
+ tokenOffset = 0;
35
+ token = 16;
36
+ scanError = 0;
37
+ }
38
+ function scanNumber() {
39
+ let start = pos;
40
+ if (text.charCodeAt(pos) === 48) {
41
+ pos++;
42
+ } else {
43
+ pos++;
44
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
45
+ pos++;
46
+ }
47
+ }
48
+ if (pos < text.length && text.charCodeAt(pos) === 46) {
49
+ pos++;
50
+ if (pos < text.length && isDigit(text.charCodeAt(pos))) {
51
+ pos++;
52
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
53
+ pos++;
54
+ }
55
+ } else {
56
+ scanError = 3;
57
+ return text.substring(start, pos);
58
+ }
59
+ }
60
+ let end = pos;
61
+ if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
62
+ pos++;
63
+ if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
64
+ pos++;
65
+ }
66
+ if (pos < text.length && isDigit(text.charCodeAt(pos))) {
67
+ pos++;
68
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
69
+ pos++;
70
+ }
71
+ end = pos;
72
+ } else {
73
+ scanError = 3;
74
+ }
75
+ }
76
+ return text.substring(start, end);
77
+ }
78
+ function scanString() {
79
+ let result = "", start = pos;
80
+ while (true) {
81
+ if (pos >= len) {
82
+ result += text.substring(start, pos);
83
+ scanError = 2;
84
+ break;
85
+ }
86
+ const ch = text.charCodeAt(pos);
87
+ if (ch === 34) {
88
+ result += text.substring(start, pos);
89
+ pos++;
90
+ break;
91
+ }
92
+ if (ch === 92) {
93
+ result += text.substring(start, pos);
94
+ pos++;
95
+ if (pos >= len) {
96
+ scanError = 2;
97
+ break;
98
+ }
99
+ const ch2 = text.charCodeAt(pos++);
100
+ switch (ch2) {
101
+ case 34:
102
+ result += '"';
103
+ break;
104
+ case 92:
105
+ result += "\\";
106
+ break;
107
+ case 47:
108
+ result += "/";
109
+ break;
110
+ case 98:
111
+ result += "\b";
112
+ break;
113
+ case 102:
114
+ result += "\f";
115
+ break;
116
+ case 110:
117
+ result += `
118
+ `;
119
+ break;
120
+ case 114:
121
+ result += "\r";
122
+ break;
123
+ case 116:
124
+ result += "\t";
125
+ break;
126
+ case 117:
127
+ const ch3 = scanHexDigits(4, true);
128
+ if (ch3 >= 0) {
129
+ result += String.fromCharCode(ch3);
130
+ } else {
131
+ scanError = 4;
132
+ }
133
+ break;
134
+ default:
135
+ scanError = 5;
136
+ }
137
+ start = pos;
138
+ continue;
139
+ }
140
+ if (ch >= 0 && ch <= 31) {
141
+ if (isLineBreak(ch)) {
142
+ result += text.substring(start, pos);
143
+ scanError = 2;
144
+ break;
145
+ } else {
146
+ scanError = 6;
147
+ }
148
+ }
149
+ pos++;
150
+ }
151
+ return result;
152
+ }
153
+ function scanNext() {
154
+ value = "";
155
+ scanError = 0;
156
+ tokenOffset = pos;
157
+ lineStartOffset = lineNumber;
158
+ prevTokenLineStartOffset = tokenLineStartOffset;
159
+ if (pos >= len) {
160
+ tokenOffset = len;
161
+ return token = 17;
162
+ }
163
+ let code = text.charCodeAt(pos);
164
+ if (isWhiteSpace(code)) {
165
+ do {
166
+ pos++;
167
+ value += String.fromCharCode(code);
168
+ code = text.charCodeAt(pos);
169
+ } while (isWhiteSpace(code));
170
+ return token = 15;
171
+ }
172
+ if (isLineBreak(code)) {
173
+ pos++;
174
+ value += String.fromCharCode(code);
175
+ if (code === 13 && text.charCodeAt(pos) === 10) {
176
+ pos++;
177
+ value += `
178
+ `;
179
+ }
180
+ lineNumber++;
181
+ tokenLineStartOffset = pos;
182
+ return token = 14;
183
+ }
184
+ switch (code) {
185
+ case 123:
186
+ pos++;
187
+ return token = 1;
188
+ case 125:
189
+ pos++;
190
+ return token = 2;
191
+ case 91:
192
+ pos++;
193
+ return token = 3;
194
+ case 93:
195
+ pos++;
196
+ return token = 4;
197
+ case 58:
198
+ pos++;
199
+ return token = 6;
200
+ case 44:
201
+ pos++;
202
+ return token = 5;
203
+ case 34:
204
+ pos++;
205
+ value = scanString();
206
+ return token = 10;
207
+ case 47:
208
+ const start = pos - 1;
209
+ if (text.charCodeAt(pos + 1) === 47) {
210
+ pos += 2;
211
+ while (pos < len) {
212
+ if (isLineBreak(text.charCodeAt(pos))) {
213
+ break;
214
+ }
215
+ pos++;
216
+ }
217
+ value = text.substring(start, pos);
218
+ return token = 12;
219
+ }
220
+ if (text.charCodeAt(pos + 1) === 42) {
221
+ pos += 2;
222
+ const safeLength = len - 1;
223
+ let commentClosed = false;
224
+ while (pos < safeLength) {
225
+ const ch = text.charCodeAt(pos);
226
+ if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
227
+ pos += 2;
228
+ commentClosed = true;
229
+ break;
230
+ }
231
+ pos++;
232
+ if (isLineBreak(ch)) {
233
+ if (ch === 13 && text.charCodeAt(pos) === 10) {
234
+ pos++;
235
+ }
236
+ lineNumber++;
237
+ tokenLineStartOffset = pos;
238
+ }
239
+ }
240
+ if (!commentClosed) {
241
+ pos++;
242
+ scanError = 1;
243
+ }
244
+ value = text.substring(start, pos);
245
+ return token = 13;
246
+ }
247
+ value += String.fromCharCode(code);
248
+ pos++;
249
+ return token = 16;
250
+ case 45:
251
+ value += String.fromCharCode(code);
252
+ pos++;
253
+ if (pos === len || !isDigit(text.charCodeAt(pos))) {
254
+ return token = 16;
255
+ }
256
+ case 48:
257
+ case 49:
258
+ case 50:
259
+ case 51:
260
+ case 52:
261
+ case 53:
262
+ case 54:
263
+ case 55:
264
+ case 56:
265
+ case 57:
266
+ value += scanNumber();
267
+ return token = 11;
268
+ default:
269
+ while (pos < len && isUnknownContentCharacter(code)) {
270
+ pos++;
271
+ code = text.charCodeAt(pos);
272
+ }
273
+ if (tokenOffset !== pos) {
274
+ value = text.substring(tokenOffset, pos);
275
+ switch (value) {
276
+ case "true":
277
+ return token = 8;
278
+ case "false":
279
+ return token = 9;
280
+ case "null":
281
+ return token = 7;
282
+ }
283
+ return token = 16;
284
+ }
285
+ value += String.fromCharCode(code);
286
+ pos++;
287
+ return token = 16;
288
+ }
289
+ }
290
+ function isUnknownContentCharacter(code) {
291
+ if (isWhiteSpace(code) || isLineBreak(code)) {
292
+ return false;
293
+ }
294
+ switch (code) {
295
+ case 125:
296
+ case 93:
297
+ case 123:
298
+ case 91:
299
+ case 34:
300
+ case 58:
301
+ case 44:
302
+ case 47:
303
+ return false;
304
+ }
305
+ return true;
306
+ }
307
+ function scanNextNonTrivia() {
308
+ let result;
309
+ do {
310
+ result = scanNext();
311
+ } while (result >= 12 && result <= 15);
312
+ return result;
313
+ }
314
+ return {
315
+ setPosition,
316
+ getPosition: () => pos,
317
+ scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
318
+ getToken: () => token,
319
+ getTokenValue: () => value,
320
+ getTokenOffset: () => tokenOffset,
321
+ getTokenLength: () => pos - tokenOffset,
322
+ getTokenStartLine: () => lineStartOffset,
323
+ getTokenStartCharacter: () => tokenOffset - prevTokenLineStartOffset,
324
+ getTokenError: () => scanError
325
+ };
326
+ }
327
+ function isWhiteSpace(ch) {
328
+ return ch === 32 || ch === 9;
329
+ }
330
+ function isLineBreak(ch) {
331
+ return ch === 10 || ch === 13;
332
+ }
333
+ function isDigit(ch) {
334
+ return ch >= 48 && ch <= 57;
335
+ }
336
+ var CharacterCodes;
337
+ (function(CharacterCodes2) {
338
+ CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
339
+ CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
340
+ CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
341
+ CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
342
+ CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
343
+ CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
344
+ CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
345
+ CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
346
+ CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
347
+ CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
348
+ CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
349
+ CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
350
+ CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
351
+ CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
352
+ CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
353
+ CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
354
+ CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
355
+ CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
356
+ CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
357
+ CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
358
+ CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
359
+ CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
360
+ CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
361
+ CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
362
+ CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
363
+ CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
364
+ CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
365
+ CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
366
+ CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
367
+ CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
368
+ CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
369
+ CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
370
+ CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
371
+ CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
372
+ CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
373
+ CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
374
+ CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
375
+ CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
376
+ CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
377
+ CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
378
+ CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
379
+ CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
380
+ CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
381
+ CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
382
+ CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
383
+ CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
384
+ CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
385
+ CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
386
+ CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
387
+ CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
388
+ CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
389
+ CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
390
+ CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
391
+ CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
392
+ CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
393
+ CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
394
+ CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
395
+ CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
396
+ CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
397
+ CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
398
+ CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
399
+ CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
400
+ CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
401
+ CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
402
+ CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
403
+ CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
404
+ CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
405
+ CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
406
+ CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
407
+ CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
408
+ CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
409
+ CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
410
+ CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
411
+ CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
412
+ CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
413
+ CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
414
+ CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
415
+ CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
416
+ CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
417
+ CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
418
+ })(CharacterCodes || (CharacterCodes = {}));
419
+
420
+ // node_modules/jsonc-parser/lib/esm/impl/string-intern.js
421
+ var cachedSpaces = new Array(20).fill(0).map((_, index) => {
422
+ return " ".repeat(index);
423
+ });
424
+ var maxCachedValues = 200;
425
+ var cachedBreakLinesWithSpaces = {
426
+ " ": {
427
+ "\n": new Array(maxCachedValues).fill(0).map((_, index) => {
428
+ return `
429
+ ` + " ".repeat(index);
430
+ }),
431
+ "\r": new Array(maxCachedValues).fill(0).map((_, index) => {
432
+ return "\r" + " ".repeat(index);
433
+ }),
434
+ "\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
435
+ return `\r
436
+ ` + " ".repeat(index);
437
+ })
438
+ },
439
+ "\t": {
440
+ "\n": new Array(maxCachedValues).fill(0).map((_, index) => {
441
+ return `
442
+ ` + "\t".repeat(index);
443
+ }),
444
+ "\r": new Array(maxCachedValues).fill(0).map((_, index) => {
445
+ return "\r" + "\t".repeat(index);
446
+ }),
447
+ "\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
448
+ return `\r
449
+ ` + "\t".repeat(index);
450
+ })
451
+ }
452
+ };
453
+
454
+ // node_modules/jsonc-parser/lib/esm/impl/parser.js
455
+ var ParseOptions;
456
+ (function(ParseOptions2) {
457
+ ParseOptions2.DEFAULT = {
458
+ allowTrailingComma: false
459
+ };
460
+ })(ParseOptions || (ParseOptions = {}));
461
+ function parse(text, errors = [], options = ParseOptions.DEFAULT) {
462
+ let currentProperty = null;
463
+ let currentParent = [];
464
+ const previousParents = [];
465
+ function onValue(value) {
466
+ if (Array.isArray(currentParent)) {
467
+ currentParent.push(value);
468
+ } else if (currentProperty !== null) {
469
+ currentParent[currentProperty] = value;
470
+ }
471
+ }
472
+ const visitor = {
473
+ onObjectBegin: () => {
474
+ const object = {};
475
+ onValue(object);
476
+ previousParents.push(currentParent);
477
+ currentParent = object;
478
+ currentProperty = null;
479
+ },
480
+ onObjectProperty: (name) => {
481
+ currentProperty = name;
482
+ },
483
+ onObjectEnd: () => {
484
+ currentParent = previousParents.pop();
485
+ },
486
+ onArrayBegin: () => {
487
+ const array = [];
488
+ onValue(array);
489
+ previousParents.push(currentParent);
490
+ currentParent = array;
491
+ currentProperty = null;
492
+ },
493
+ onArrayEnd: () => {
494
+ currentParent = previousParents.pop();
495
+ },
496
+ onLiteralValue: onValue,
497
+ onError: (error, offset, length) => {
498
+ errors.push({ error, offset, length });
499
+ }
500
+ };
501
+ visit(text, visitor, options);
502
+ return currentParent[0];
503
+ }
504
+ function visit(text, visitor, options = ParseOptions.DEFAULT) {
505
+ const _scanner = createScanner(text, false);
506
+ const _jsonPath = [];
507
+ let suppressedCallbacks = 0;
508
+ function toNoArgVisit(visitFunction) {
509
+ return visitFunction ? () => suppressedCallbacks === 0 && visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
510
+ }
511
+ function toOneArgVisit(visitFunction) {
512
+ return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
513
+ }
514
+ function toOneArgVisitWithPath(visitFunction) {
515
+ return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
516
+ }
517
+ function toBeginVisit(visitFunction) {
518
+ return visitFunction ? () => {
519
+ if (suppressedCallbacks > 0) {
520
+ suppressedCallbacks++;
521
+ } else {
522
+ let cbReturn = visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice());
523
+ if (cbReturn === false) {
524
+ suppressedCallbacks = 1;
525
+ }
526
+ }
527
+ } : () => true;
528
+ }
529
+ function toEndVisit(visitFunction) {
530
+ return visitFunction ? () => {
531
+ if (suppressedCallbacks > 0) {
532
+ suppressedCallbacks--;
533
+ }
534
+ if (suppressedCallbacks === 0) {
535
+ visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());
536
+ }
537
+ } : () => true;
538
+ }
539
+ const onObjectBegin = toBeginVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toEndVisit(visitor.onObjectEnd), onArrayBegin = toBeginVisit(visitor.onArrayBegin), onArrayEnd = toEndVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
540
+ const disallowComments = options && options.disallowComments;
541
+ const allowTrailingComma = options && options.allowTrailingComma;
542
+ function scanNext() {
543
+ while (true) {
544
+ const token = _scanner.scan();
545
+ switch (_scanner.getTokenError()) {
546
+ case 4:
547
+ handleError(14);
548
+ break;
549
+ case 5:
550
+ handleError(15);
551
+ break;
552
+ case 3:
553
+ handleError(13);
554
+ break;
555
+ case 1:
556
+ if (!disallowComments) {
557
+ handleError(11);
558
+ }
559
+ break;
560
+ case 2:
561
+ handleError(12);
562
+ break;
563
+ case 6:
564
+ handleError(16);
565
+ break;
566
+ }
567
+ switch (token) {
568
+ case 12:
569
+ case 13:
570
+ if (disallowComments) {
571
+ handleError(10);
572
+ } else {
573
+ onComment();
574
+ }
575
+ break;
576
+ case 16:
577
+ handleError(1);
578
+ break;
579
+ case 15:
580
+ case 14:
581
+ break;
582
+ default:
583
+ return token;
584
+ }
585
+ }
586
+ }
587
+ function handleError(error, skipUntilAfter = [], skipUntil = []) {
588
+ onError(error);
589
+ if (skipUntilAfter.length + skipUntil.length > 0) {
590
+ let token = _scanner.getToken();
591
+ while (token !== 17) {
592
+ if (skipUntilAfter.indexOf(token) !== -1) {
593
+ scanNext();
594
+ break;
595
+ } else if (skipUntil.indexOf(token) !== -1) {
596
+ break;
597
+ }
598
+ token = scanNext();
599
+ }
600
+ }
601
+ }
602
+ function parseString(isValue) {
603
+ const value = _scanner.getTokenValue();
604
+ if (isValue) {
605
+ onLiteralValue(value);
606
+ } else {
607
+ onObjectProperty(value);
608
+ _jsonPath.push(value);
609
+ }
610
+ scanNext();
611
+ return true;
612
+ }
613
+ function parseLiteral() {
614
+ switch (_scanner.getToken()) {
615
+ case 11:
616
+ const tokenValue = _scanner.getTokenValue();
617
+ let value = Number(tokenValue);
618
+ if (isNaN(value)) {
619
+ handleError(2);
620
+ value = 0;
621
+ }
622
+ onLiteralValue(value);
623
+ break;
624
+ case 7:
625
+ onLiteralValue(null);
626
+ break;
627
+ case 8:
628
+ onLiteralValue(true);
629
+ break;
630
+ case 9:
631
+ onLiteralValue(false);
632
+ break;
633
+ default:
634
+ return false;
635
+ }
636
+ scanNext();
637
+ return true;
638
+ }
639
+ function parseProperty() {
640
+ if (_scanner.getToken() !== 10) {
641
+ handleError(3, [], [2, 5]);
642
+ return false;
643
+ }
644
+ parseString(false);
645
+ if (_scanner.getToken() === 6) {
646
+ onSeparator(":");
647
+ scanNext();
648
+ if (!parseValue()) {
649
+ handleError(4, [], [2, 5]);
650
+ }
651
+ } else {
652
+ handleError(5, [], [2, 5]);
653
+ }
654
+ _jsonPath.pop();
655
+ return true;
656
+ }
657
+ function parseObject() {
658
+ onObjectBegin();
659
+ scanNext();
660
+ let needsComma = false;
661
+ while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
662
+ if (_scanner.getToken() === 5) {
663
+ if (!needsComma) {
664
+ handleError(4, [], []);
665
+ }
666
+ onSeparator(",");
667
+ scanNext();
668
+ if (_scanner.getToken() === 2 && allowTrailingComma) {
669
+ break;
670
+ }
671
+ } else if (needsComma) {
672
+ handleError(6, [], []);
673
+ }
674
+ if (!parseProperty()) {
675
+ handleError(4, [], [2, 5]);
676
+ }
677
+ needsComma = true;
678
+ }
679
+ onObjectEnd();
680
+ if (_scanner.getToken() !== 2) {
681
+ handleError(7, [2], []);
682
+ } else {
683
+ scanNext();
684
+ }
685
+ return true;
686
+ }
687
+ function parseArray() {
688
+ onArrayBegin();
689
+ scanNext();
690
+ let isFirstElement = true;
691
+ let needsComma = false;
692
+ while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
693
+ if (_scanner.getToken() === 5) {
694
+ if (!needsComma) {
695
+ handleError(4, [], []);
696
+ }
697
+ onSeparator(",");
698
+ scanNext();
699
+ if (_scanner.getToken() === 4 && allowTrailingComma) {
700
+ break;
701
+ }
702
+ } else if (needsComma) {
703
+ handleError(6, [], []);
704
+ }
705
+ if (isFirstElement) {
706
+ _jsonPath.push(0);
707
+ isFirstElement = false;
708
+ } else {
709
+ _jsonPath[_jsonPath.length - 1]++;
710
+ }
711
+ if (!parseValue()) {
712
+ handleError(4, [], [4, 5]);
713
+ }
714
+ needsComma = true;
715
+ }
716
+ onArrayEnd();
717
+ if (!isFirstElement) {
718
+ _jsonPath.pop();
719
+ }
720
+ if (_scanner.getToken() !== 4) {
721
+ handleError(8, [4], []);
722
+ } else {
723
+ scanNext();
724
+ }
725
+ return true;
726
+ }
727
+ function parseValue() {
728
+ switch (_scanner.getToken()) {
729
+ case 3:
730
+ return parseArray();
731
+ case 1:
732
+ return parseObject();
733
+ case 10:
734
+ return parseString(true);
735
+ default:
736
+ return parseLiteral();
737
+ }
738
+ }
739
+ scanNext();
740
+ if (_scanner.getToken() === 17) {
741
+ if (options.allowEmptyContent) {
742
+ return true;
743
+ }
744
+ handleError(4, [], []);
745
+ return false;
746
+ }
747
+ if (!parseValue()) {
748
+ handleError(4, [], []);
749
+ return false;
750
+ }
751
+ if (_scanner.getToken() !== 17) {
752
+ handleError(9, [], []);
753
+ }
754
+ return true;
755
+ }
756
+
757
+ // node_modules/jsonc-parser/lib/esm/main.js
758
+ var ScanError;
759
+ (function(ScanError2) {
760
+ ScanError2[ScanError2["None"] = 0] = "None";
761
+ ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
762
+ ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
763
+ ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
764
+ ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
765
+ ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
766
+ ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
767
+ })(ScanError || (ScanError = {}));
768
+ var SyntaxKind;
769
+ (function(SyntaxKind2) {
770
+ SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
771
+ SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
772
+ SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
773
+ SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
774
+ SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
775
+ SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
776
+ SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
777
+ SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
778
+ SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
779
+ SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
780
+ SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
781
+ SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
782
+ SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
783
+ SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
784
+ SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
785
+ SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
786
+ SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
787
+ })(SyntaxKind || (SyntaxKind = {}));
788
+ var parse2 = parse;
789
+ var ParseErrorCode;
790
+ (function(ParseErrorCode2) {
791
+ ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
792
+ ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
793
+ ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
794
+ ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
795
+ ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
796
+ ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
797
+ ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
798
+ ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
799
+ ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
800
+ ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
801
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
802
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
803
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
804
+ ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
805
+ ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
806
+ ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
807
+ })(ParseErrorCode || (ParseErrorCode = {}));
808
+
809
+ // src/lib/config.ts
810
+ import { readFileSync } from "fs";
811
+ import { join } from "path";
812
+
813
+ // src/constants.ts
814
+ var DEFAULTS = {
815
+ configPath: ".opencode/context/config.jsonc",
816
+ promptDir: ".opencode/context/prompts",
817
+ turnStartFile: "turn-start.md",
818
+ turnEndFile: "turn-end.md",
819
+ knowledgeSources: ["AGENTS.md"]
820
+ };
821
+ var LIMITS = {
822
+ maxPromptFileSize: 64 * 1024,
823
+ maxIndexEntries: 100,
824
+ maxTotalInjectionSize: 128 * 1024,
825
+ maxScanDepth: 3,
826
+ maxSummaryLength: 100
827
+ };
828
+
829
+ // src/lib/config.ts
830
+ function getDefaultConfig() {
831
+ return {
832
+ prompts: {
833
+ turnStart: join(DEFAULTS.promptDir, DEFAULTS.turnStartFile),
834
+ turnEnd: join(DEFAULTS.promptDir, DEFAULTS.turnEndFile)
835
+ },
836
+ knowledge: {
837
+ sources: [...DEFAULTS.knowledgeSources]
838
+ }
839
+ };
840
+ }
841
+ function mergeWithDefaults(partial) {
842
+ const defaults = getDefaultConfig();
843
+ return {
844
+ prompts: {
845
+ turnStart: partial.prompts?.turnStart ?? defaults.prompts.turnStart,
846
+ turnEnd: partial.prompts?.turnEnd ?? defaults.prompts.turnEnd
847
+ },
848
+ knowledge: {
849
+ sources: partial.knowledge?.sources ?? defaults.knowledge.sources
850
+ }
851
+ };
852
+ }
853
+ function loadConfig(projectDir) {
854
+ const configPath = join(projectDir, DEFAULTS.configPath);
855
+ try {
856
+ const raw = readFileSync(configPath, "utf-8");
857
+ const parsed = parse2(raw);
858
+ if (!parsed || typeof parsed !== "object")
859
+ return getDefaultConfig();
860
+ return mergeWithDefaults(parsed);
861
+ } catch {
862
+ return getDefaultConfig();
863
+ }
864
+ }
865
+
866
+ // src/lib/knowledge-index.ts
867
+ import { readdirSync, readFileSync as readFileSync2, statSync, existsSync } from "fs";
868
+ import { join as join2, relative, extname } from "path";
869
+ function extractSummary(filePath) {
870
+ try {
871
+ const content = readFileSync2(filePath, "utf-8");
872
+ const firstNonEmpty = content.split(`
873
+ `).find((line) => line.trim().length > 0);
874
+ if (!firstNonEmpty)
875
+ return "";
876
+ return firstNonEmpty.trim().slice(0, LIMITS.maxSummaryLength);
877
+ } catch {
878
+ return "";
879
+ }
880
+ }
881
+ function scanDir(dir, projectDir, depth, entries) {
882
+ if (depth > LIMITS.maxScanDepth)
883
+ return;
884
+ if (entries.length >= LIMITS.maxIndexEntries)
885
+ return;
886
+ try {
887
+ const items = readdirSync(dir);
888
+ for (const item of items) {
889
+ if (entries.length >= LIMITS.maxIndexEntries)
890
+ break;
891
+ const fullPath = join2(dir, item);
892
+ try {
893
+ const stat = statSync(fullPath);
894
+ if (stat.isDirectory()) {
895
+ scanDir(fullPath, projectDir, depth + 1, entries);
896
+ } else if (stat.isFile() && extname(item) === ".md") {
897
+ entries.push({
898
+ filename: relative(projectDir, fullPath),
899
+ summary: extractSummary(fullPath)
900
+ });
901
+ }
902
+ } catch {}
903
+ }
904
+ } catch {}
905
+ }
906
+ function buildKnowledgeIndex(projectDir, sources) {
907
+ const entries = [];
908
+ for (const source of sources) {
909
+ if (entries.length >= LIMITS.maxIndexEntries)
910
+ break;
911
+ const fullPath = join2(projectDir, source);
912
+ if (!existsSync(fullPath))
913
+ continue;
914
+ try {
915
+ const stat = statSync(fullPath);
916
+ if (stat.isFile() && extname(source) === ".md") {
917
+ entries.push({
918
+ filename: source,
919
+ summary: extractSummary(fullPath)
920
+ });
921
+ } else if (stat.isDirectory()) {
922
+ scanDir(fullPath, projectDir, 1, entries);
923
+ }
924
+ } catch {}
925
+ }
926
+ return entries;
927
+ }
928
+ function formatKnowledgeIndex(entries) {
929
+ if (entries.length === 0)
930
+ return "";
931
+ const lines = ["## Available Knowledge", ""];
932
+ for (const entry of entries) {
933
+ lines.push(`- ${entry.filename}${entry.summary ? ` \u2014 ${entry.summary}` : ""}`);
934
+ }
935
+ return lines.join(`
936
+ `);
937
+ }
938
+
939
+ // src/lib/prompt-reader.ts
940
+ import { readFileSync as readFileSync3 } from "fs";
941
+ function readPromptFile(filePath) {
942
+ try {
943
+ const content = readFileSync3(filePath, "utf-8");
944
+ if (content.length > LIMITS.maxPromptFileSize) {
945
+ return content.slice(0, LIMITS.maxPromptFileSize);
946
+ }
947
+ return content;
948
+ } catch {
949
+ return "";
950
+ }
951
+ }
952
+
953
+ // src/lib/scaffold.ts
954
+ import { existsSync as existsSync2, mkdirSync, writeFileSync } from "fs";
955
+ import { join as join3 } from "path";
956
+ var DEFAULT_CONFIG = `{
957
+ // Context Plugin Configuration
958
+ // See: https://github.com/ksm0709/context
959
+ "prompts": {
960
+ "turnStart": ".opencode/context/prompts/turn-start.md",
961
+ "turnEnd": ".opencode/context/prompts/turn-end.md"
962
+ },
963
+ "knowledge": {
964
+ "sources": ["AGENTS.md"]
965
+ }
966
+ }`;
967
+ var DEFAULT_TURN_START = `## Knowledge Context
968
+
969
+ \uC774 \uD504\uB85C\uC81D\uD2B8\uC758 \uC9C0\uC2DD \uBCA0\uC774\uC2A4\uB97C \uCC38\uACE0\uD558\uC5EC \uC791\uC5C5\uD558\uC138\uC694.
970
+ - \uC791\uC5C5\uACFC \uAD00\uB828\uB41C \uC9C0\uC2DD \uD30C\uC77C\uC774 \uC788\uC73C\uBA74 \uBA3C\uC800 \uC77D\uACE0 \uCC38\uC870\uD558\uC138\uC694
971
+ - \uC9C0\uC2DD \uAC04 [[\uB9C1\uD06C]]\uB97C \uB530\uB77C\uAC00\uBA70 \uAD00\uB828 \uCEE8\uD14D\uC2A4\uD2B8\uB97C \uD30C\uC545\uD558\uC138\uC694
972
+ - AGENTS.md\uC758 \uC9C0\uC2DC\uC0AC\uD56D\uC744 \uC900\uC218\uD558\uC138\uC694
973
+ `;
974
+ var DEFAULT_TURN_END = `## \uC791\uC5C5 \uB9C8\uBB34\uB9AC \uCCB4\uD06C\uB9AC\uC2A4\uD2B8
975
+
976
+ \uC791\uC5C5\uC744 \uC644\uB8CC\uD558\uAE30 \uC804\uC5D0 \uBC18\uB4DC\uC2DC:
977
+
978
+ ### \uD004\uB9AC\uD2F0 \uBCF4\uC7A5
979
+ - [ ] \uBCC0\uACBD\uD55C \uCF54\uB4DC\uC5D0 \uB300\uD574 lint \uC2E4\uD589
980
+ - [ ] \uD0C0\uC785 \uC5D0\uB7EC \uD655\uC778
981
+ - [ ] \uAE30\uC874 \uD14C\uC2A4\uD2B8 \uD1B5\uACFC \uD655\uC778
982
+
983
+ ### \uC9C0\uC2DD \uC815\uB9AC
984
+ - [ ] \uC0C8\uB85C \uC54C\uAC8C \uB41C \uC911\uC694\uD55C \uD328\uD134/\uACB0\uC815\uC774 \uC788\uC73C\uBA74 \uC9C0\uC2DD \uD30C\uC77C\uB85C \uC815\uB9AC
985
+ `;
986
+ function scaffoldIfNeeded(projectDir) {
987
+ const contextDir = join3(projectDir, ".opencode", "context");
988
+ if (existsSync2(contextDir)) {
989
+ return false;
990
+ }
991
+ try {
992
+ const promptsDir = join3(contextDir, "prompts");
993
+ mkdirSync(promptsDir, { recursive: true });
994
+ writeFileSync(join3(contextDir, "config.jsonc"), DEFAULT_CONFIG, "utf-8");
995
+ writeFileSync(join3(promptsDir, DEFAULTS.turnStartFile), DEFAULT_TURN_START, "utf-8");
996
+ writeFileSync(join3(promptsDir, DEFAULTS.turnEndFile), DEFAULT_TURN_END, "utf-8");
997
+ return true;
998
+ } catch {
999
+ return false;
1000
+ }
1001
+ }
1002
+
1003
+ // src/index.ts
1004
+ var plugin = async ({ directory, client }) => {
1005
+ const scaffolded = scaffoldIfNeeded(directory);
1006
+ if (scaffolded) {
1007
+ await client.app.log({
1008
+ body: {
1009
+ service: "context",
1010
+ level: "info",
1011
+ message: "Scaffold created at .opencode/context/"
1012
+ }
1013
+ });
1014
+ }
1015
+ const config = loadConfig(directory);
1016
+ return {
1017
+ "experimental.chat.system.transform": async (_input, output) => {
1018
+ const turnStartPath = join4(directory, config.prompts.turnStart ?? join4(DEFAULTS.promptDir, DEFAULTS.turnStartFile));
1019
+ const turnEndPath = join4(directory, config.prompts.turnEnd ?? join4(DEFAULTS.promptDir, DEFAULTS.turnEndFile));
1020
+ const turnStart = readPromptFile(turnStartPath);
1021
+ const turnEnd = readPromptFile(turnEndPath);
1022
+ const entries = buildKnowledgeIndex(directory, config.knowledge.sources);
1023
+ const indexContent = formatKnowledgeIndex(entries);
1024
+ if (turnStart)
1025
+ output.system.push(turnStart);
1026
+ if (indexContent)
1027
+ output.system.push(indexContent);
1028
+ if (turnEnd)
1029
+ output.system.push(turnEnd);
1030
+ }
1031
+ };
1032
+ };
1033
+ var src_default = plugin;
1034
+ export {
1035
+ src_default as default
1036
+ };
@@ -0,0 +1,13 @@
1
+ export interface ContextConfig {
2
+ prompts: {
3
+ turnStart?: string;
4
+ turnEnd?: string;
5
+ };
6
+ knowledge: {
7
+ sources: string[];
8
+ };
9
+ }
10
+ export interface KnowledgeEntry {
11
+ filename: string;
12
+ summary: string;
13
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@ksm0709/context",
3
+ "version": "0.0.1",
4
+ "description": "Intent tools for Bun",
5
+ "author": {
6
+ "name": "TaehoKang",
7
+ "email": "ksm07091@gmail.com"
8
+ },
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git@github.com:ksm0709/context.git"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "src/version.ts"
26
+ ],
27
+ "peerDependencies": {
28
+ "@opencode-ai/plugin": ">=1.0.0"
29
+ },
30
+ "dependencies": {
31
+ "jsonc-parser": "^3.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@opencode-ai/plugin": "^1.2.10",
35
+ "@eslint/js": "^9.39.1",
36
+ "@types/node": "^20.11.5",
37
+ "@typescript-eslint/eslint-plugin": "8.47.0",
38
+ "@typescript-eslint/parser": "8.47.0",
39
+ "bun-types": "latest",
40
+ "eslint": "^9.39.1",
41
+ "eslint-config-prettier": "10.1.8",
42
+ "eslint-plugin-prettier": "^5.1.3",
43
+ "prettier": "^3.2.4",
44
+ "typescript-eslint": "^8.47.0",
45
+ "vitest": "^3.2.4"
46
+ }
47
+ }