@kenkaiiii/gg-core 5.91.0 → 5.91.2

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/NOTICE ADDED
@@ -0,0 +1,52 @@
1
+ GG Coder
2
+ Copyright (C) 2025-2026 KenKai
3
+
4
+ This program is free software: you can redistribute it and/or modify it under
5
+ the terms of the GNU Affero General Public License as published by the Free
6
+ Software Foundation, version 3 only (AGPL-3.0-only). See LICENSE.
7
+
8
+ This program is distributed in the hope that it will be useful, but WITHOUT
9
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10
+ FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
11
+ details.
12
+
13
+ Releases before 4 November 2026 (up to and including v0.102.0 of the desktop
14
+ app and 5.91.0 of the npm packages) were published under the MIT License, and
15
+ copies already received under those terms keep them.
16
+
17
+ --------------------------------------------------------------------------------
18
+ Contributions under the MIT License
19
+
20
+ The WSL-to-Windows-host audio playback in packages/ggcoder/src/core/radio.ts
21
+ (isWsl and tryPlayOnWindowsHost) is derived from contributions by
22
+ creativeprofit22 (pull requests #15 and #16, May 2026), made under these terms:
23
+
24
+ Copyright (c) 2026 creativeprofit22
25
+
26
+ Permission is hereby granted, free of charge, to any person obtaining a copy
27
+ of this software and associated documentation files (the "Software"), to deal
28
+ in the Software without restriction, including without limitation the rights
29
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
30
+ copies of the Software, and to permit persons to whom the Software is
31
+ furnished to do so, subject to the following conditions:
32
+
33
+ The above copyright notice and this permission notice shall be included in
34
+ all copies or substantial portions of the Software.
35
+
36
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
39
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42
+ SOFTWARE.
43
+
44
+ --------------------------------------------------------------------------------
45
+ Third-party components
46
+
47
+ Bundled third-party code, fonts and media keep their own licenses, listed in:
48
+ gg-app/src/assets/fonts/THIRD-PARTY.md
49
+ packages/ggcoder/assets/motion/THIRD-PARTY.md
50
+ packages/gg-world/CREDITS.md
51
+ and in the LICENSE / OFL.txt files beside each component. npm and Cargo
52
+ dependencies are installed under their own licenses.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/@kenkaiiii/gg-core"><img src="https://img.shields.io/npm/v/@kenkaiiii/gg-core?style=for-the-badge" alt="npm version"></a>
9
- <a href="../../LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" alt="MIT License"></a>
9
+ <a href="../../LICENSE"><img src="https://img.shields.io/badge/License-AGPL--3.0-blue.svg?style=for-the-badge" alt="AGPL-3.0 License"></a>
10
10
  </p>
11
11
 
12
12
  The shared foundation under GG Coder's app and CLI. It depends only on [`@kenkaiiii/gg-ai`](../gg-ai/README.md), never on React, Ink or the agent loop.
@@ -25,15 +25,15 @@ npm i @kenkaiiii/gg-core
25
25
 
26
26
  ## What's inside
27
27
 
28
- | Area | Main exports |
29
- |---|---|
30
- | Model registry | `getModel`, `getAllModels`, `getModelsForProvider`, `getDefaultModel`, `getContextWindow` |
31
- | Thinking levels | `getSupportedThinkingLevels`, `getMaxThinkingLevel`, `getDefaultThinkingLevel` |
32
- | Auth storage | `AuthStorage` (reads and writes `~/.gg/auth.json`, refreshes OAuth tokens) |
33
- | OAuth | Anthropic, OpenAI, Gemini, Kimi and xAI login flows |
34
- | Local models | `discoverLocalModels` (Ollama, LM Studio, llama.cpp, vLLM, custom endpoints) |
35
- | Paths | `getAppPaths` (every file under `~/.gg/`) |
36
- | Other | Logger, file lock, usage limits, Telegram, voice transcription, auto-update |
28
+ | Area | Main exports |
29
+ | --------------- | ----------------------------------------------------------------------------------------- |
30
+ | Model registry | `getModel`, `getAllModels`, `getModelsForProvider`, `getDefaultModel`, `getContextWindow` |
31
+ | Thinking levels | `getSupportedThinkingLevels`, `getMaxThinkingLevel`, `getDefaultThinkingLevel` |
32
+ | Auth storage | `AuthStorage` (reads and writes `~/.gg/auth.json`, refreshes OAuth tokens) |
33
+ | OAuth | Anthropic, OpenAI, Gemini, Kimi and xAI login flows |
34
+ | Local models | `discoverLocalModels` (Ollama, LM Studio, llama.cpp, vLLM, custom endpoints) |
35
+ | Paths | `getAppPaths` (every file under `~/.gg/`) |
36
+ | Other | Logger, file lock, usage limits, Telegram, voice transcription, auto-update |
37
37
 
38
38
  Two lighter subpath entries skip the rest of the package:
39
39
 
@@ -65,4 +65,4 @@ console.log(models.map((m) => m.id));
65
65
 
66
66
  ## License
67
67
 
68
- MIT
68
+ AGPL-3.0-only. See [LICENSE](../../LICENSE).
@@ -1177,9 +1177,13 @@ async function acquireLock(lockPath) {
1177
1177
  continue;
1178
1178
  }
1179
1179
  } catch {
1180
- await fs.unlink(lockPath).catch(() => {
1181
- });
1182
- continue;
1180
+ const stat = await fs.stat(lockPath).catch(() => null);
1181
+ if (!stat) continue;
1182
+ if (Date.now() - stat.mtimeMs > STALE_TIMEOUT_MS) {
1183
+ await fs.unlink(lockPath).catch(() => {
1184
+ });
1185
+ continue;
1186
+ }
1183
1187
  }
1184
1188
  if (Date.now() - startTime > MAX_WAIT_MS) {
1185
1189
  await fs.unlink(lockPath).catch(() => {
@@ -2803,11 +2807,44 @@ function clearRuntimeModels(predicate) {
2803
2807
  if (predicate(model)) runtimeModels.delete(id);
2804
2808
  }
2805
2809
  }
2810
+ var providerCatalogs = /* @__PURE__ */ new Map();
2811
+ function setProviderCatalog(provider, models) {
2812
+ if (!models) {
2813
+ providerCatalogs.delete(provider);
2814
+ return [];
2815
+ }
2816
+ const installed = /* @__PURE__ */ new Map();
2817
+ for (const model of models) {
2818
+ if (model.provider !== provider) continue;
2819
+ if (MODELS.some((m) => m.id === model.id && m.provider !== provider)) continue;
2820
+ installed.set(model.id, model);
2821
+ }
2822
+ providerCatalogs.set(provider, installed);
2823
+ return [...installed.values()];
2824
+ }
2825
+ function getProviderCatalog(provider) {
2826
+ const catalog = providerCatalogs.get(provider);
2827
+ return catalog ? [...catalog.values()] : void 0;
2828
+ }
2806
2829
  function getAllModels() {
2807
- return [...MODELS, ...runtimeModels.values()];
2830
+ const synced = [...providerCatalogs.values()].flatMap((c) => [...c.values()]);
2831
+ return [
2832
+ ...MODELS.filter((m) => !providerCatalogs.has(m.provider)),
2833
+ ...synced,
2834
+ ...runtimeModels.values()
2835
+ ];
2808
2836
  }
2809
2837
  function getModel(id) {
2810
- return MODELS.find((m) => m.id === id) ?? runtimeModels.get(id);
2838
+ const fixed = MODELS.find((m) => m.id === id);
2839
+ if (fixed && !providerCatalogs.has(fixed.provider)) return fixed;
2840
+ return findSynced(id) ?? fixed ?? runtimeModels.get(id);
2841
+ }
2842
+ function findSynced(id) {
2843
+ for (const catalog of providerCatalogs.values()) {
2844
+ const hit = catalog.get(id);
2845
+ if (hit) return hit;
2846
+ }
2847
+ return void 0;
2811
2848
  }
2812
2849
  function getModelsForProvider(provider) {
2813
2850
  return getAllModels().filter((m) => m.provider === provider);
@@ -2964,6 +3001,8 @@ export {
2964
3001
  MODELS,
2965
3002
  registerRuntimeModels,
2966
3003
  clearRuntimeModels,
3004
+ setProviderCatalog,
3005
+ getProviderCatalog,
2967
3006
  getAllModels,
2968
3007
  getModel,
2969
3008
  getModelsForProvider,
@@ -2982,4 +3021,4 @@ export {
2982
3021
  getDefaultThinkingLevel,
2983
3022
  getSummaryModel
2984
3023
  };
2985
- //# sourceMappingURL=chunk-M53JVW2V.js.map
3024
+ //# sourceMappingURL=chunk-YXPGQIOD.js.map