githits 0.3.1 → 0.3.3

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  version
3
- } from "./shared/chunk-m1xx8hzw.js";
3
+ } from "./shared/chunk-tze0rsay.js";
4
4
  export {
5
5
  version
6
6
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __require,
3
3
  version
4
- } from "./chunk-m1xx8hzw.js";
4
+ } from "./chunk-tze0rsay.js";
5
5
 
6
6
  // src/services/app-config-paths.ts
7
7
  var APP_DIR = "githits";
@@ -278,43 +278,121 @@ function parseRefreshTokenResponse(data) {
278
278
  }
279
279
  function successHtml(title = "Authentication successful") {
280
280
  return `<!DOCTYPE html>
281
- <html><head><title>GitHits CLI</title>
281
+ <html><head>
282
+ <title>GitHits CLI</title>
283
+ <meta charset="utf-8">
284
+ <link rel="preconnect" href="https://fonts.googleapis.com">
285
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
286
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Lexend:wght@600&display=swap" rel="stylesheet">
282
287
  <style>
288
+ *, *::before, *::after { box-sizing: border-box; }
283
289
  body {
284
- font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
290
+ margin: 0;
291
+ min-height: 100vh;
292
+ width: 100%;
293
+ padding: 16px;
294
+ background: #21262d;
295
+ color: #ffffff;
296
+ font-family: 'Inter', sans-serif;
285
297
  display: flex;
298
+ align-items: center;
286
299
  justify-content: center;
300
+ }
301
+ .content {
302
+ display: flex;
303
+ flex-direction: column;
304
+ align-items: center;
305
+ gap: 20px;
306
+ padding: 0 16px;
307
+ }
308
+ .message {
309
+ display: flex;
310
+ flex-direction: column;
287
311
  align-items: center;
288
- height: 100vh;
312
+ gap: 8px;
313
+ }
314
+ .success-icon {
315
+ width: 48px;
316
+ height: 48px;
317
+ border-radius: 50%;
318
+ border: 2px solid #57fec9;
319
+ background: transparent;
320
+ display: flex;
321
+ align-items: center;
322
+ justify-content: center;
323
+ }
324
+ .heading {
325
+ font-family: 'Lexend', sans-serif;
326
+ font-weight: 600;
327
+ font-size: 32px;
328
+ line-height: 40px;
329
+ color: #ffffff;
289
330
  margin: 0;
290
- background: radial-gradient(circle at center center, #4d3648, #3a2835, #261a22, #0d1117);
331
+ text-align: center;
332
+ text-wrap: pretty;
291
333
  }
292
- .card {
334
+ .text {
335
+ font-family: 'Inter', sans-serif;
336
+ font-weight: 400;
337
+ font-size: 16px;
338
+ line-height: 24px;
339
+ margin: 0;
293
340
  text-align: center;
294
- background: rgba(13, 17, 23, 0.75);
295
- padding: 3rem;
296
- border-radius: 16px;
297
- border: 1px solid rgba(244, 11, 166, 0.35);
298
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
299
- max-width: 720px;
300
- }
301
- h1 {
302
- color: #f40ba6;
303
- margin-bottom: 0.75rem;
304
- font-size: 3rem;
305
- font-weight: 700;
306
- }
307
- p {
308
- color: #f385a5;
309
- font-size: 1.1rem;
341
+ text-wrap: pretty;
342
+ }
343
+ .text-muted {
344
+ color: #abb2bf;
345
+ }
346
+ .tip {
347
+ font-family: 'Inter', sans-serif;
348
+ font-weight: 400;
349
+ font-size: 14px;
350
+ line-height: 20px;
351
+ color: #abb2bf;
310
352
  margin: 0;
353
+ text-align: center;
354
+ text-wrap: pretty;
355
+ }
356
+ .tip-label {
357
+ font-weight: 600;
358
+ color: #ffffff;
359
+ }
360
+ code {
361
+ font-family: 'Consolas', monospace;
362
+ font-size: 13px;
363
+ background: rgba(255, 255, 255, 0.08);
364
+ padding: 1px 6px;
365
+ border-radius: 4px;
366
+ color: #ffffff;
311
367
  }
312
368
  </style>
313
369
  </head>
314
370
  <body>
315
- <div class="card">
316
- <h1>${escapeHtml(title)}</h1>
317
- <p>You can close this window and return to the terminal.</p>
371
+ <div class="content">
372
+ <div class="success-icon" aria-hidden="true">
373
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="#57fec9" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
374
+ <polyline points="20 6 9 17 4 12" />
375
+ </svg>
376
+ </div>
377
+ <div class="message">
378
+ <h1 class="heading">${escapeHtml(title)}</h1>
379
+ <p class="text text-muted">You can close this window and return to the terminal.</p>
380
+ </div>
381
+
382
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 554 129.3" width="103" height="24" role="img" aria-label="GitHits">
383
+ <title>GitHits</title>
384
+ <defs>
385
+ <linearGradient id="wm-grad" x1="234.9" y1="64.7" x2="555.5" y2="64.7" gradientUnits="userSpaceOnUse">
386
+ <stop offset="0" style="stop-color: #ff4fae" />
387
+ <stop offset="1" style="stop-color: #ff872f" />
388
+ </linearGradient>
389
+ </defs>
390
+ <path d="M148.6,29.1c7.9,0,14.4-6.4,14.4-14.4S156.6.3,148.6.3s-14.4,6.4-14.4,14.4,6.4,14.4,14.4,14.4Z" fill="#ff4fae" />
391
+ <path d="M383.9,29.1c7.9,0,14.4-6.4,14.4-14.4s-6.4-14.4-14.4-14.4-14.4,6.4-14.4,14.4,6.4,14.4,14.4,14.4ZM396.4,40.8h-25v86.6h25V40.8ZM454.3,8.5h-25v32.3h-18.8v24h18.8v62.6h25v-62.6h18.8v-24h-18.8V8.5ZM553.1,92.2c-.9-2.6-2.2-4.9-4.1-6.9-2.2-2.4-5.1-4.4-8.8-6.2-3.7-1.8-8.2-3.4-13.4-4.9-4.1-1.1-7.3-2.1-9.6-3-2.4-.9-4.1-1.7-5.3-2.4-1.1-.8-1.9-1.7-2.5-2.9-.6-1.1-.9-2.3-.9-3.5s.2-2.4.7-3.4,1.2-1.9,2.2-2.6c1-.7,2.2-1.3,3.7-1.6s3.2-.5,5-.5,4.5.4,7.1,1.3c2.6.9,5.2,2.1,7.7,3.7,2.5,1.6,4.7,3.3,6.7,5.2l12.5-14.2c-2.8-2.8-6-5.2-9.6-7.3-3.7-2.1-7.7-3.7-11.9-4.8-4.3-1.1-8.7-1.7-13.2-1.7s-8.8.7-12.9,1.9c-4.1,1.3-7.7,3.1-10.8,5.5s-5.6,5.2-7.3,8.5c-1.8,3.3-2.6,7-2.6,11s.5,6.4,1.6,9.2c1,2.8,2.5,5.3,4.5,7.7,2.3,2.5,5.4,4.7,9.3,6.7s8.6,3.7,14.2,5.1c3.6,1,6.6,1.9,8.9,2.8,2.3.8,4,1.6,5.1,2.3,2,1.4,3,3.3,3,5.7s-.2,2.4-.7,3.5-1.2,2-2.2,2.7-2.2,1.3-3.5,1.7c-1.4.4-2.9.6-4.5.6-4.2,0-8.4-.8-12.5-2.5-4.2-1.6-7.9-4.3-11.2-8l-14.7,12.8c3.8,4.8,8.9,8.6,15.2,11.4,6.3,2.8,13.5,4.1,21.7,4.1s12.5-1.2,17.8-3.7,9.4-5.8,12.4-10.1c3-4.3,4.5-9.2,4.5-14.7s-.4-6-1.3-8.6h-.3ZM327.2,60.5h-50.2V6h-25v121.4h25v-42.8h50.2v42.8h25V6h-25v54.5Z" fill="url(#wm-grad)" />
392
+ <path d="M239.1,64.8v-24h-18.8V8.5h-25v32.3h-18.8v24h18.8v62.6h25v-62.6h18.8ZM161.1,40.8h-25v86.6h25V40.8ZM91.6,84.6h-26.8v-24h54s1.2,4.3,1.1,12.1c-.3,30.6-25.3,55.5-55.9,55.7h-.5C27.4,128.4-1.6,98.3,0,61.8,1.5,29.6,27.4,3.4,59.6,1.4c21-1.2,40,7.7,52.4,22.4l-17.2,17.2c-7.7-10.1-20.3-16.4-34.3-15.4-19.4,1.4-35,17.1-36.4,36.5-1.6,23,16.6,42.2,39.3,42.2s28-19.7,28-19.7h.2Z" fill="#ff4fae" />
393
+ </svg>
394
+
395
+ <p class="tip"><span class="tip-label">TIP:</span> Run <code>npx githits --help</code> to discover what else you can do.</p>
318
396
  </div>
319
397
  </body></html>`;
320
398
  }
@@ -356,44 +434,121 @@ function evaluateCallback(input) {
356
434
  function errorHtml(error, nextStep) {
357
435
  const nextStepHtml = nextStep ? `<p>${escapeHtml(nextStep)}</p>` : "";
358
436
  return `<!DOCTYPE html>
359
- <html><head><title>GitHits CLI</title>
437
+ <html><head>
438
+ <title>GitHits CLI</title>
439
+ <meta charset="utf-8">
440
+ <link rel="preconnect" href="https://fonts.googleapis.com">
441
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
442
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Lexend:wght@600&display=swap" rel="stylesheet">
360
443
  <style>
444
+ *, *::before, *::after { box-sizing: border-box; }
361
445
  body {
362
- font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
446
+ margin: 0;
447
+ min-height: 100vh;
448
+ width: 100%;
449
+ padding: 16px;
450
+ background: #21262d;
451
+ color: #ffffff;
452
+ font-family: 'Inter', sans-serif;
363
453
  display: flex;
454
+ align-items: center;
364
455
  justify-content: center;
456
+ }
457
+ .content {
458
+ display: flex;
459
+ flex-direction: column;
460
+ align-items: center;
461
+ gap: 20px;
462
+ padding: 0 16px;
463
+ }
464
+ .message {
465
+ display: flex;
466
+ flex-direction: column;
467
+ align-items: center;
468
+ gap: 8px;
469
+ }
470
+ .error-icon {
471
+ width: 48px;
472
+ height: 48px;
473
+ border-radius: 50%;
474
+ border: 2px solid #ff5a6a;
475
+ background: transparent;
476
+ display: flex;
365
477
  align-items: center;
366
- height: 100vh;
478
+ justify-content: center;
479
+ }
480
+ .heading {
481
+ font-family: 'Lexend', sans-serif;
482
+ font-weight: 600;
483
+ font-size: 32px;
484
+ line-height: 40px;
485
+ color: #ffffff;
367
486
  margin: 0;
368
- background: radial-gradient(circle at center center, #4d3648, #3a2835, #261a22, #0d1117);
487
+ text-align: center;
488
+ text-wrap: pretty;
369
489
  }
370
- .card {
490
+ .text {
491
+ font-family: 'Inter', sans-serif;
492
+ font-weight: 400;
493
+ font-size: 16px;
494
+ line-height: 24px;
495
+ margin: 0;
371
496
  text-align: center;
372
- background: rgba(13, 17, 23, 0.75);
373
- padding: 3rem;
374
- border-radius: 16px;
375
- border: 1px solid rgba(239, 68, 68, 0.35);
376
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
377
- max-width: 720px;
378
- }
379
- h1 {
380
- color: #ef4444;
381
- margin-bottom: 0.75rem;
382
- font-size: 3rem;
383
- font-weight: 700;
384
- }
385
- p {
386
- color: #f385a5;
387
- font-size: 1.1rem;
497
+ text-wrap: pretty;
498
+ }
499
+ .text-muted {
500
+ color: #abb2bf;
501
+ }
502
+ .footer-text {
503
+ font-family: 'Inter', sans-serif;
504
+ font-weight: 400;
505
+ font-size: 14px;
506
+ line-height: 20px;
507
+ color: #abb2bf;
388
508
  margin: 0;
509
+ text-align: center;
510
+ text-wrap: pretty;
511
+ }
512
+ .footer-link {
513
+ color: #ffffff;
514
+ text-decoration: underline;
515
+ text-underline-offset: 2px;
516
+ }
517
+ .footer-link:hover {
518
+ color: #abb2bf;
389
519
  }
390
520
  </style>
391
521
  </head>
392
522
  <body>
393
- <div class="card">
394
- <h1>Authentication failed</h1>
395
- <p>${escapeHtml(error)}</p>
523
+ <div class="content">
524
+ <div class="error-icon" aria-hidden="true">
525
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="#ff5a6a" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
526
+ <line x1="18" y1="6" x2="6" y2="18"/>
527
+ <line x1="6" y1="6" x2="18" y2="18"/>
528
+ </svg>
529
+ </div>
530
+
531
+ <div class="message">
532
+ <h1 class="heading">Authentication failed</h1>
533
+ <p class="text text-muted">${escapeHtml(error)}</p>
534
+ </div>
535
+
396
536
  ${nextStepHtml}
537
+
538
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 554 129.3" width="103" height="24" role="img" aria-label="GitHits">
539
+ <title>GitHits</title>
540
+ <defs>
541
+ <linearGradient id="wm-grad" x1="234.9" y1="64.7" x2="555.5" y2="64.7" gradientUnits="userSpaceOnUse">
542
+ <stop offset="0" style="stop-color: #ff4fae" />
543
+ <stop offset="1" style="stop-color: #ff872f" />
544
+ </linearGradient>
545
+ </defs>
546
+ <path d="M148.6,29.1c7.9,0,14.4-6.4,14.4-14.4S156.6.3,148.6.3s-14.4,6.4-14.4,14.4,6.4,14.4,14.4,14.4Z" fill="#ff4fae" />
547
+ <path d="M383.9,29.1c7.9,0,14.4-6.4,14.4-14.4s-6.4-14.4-14.4-14.4-14.4,6.4-14.4,14.4,6.4,14.4,14.4,14.4ZM396.4,40.8h-25v86.6h25V40.8ZM454.3,8.5h-25v32.3h-18.8v24h18.8v62.6h25v-62.6h18.8v-24h-18.8V8.5ZM553.1,92.2c-.9-2.6-2.2-4.9-4.1-6.9-2.2-2.4-5.1-4.4-8.8-6.2-3.7-1.8-8.2-3.4-13.4-4.9-4.1-1.1-7.3-2.1-9.6-3-2.4-.9-4.1-1.7-5.3-2.4-1.1-.8-1.9-1.7-2.5-2.9-.6-1.1-.9-2.3-.9-3.5s.2-2.4.7-3.4,1.2-1.9,2.2-2.6c1-.7,2.2-1.3,3.7-1.6s3.2-.5,5-.5,4.5.4,7.1,1.3c2.6.9,5.2,2.1,7.7,3.7,2.5,1.6,4.7,3.3,6.7,5.2l12.5-14.2c-2.8-2.8-6-5.2-9.6-7.3-3.7-2.1-7.7-3.7-11.9-4.8-4.3-1.1-8.7-1.7-13.2-1.7s-8.8.7-12.9,1.9c-4.1,1.3-7.7,3.1-10.8,5.5s-5.6,5.2-7.3,8.5c-1.8,3.3-2.6,7-2.6,11s.5,6.4,1.6,9.2c1,2.8,2.5,5.3,4.5,7.7,2.3,2.5,5.4,4.7,9.3,6.7s8.6,3.7,14.2,5.1c3.6,1,6.6,1.9,8.9,2.8,2.3.8,4,1.6,5.1,2.3,2,1.4,3,3.3,3,5.7s-.2,2.4-.7,3.5-1.2,2-2.2,2.7-2.2,1.3-3.5,1.7c-1.4.4-2.9.6-4.5.6-4.2,0-8.4-.8-12.5-2.5-4.2-1.6-7.9-4.3-11.2-8l-14.7,12.8c3.8,4.8,8.9,8.6,15.2,11.4,6.3,2.8,13.5,4.1,21.7,4.1s12.5-1.2,17.8-3.7,9.4-5.8,12.4-10.1c3-4.3,4.5-9.2,4.5-14.7s-.4-6-1.3-8.6h-.3ZM327.2,60.5h-50.2V6h-25v121.4h25v-42.8h50.2v42.8h25V6h-25v54.5Z" fill="url(#wm-grad)" />
548
+ <path d="M239.1,64.8v-24h-18.8V8.5h-25v32.3h-18.8v24h18.8v62.6h25v-62.6h18.8ZM161.1,40.8h-25v86.6h25V40.8ZM91.6,84.6h-26.8v-24h54s1.2,4.3,1.1,12.1c-.3,30.6-25.3,55.5-55.9,55.7h-.5C27.4,128.4-1.6,98.3,0,61.8,1.5,29.6,27.4,3.4,59.6,1.4c21-1.2,40,7.7,52.4,22.4l-17.2,17.2c-7.7-10.1-20.3-16.4-34.3-15.4-19.4,1.4-35,17.1-36.4,36.5-1.6,23,16.6,42.2,39.3,42.2s28-19.7,28-19.7h.2Z" fill="#ff4fae" />
549
+ </svg>
550
+
551
+ <p class="footer-text">Having trouble? Check our <a class="footer-link" href="https://app.githits.com/docs/" target="_blank" rel="noopener noreferrer">documentation</a> or contact <a class="footer-link" href="mailto:support@githits.com">support</a>.</p>
397
552
  </div>
398
553
  </body></html>`;
399
554
  }
@@ -1670,6 +1825,16 @@ query ListRepoFiles(
1670
1825
  $gitRef: String
1671
1826
  $version: String
1672
1827
  $pathPrefix: String
1828
+ $pathSelectors: [FilePathSelectorInput!]
1829
+ $extensions: [String!]
1830
+ $fileTypes: [String!]
1831
+ $languages: [String!]
1832
+ $fileIntent: FileIntent
1833
+ $fileIntents: [FileIntent!]
1834
+ $excludeFileIntents: [FileIntent!]
1835
+ $excludeDocFiles: Boolean
1836
+ $excludeTestFiles: Boolean
1837
+ $includeHidden: Boolean
1673
1838
  $limit: Int
1674
1839
  $waitTimeoutMs: Int
1675
1840
  ) {
@@ -1680,6 +1845,16 @@ query ListRepoFiles(
1680
1845
  gitRef: $gitRef
1681
1846
  version: $version
1682
1847
  pathPrefix: $pathPrefix
1848
+ pathSelectors: $pathSelectors
1849
+ extensions: $extensions
1850
+ fileTypes: $fileTypes
1851
+ languages: $languages
1852
+ fileIntent: $fileIntent
1853
+ fileIntents: $fileIntents
1854
+ excludeFileIntents: $excludeFileIntents
1855
+ excludeDocFiles: $excludeDocFiles
1856
+ excludeTestFiles: $excludeTestFiles
1857
+ includeHidden: $includeHidden
1683
1858
  limit: $limit
1684
1859
  waitTimeoutMs: $waitTimeoutMs
1685
1860
  ) {
@@ -2294,6 +2469,19 @@ class CodeNavigationServiceImpl {
2294
2469
  gitRef: params.target.gitRef,
2295
2470
  version: params.target.version,
2296
2471
  pathPrefix: params.pathPrefix,
2472
+ pathSelectors: params.pathSelectors?.map((entry) => ({
2473
+ kind: entry.kind,
2474
+ value: entry.value
2475
+ })),
2476
+ extensions: params.extensions,
2477
+ fileTypes: params.fileTypes,
2478
+ languages: params.languages,
2479
+ fileIntent: params.fileIntent,
2480
+ fileIntents: params.fileIntents,
2481
+ excludeFileIntents: params.excludeFileIntents,
2482
+ excludeDocFiles: params.excludeDocFiles,
2483
+ excludeTestFiles: params.excludeTestFiles,
2484
+ includeHidden: params.includeHidden,
2297
2485
  limit: params.limit,
2298
2486
  waitTimeoutMs: params.waitTimeoutMs
2299
2487
  },
@@ -2,8 +2,8 @@ import {
2
2
  createAuthCommandDependencies,
3
3
  createAuthStatusDependencies,
4
4
  createContainer
5
- } from "./chunk-0s7mxdt3.js";
6
- import"./chunk-m1xx8hzw.js";
5
+ } from "./chunk-2d202fpq.js";
6
+ import"./chunk-tze0rsay.js";
7
7
  export {
8
8
  createContainer,
9
9
  createAuthStatusDependencies,
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
3
  // package.json
4
- var version = "0.3.1";
4
+ var version = "0.3.3";
5
5
 
6
6
  export { __require, version };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githits",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Code examples from global open source for developers and AI assistants.",
5
5
  "mcpServers": {
6
6
  "githits": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "githits",
3
3
  "description": "CLI companion for GitHits - code examples from global open source for developers and AI assistants",
4
- "version": "0.3.1",
4
+ "version": "0.3.3",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -33,6 +33,8 @@
33
33
  "build": "bunup --dts --target node --packages=external --exports && chmod +x dist/cli.js",
34
34
  "dev": "bun run ./src/cli.ts",
35
35
  "inspector": "npx @modelcontextprotocol/inspector bun run dev mcp",
36
+ "smoke:cli": "bun run scripts/cli-smoke.ts",
37
+ "smoke:mcp": "bun run scripts/mcp-smoke.ts",
36
38
  "test": "bun test",
37
39
  "typecheck": "tsc",
38
40
  "format": "biome format --write .",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githits",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Code examples from global open source for developers and AI assistants",
5
5
  "author": {
6
6
  "name": "GitHits"