@kenkaiiii/gg-core 4.4.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.
@@ -0,0 +1,57 @@
1
+ import { Provider, ThinkingLevel } from '@kenkaiiii/gg-ai';
2
+
3
+ interface ModelInfo {
4
+ id: string;
5
+ name: string;
6
+ provider: Provider;
7
+ contextWindow: number;
8
+ /**
9
+ * ChatGPT Codex transport uses product-specific windows that can differ from
10
+ * the public API model window. OpenAI OAuth requests include an accountId and
11
+ * route through `/codex/responses`; API-key requests do not.
12
+ */
13
+ codexContextWindow?: number;
14
+ maxOutputTokens: number;
15
+ supportsThinking: boolean;
16
+ supportsImages: boolean;
17
+ supportsVideo: boolean;
18
+ costTier: "low" | "medium" | "high";
19
+ /**
20
+ * The top reasoning tier this model genuinely uses. Used when thinking is
21
+ * enabled to pick the strongest setting per model:
22
+ * - OpenAI GPT-5.5-era: `xhigh`
23
+ * - OpenAI Pro/Codex/old: clamped to what the model accepts
24
+ * - Claude Opus 4.8 / 4.7 / 4.6 and Sonnet 4.6: `max`
25
+ * - Claude Haiku 4.5: `high` (no adaptive `max` tier)
26
+ * - GLM / Moonshot / Xiaomi / MiniMax / Qwen: `high` — binary-thinking
27
+ * providers ignore the level on the wire, so the value is cosmetic
28
+ * - DeepSeek V4: `xhigh` (DeepSeek maps `xhigh` → its internal `max`)
29
+ */
30
+ maxThinkingLevel: ThinkingLevel;
31
+ }
32
+ declare const MODELS: ModelInfo[];
33
+ declare function getModel(id: string): ModelInfo | undefined;
34
+ declare function getModelsForProvider(provider: Provider): ModelInfo[];
35
+ declare function getDefaultModel(provider: Provider): ModelInfo;
36
+ interface ContextWindowOptions {
37
+ provider?: Provider;
38
+ accountId?: string;
39
+ }
40
+ declare function usesOpenAICodexTransport(options?: ContextWindowOptions): boolean;
41
+ declare function getContextWindow(modelId: string, options?: ContextWindowOptions): number;
42
+ /**
43
+ * The strongest thinking level the given model genuinely uses. Falls back to
44
+ * `"high"` for unknown models since every provider we ship accepts it.
45
+ */
46
+ declare function getMaxThinkingLevel(modelId: string): ThinkingLevel;
47
+ /**
48
+ * Get the model to use for compaction summarization.
49
+ * - Anthropic: always Sonnet 4.6
50
+ * - OpenAI: cheapest (Codex Mini)
51
+ * - Gemini: use the current model
52
+ * - GLM: GLM-4.7 Flash (cheap alternative)
53
+ * - Moonshot: use the current model (no cheap alternative)
54
+ */
55
+ declare function getSummaryModel(provider: Provider, currentModelId: string): ModelInfo;
56
+
57
+ export { type ContextWindowOptions, MODELS, type ModelInfo, getContextWindow, getDefaultModel, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, usesOpenAICodexTransport };
@@ -0,0 +1,57 @@
1
+ import { Provider, ThinkingLevel } from '@kenkaiiii/gg-ai';
2
+
3
+ interface ModelInfo {
4
+ id: string;
5
+ name: string;
6
+ provider: Provider;
7
+ contextWindow: number;
8
+ /**
9
+ * ChatGPT Codex transport uses product-specific windows that can differ from
10
+ * the public API model window. OpenAI OAuth requests include an accountId and
11
+ * route through `/codex/responses`; API-key requests do not.
12
+ */
13
+ codexContextWindow?: number;
14
+ maxOutputTokens: number;
15
+ supportsThinking: boolean;
16
+ supportsImages: boolean;
17
+ supportsVideo: boolean;
18
+ costTier: "low" | "medium" | "high";
19
+ /**
20
+ * The top reasoning tier this model genuinely uses. Used when thinking is
21
+ * enabled to pick the strongest setting per model:
22
+ * - OpenAI GPT-5.5-era: `xhigh`
23
+ * - OpenAI Pro/Codex/old: clamped to what the model accepts
24
+ * - Claude Opus 4.8 / 4.7 / 4.6 and Sonnet 4.6: `max`
25
+ * - Claude Haiku 4.5: `high` (no adaptive `max` tier)
26
+ * - GLM / Moonshot / Xiaomi / MiniMax / Qwen: `high` — binary-thinking
27
+ * providers ignore the level on the wire, so the value is cosmetic
28
+ * - DeepSeek V4: `xhigh` (DeepSeek maps `xhigh` → its internal `max`)
29
+ */
30
+ maxThinkingLevel: ThinkingLevel;
31
+ }
32
+ declare const MODELS: ModelInfo[];
33
+ declare function getModel(id: string): ModelInfo | undefined;
34
+ declare function getModelsForProvider(provider: Provider): ModelInfo[];
35
+ declare function getDefaultModel(provider: Provider): ModelInfo;
36
+ interface ContextWindowOptions {
37
+ provider?: Provider;
38
+ accountId?: string;
39
+ }
40
+ declare function usesOpenAICodexTransport(options?: ContextWindowOptions): boolean;
41
+ declare function getContextWindow(modelId: string, options?: ContextWindowOptions): number;
42
+ /**
43
+ * The strongest thinking level the given model genuinely uses. Falls back to
44
+ * `"high"` for unknown models since every provider we ship accepts it.
45
+ */
46
+ declare function getMaxThinkingLevel(modelId: string): ThinkingLevel;
47
+ /**
48
+ * Get the model to use for compaction summarization.
49
+ * - Anthropic: always Sonnet 4.6
50
+ * - OpenAI: cheapest (Codex Mini)
51
+ * - Gemini: use the current model
52
+ * - GLM: GLM-4.7 Flash (cheap alternative)
53
+ * - Moonshot: use the current model (no cheap alternative)
54
+ */
55
+ declare function getSummaryModel(provider: Provider, currentModelId: string): ModelInfo;
56
+
57
+ export { type ContextWindowOptions, MODELS, type ModelInfo, getContextWindow, getDefaultModel, getMaxThinkingLevel, getModel, getModelsForProvider, getSummaryModel, usesOpenAICodexTransport };
@@ -0,0 +1,21 @@
1
+ import {
2
+ MODELS,
3
+ getContextWindow,
4
+ getDefaultModel,
5
+ getMaxThinkingLevel,
6
+ getModel,
7
+ getModelsForProvider,
8
+ getSummaryModel,
9
+ usesOpenAICodexTransport
10
+ } from "./chunk-USAVZGPP.js";
11
+ export {
12
+ MODELS,
13
+ getContextWindow,
14
+ getDefaultModel,
15
+ getMaxThinkingLevel,
16
+ getModel,
17
+ getModelsForProvider,
18
+ getSummaryModel,
19
+ usesOpenAICodexTransport
20
+ };
21
+ //# sourceMappingURL=model-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/paths.cjs ADDED
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/paths.ts
31
+ var paths_exports = {};
32
+ __export(paths_exports, {
33
+ getAppPaths: () => getAppPaths
34
+ });
35
+ module.exports = __toCommonJS(paths_exports);
36
+ var import_node_path = __toESM(require("path"), 1);
37
+ var import_node_os = __toESM(require("os"), 1);
38
+ function getAppPaths() {
39
+ const agentDir = import_node_path.default.join(import_node_os.default.homedir(), ".gg");
40
+ return {
41
+ agentDir,
42
+ sessionsDir: import_node_path.default.join(agentDir, "sessions"),
43
+ settingsFile: import_node_path.default.join(agentDir, "settings.json"),
44
+ authFile: import_node_path.default.join(agentDir, "auth.json"),
45
+ telegramFile: import_node_path.default.join(agentDir, "telegram.json"),
46
+ agentHomeFile: import_node_path.default.join(agentDir, "agent-home.json"),
47
+ mcpFile: import_node_path.default.join(agentDir, "mcp.json"),
48
+ logFile: import_node_path.default.join(agentDir, "debug.log"),
49
+ skillsDir: import_node_path.default.join(agentDir, "skills"),
50
+ extensionsDir: import_node_path.default.join(agentDir, "extensions"),
51
+ agentsDir: import_node_path.default.join(agentDir, "agents")
52
+ };
53
+ }
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ getAppPaths
57
+ });
58
+ //# sourceMappingURL=paths.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/paths.ts"],"sourcesContent":["import path from \"node:path\";\nimport os from \"node:os\";\n\nexport interface AppPaths {\n agentDir: string;\n sessionsDir: string;\n settingsFile: string;\n authFile: string;\n telegramFile: string;\n agentHomeFile: string;\n mcpFile: string;\n logFile: string;\n skillsDir: string;\n extensionsDir: string;\n agentsDir: string;\n}\n\nexport function getAppPaths(): AppPaths {\n const agentDir = path.join(os.homedir(), \".gg\");\n return {\n agentDir,\n sessionsDir: path.join(agentDir, \"sessions\"),\n settingsFile: path.join(agentDir, \"settings.json\"),\n authFile: path.join(agentDir, \"auth.json\"),\n telegramFile: path.join(agentDir, \"telegram.json\"),\n agentHomeFile: path.join(agentDir, \"agent-home.json\"),\n mcpFile: path.join(agentDir, \"mcp.json\"),\n logFile: path.join(agentDir, \"debug.log\"),\n skillsDir: path.join(agentDir, \"skills\"),\n extensionsDir: path.join(agentDir, \"extensions\"),\n agentsDir: path.join(agentDir, \"agents\"),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAiB;AACjB,qBAAe;AAgBR,SAAS,cAAwB;AACtC,QAAM,WAAW,iBAAAA,QAAK,KAAK,eAAAC,QAAG,QAAQ,GAAG,KAAK;AAC9C,SAAO;AAAA,IACL;AAAA,IACA,aAAa,iBAAAD,QAAK,KAAK,UAAU,UAAU;AAAA,IAC3C,cAAc,iBAAAA,QAAK,KAAK,UAAU,eAAe;AAAA,IACjD,UAAU,iBAAAA,QAAK,KAAK,UAAU,WAAW;AAAA,IACzC,cAAc,iBAAAA,QAAK,KAAK,UAAU,eAAe;AAAA,IACjD,eAAe,iBAAAA,QAAK,KAAK,UAAU,iBAAiB;AAAA,IACpD,SAAS,iBAAAA,QAAK,KAAK,UAAU,UAAU;AAAA,IACvC,SAAS,iBAAAA,QAAK,KAAK,UAAU,WAAW;AAAA,IACxC,WAAW,iBAAAA,QAAK,KAAK,UAAU,QAAQ;AAAA,IACvC,eAAe,iBAAAA,QAAK,KAAK,UAAU,YAAY;AAAA,IAC/C,WAAW,iBAAAA,QAAK,KAAK,UAAU,QAAQ;AAAA,EACzC;AACF;","names":["path","os"]}
@@ -0,0 +1,16 @@
1
+ interface AppPaths {
2
+ agentDir: string;
3
+ sessionsDir: string;
4
+ settingsFile: string;
5
+ authFile: string;
6
+ telegramFile: string;
7
+ agentHomeFile: string;
8
+ mcpFile: string;
9
+ logFile: string;
10
+ skillsDir: string;
11
+ extensionsDir: string;
12
+ agentsDir: string;
13
+ }
14
+ declare function getAppPaths(): AppPaths;
15
+
16
+ export { type AppPaths, getAppPaths };
@@ -0,0 +1,16 @@
1
+ interface AppPaths {
2
+ agentDir: string;
3
+ sessionsDir: string;
4
+ settingsFile: string;
5
+ authFile: string;
6
+ telegramFile: string;
7
+ agentHomeFile: string;
8
+ mcpFile: string;
9
+ logFile: string;
10
+ skillsDir: string;
11
+ extensionsDir: string;
12
+ agentsDir: string;
13
+ }
14
+ declare function getAppPaths(): AppPaths;
15
+
16
+ export { type AppPaths, getAppPaths };
package/dist/paths.js ADDED
@@ -0,0 +1,7 @@
1
+ import {
2
+ getAppPaths
3
+ } from "./chunk-TZNVRILI.js";
4
+ export {
5
+ getAppPaths
6
+ };
7
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@kenkaiiii/gg-core",
3
+ "version": "4.4.0",
4
+ "type": "module",
5
+ "description": "Provider-agnostic, UI-free shared foundation: model registry, auth, paths, telegram, voice",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/kenkaiiii/gg-framework.git",
10
+ "directory": "packages/gg-core"
11
+ },
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/index.cjs"
17
+ },
18
+ "./models": {
19
+ "types": "./dist/model-registry.d.ts",
20
+ "import": "./dist/model-registry.js",
21
+ "require": "./dist/model-registry.cjs"
22
+ },
23
+ "./paths": {
24
+ "types": "./dist/paths.d.ts",
25
+ "import": "./dist/paths.js",
26
+ "require": "./dist/paths.cjs"
27
+ }
28
+ },
29
+ "main": "./dist/index.cjs",
30
+ "module": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "files": [
33
+ "dist"
34
+ ],
35
+ "dependencies": {
36
+ "@kenkaiiii/gg-ai": "4.4.0"
37
+ },
38
+ "optionalDependencies": {
39
+ "@huggingface/transformers": "^3.6.0",
40
+ "ogg-opus-decoder": "^1.6.13"
41
+ },
42
+ "devDependencies": {
43
+ "@types/node": "^25.6.0",
44
+ "typescript": "^6.0.3",
45
+ "vitest": "^4.1.4"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "scripts": {
51
+ "build": "tsup",
52
+ "check": "tsc --noEmit",
53
+ "test": "vitest run"
54
+ }
55
+ }