gemkit-cli 0.2.2 → 0.3.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.
- package/README.md +152 -5
- package/dist/commands/agent/index.d.ts +9 -0
- package/dist/commands/agent/index.js +1329 -0
- package/dist/commands/cache/index.d.ts +5 -0
- package/dist/commands/cache/index.js +43 -0
- package/dist/commands/catalog/index.d.ts +2 -0
- package/dist/commands/catalog/index.js +57 -0
- package/dist/commands/config/index.d.ts +7 -0
- package/dist/commands/config/index.js +122 -0
- package/dist/commands/convert/index.d.ts +8 -0
- package/dist/commands/convert/index.js +391 -0
- package/dist/commands/doctor/index.d.ts +2 -0
- package/dist/commands/doctor/index.js +243 -0
- package/dist/commands/extension/index.d.ts +5 -0
- package/dist/commands/extension/index.js +52 -0
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.js +37 -0
- package/dist/commands/init/index.d.ts +6 -0
- package/dist/commands/init/index.js +345 -0
- package/dist/commands/new/index.d.ts +5 -0
- package/dist/commands/new/index.js +49 -0
- package/dist/commands/office/index.d.ts +5 -0
- package/dist/commands/office/index.js +283 -0
- package/dist/commands/paste/index.d.ts +10 -0
- package/dist/commands/paste/index.js +533 -0
- package/dist/commands/plan/index.d.ts +8 -0
- package/dist/commands/plan/index.js +247 -0
- package/dist/commands/session/index.d.ts +8 -0
- package/dist/commands/session/index.js +289 -0
- package/dist/commands/tokens/index.d.ts +6 -0
- package/dist/commands/tokens/index.js +148 -0
- package/dist/commands/update/index.d.ts +26 -0
- package/dist/commands/update/index.js +199 -0
- package/dist/commands/versions/index.d.ts +5 -0
- package/dist/commands/versions/index.js +39 -0
- package/dist/domains/agent/index.d.ts +8 -0
- package/dist/domains/agent/index.js +8 -0
- package/dist/domains/agent/mappings.d.ts +32 -0
- package/dist/domains/agent/mappings.js +164 -0
- package/dist/domains/agent/profile.d.ts +26 -0
- package/dist/domains/agent/profile.js +225 -0
- package/dist/domains/agent/pty-context.d.ts +11 -0
- package/dist/domains/agent/pty-context.js +83 -0
- package/dist/domains/agent/pty-providers.d.ts +18 -0
- package/dist/domains/agent/pty-providers.js +66 -0
- package/dist/domains/agent/pty-session.d.ts +33 -0
- package/dist/domains/agent/pty-session.js +82 -0
- package/dist/domains/agent/pty-types.d.ts +127 -0
- package/dist/domains/agent/pty-types.js +4 -0
- package/dist/domains/agent/search.d.ts +45 -0
- package/dist/domains/agent/search.js +614 -0
- package/dist/domains/agent/types.d.ts +78 -0
- package/dist/domains/agent/types.js +5 -0
- package/dist/domains/agent-office/documents-scanner.d.ts +9 -0
- package/dist/domains/agent-office/documents-scanner.js +143 -0
- package/dist/domains/agent-office/event-emitter.d.ts +43 -0
- package/dist/domains/agent-office/event-emitter.js +86 -0
- package/dist/domains/agent-office/file-watcher.d.ts +40 -0
- package/dist/domains/agent-office/file-watcher.js +173 -0
- package/dist/domains/agent-office/icons.d.ts +11 -0
- package/dist/domains/agent-office/icons.js +36 -0
- package/dist/domains/agent-office/index.d.ts +12 -0
- package/dist/domains/agent-office/index.js +20 -0
- package/dist/domains/agent-office/renderer/web/assets.d.ts +11 -0
- package/dist/domains/agent-office/renderer/web/assets.js +3419 -0
- package/dist/domains/agent-office/renderer/web/server.d.ts +42 -0
- package/dist/domains/agent-office/renderer/web/server.js +228 -0
- package/dist/domains/agent-office/renderer/web.d.ts +30 -0
- package/dist/domains/agent-office/renderer/web.js +111 -0
- package/dist/domains/agent-office/session-bridge.d.ts +23 -0
- package/dist/domains/agent-office/session-bridge.js +171 -0
- package/dist/domains/agent-office/state-machine.d.ts +5 -0
- package/dist/domains/agent-office/state-machine.js +82 -0
- package/dist/domains/agent-office/types.d.ts +91 -0
- package/dist/domains/agent-office/types.js +4 -0
- package/dist/domains/cache/index.d.ts +1 -0
- package/dist/domains/cache/index.js +1 -0
- package/dist/domains/cache/manager.d.ts +22 -0
- package/dist/domains/cache/manager.js +84 -0
- package/dist/domains/config/index.d.ts +5 -0
- package/dist/domains/config/index.js +5 -0
- package/dist/domains/config/manager.d.ts +24 -0
- package/dist/domains/config/manager.js +85 -0
- package/dist/domains/config/schema.d.ts +17 -0
- package/dist/domains/config/schema.js +96 -0
- package/dist/domains/convert/converter.d.ts +78 -0
- package/dist/domains/convert/converter.js +471 -0
- package/dist/domains/convert/index.d.ts +5 -0
- package/dist/domains/convert/index.js +5 -0
- package/dist/domains/convert/types.d.ts +88 -0
- package/dist/domains/convert/types.js +18 -0
- package/dist/domains/github/download.d.ts +12 -0
- package/dist/domains/github/download.js +51 -0
- package/dist/domains/github/index.d.ts +2 -0
- package/dist/domains/github/index.js +2 -0
- package/dist/domains/github/releases.d.ts +16 -0
- package/dist/domains/github/releases.js +68 -0
- package/dist/domains/installation/conflict.d.ts +13 -0
- package/dist/domains/installation/conflict.js +38 -0
- package/dist/domains/installation/file-sync.d.ts +16 -0
- package/dist/domains/installation/file-sync.js +77 -0
- package/dist/domains/installation/index.d.ts +3 -0
- package/dist/domains/installation/index.js +3 -0
- package/dist/domains/installation/metadata.d.ts +20 -0
- package/dist/domains/installation/metadata.js +52 -0
- package/dist/domains/plan/index.d.ts +2 -0
- package/dist/domains/plan/index.js +2 -0
- package/dist/domains/plan/resolver.d.ts +24 -0
- package/dist/domains/plan/resolver.js +164 -0
- package/dist/domains/plan/types.d.ts +13 -0
- package/dist/domains/plan/types.js +4 -0
- package/dist/domains/session/env.d.ts +51 -0
- package/dist/domains/session/env.js +118 -0
- package/dist/domains/session/index.d.ts +8 -0
- package/dist/domains/session/index.js +8 -0
- package/dist/domains/session/manager.d.ts +56 -0
- package/dist/domains/session/manager.js +205 -0
- package/dist/domains/session/paths.d.ts +6 -0
- package/dist/domains/session/paths.js +6 -0
- package/dist/domains/session/types.d.ts +121 -0
- package/dist/domains/session/types.js +5 -0
- package/dist/domains/session/writer.d.ts +82 -0
- package/dist/domains/session/writer.js +431 -0
- package/dist/domains/tokens/index.d.ts +5 -0
- package/dist/domains/tokens/index.js +5 -0
- package/dist/domains/tokens/pricing.d.ts +38 -0
- package/dist/domains/tokens/pricing.js +129 -0
- package/dist/domains/tokens/scanner.d.ts +42 -0
- package/dist/domains/tokens/scanner.js +168 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +86 -57
- package/dist/services/aipty.d.ts +76 -0
- package/dist/services/aipty.js +276 -0
- package/dist/services/archive.d.ts +22 -0
- package/dist/services/archive.js +53 -0
- package/dist/services/auto-update.d.ts +26 -0
- package/dist/services/auto-update.js +117 -0
- package/dist/services/hash.d.ts +36 -0
- package/dist/services/hash.js +63 -0
- package/dist/services/logger.d.ts +28 -0
- package/dist/services/logger.js +102 -0
- package/dist/services/music.d.ts +67 -0
- package/dist/services/music.js +290 -0
- package/dist/services/npm.d.ts +22 -0
- package/dist/services/npm.js +65 -0
- package/dist/services/pty-client.d.ts +66 -0
- package/dist/services/pty-client.js +154 -0
- package/dist/services/pty-server.d.ts +102 -0
- package/dist/services/pty-server.js +613 -0
- package/dist/types/index.d.ts +155 -0
- package/dist/types/index.js +4 -0
- package/dist/utils/colors.d.ts +43 -0
- package/dist/utils/colors.js +98 -0
- package/dist/utils/errors.d.ts +24 -0
- package/dist/utils/errors.js +56 -0
- package/dist/utils/paths.d.ts +46 -0
- package/dist/utils/paths.js +89 -0
- package/dist/utils/platform.d.ts +11 -0
- package/dist/utils/platform.js +31 -0
- package/package.json +55 -54
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Office type definitions
|
|
3
|
+
*/
|
|
4
|
+
export type AgentState = 'idle' | 'working' | 'walking' | 'delivering' | 'receiving';
|
|
5
|
+
export type CharacterType = 'orchestrator' | 'researcher' | 'coder' | 'planner' | 'tester' | 'designer' | 'other' | 'reviewer' | 'artist' | 'writer' | 'manager';
|
|
6
|
+
export interface CharacterPosition {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
desk: string;
|
|
10
|
+
facing: 'left' | 'right' | 'front';
|
|
11
|
+
}
|
|
12
|
+
export type AnimationState = 'idle' | 'typing' | 'walking' | 'celebrating';
|
|
13
|
+
export interface OfficeAgent {
|
|
14
|
+
id: string;
|
|
15
|
+
agentType: 'orchestrator' | 'sub-agent';
|
|
16
|
+
role: string;
|
|
17
|
+
characterType?: CharacterType;
|
|
18
|
+
icon: string;
|
|
19
|
+
state: AgentState;
|
|
20
|
+
activeSkill: string | null;
|
|
21
|
+
progress: number;
|
|
22
|
+
speechBubble: string | null;
|
|
23
|
+
hasFireEffect: boolean;
|
|
24
|
+
gkSessionId: string;
|
|
25
|
+
parentSessionId: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface OrchestratorAgent extends OfficeAgent {
|
|
28
|
+
agentType: 'orchestrator';
|
|
29
|
+
delegatedTo: string[];
|
|
30
|
+
totalSubAgents: number;
|
|
31
|
+
completedSubAgents: number;
|
|
32
|
+
}
|
|
33
|
+
export interface OfficeEvent {
|
|
34
|
+
type: OfficeEventType;
|
|
35
|
+
agentId: string;
|
|
36
|
+
targetAgentId: string | null;
|
|
37
|
+
skill: string | null;
|
|
38
|
+
message: string;
|
|
39
|
+
timestamp: number;
|
|
40
|
+
characterType?: CharacterType;
|
|
41
|
+
}
|
|
42
|
+
export type OfficeEventType = 'agent_idle' | 'agent_working' | 'skill_activated' | 'handoff_start' | 'handoff_complete' | 'received_work' | 'delivering' | 'task_complete' | 'session_complete';
|
|
43
|
+
export interface InboxItem {
|
|
44
|
+
id: string;
|
|
45
|
+
agentId: string;
|
|
46
|
+
agentRole: string;
|
|
47
|
+
agentIcon: string;
|
|
48
|
+
timestamp: number;
|
|
49
|
+
status: 'unread' | 'read';
|
|
50
|
+
title: string;
|
|
51
|
+
preview: string;
|
|
52
|
+
fullContent: string | null;
|
|
53
|
+
tokenUsage: {
|
|
54
|
+
input: number;
|
|
55
|
+
output: number;
|
|
56
|
+
} | null;
|
|
57
|
+
duration: number;
|
|
58
|
+
skillsUsed: string[];
|
|
59
|
+
}
|
|
60
|
+
export interface PlanDocument {
|
|
61
|
+
id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
displayName: string;
|
|
64
|
+
type: DocumentType;
|
|
65
|
+
icon: string;
|
|
66
|
+
path: string;
|
|
67
|
+
relativePath: string;
|
|
68
|
+
modifiedAt: number;
|
|
69
|
+
createdAt: number;
|
|
70
|
+
size: number;
|
|
71
|
+
extension: string;
|
|
72
|
+
phaseNumber: number | null;
|
|
73
|
+
}
|
|
74
|
+
export type DocumentType = 'plan' | 'phase' | 'research' | 'artifact' | 'report' | 'other';
|
|
75
|
+
export interface OfficeState {
|
|
76
|
+
orchestrator: OrchestratorAgent | null;
|
|
77
|
+
agents: Map<string, OfficeAgent>;
|
|
78
|
+
sessionId: string | null;
|
|
79
|
+
projectDir: string | null;
|
|
80
|
+
activePlan: string | null;
|
|
81
|
+
appName: string | null;
|
|
82
|
+
currentNotification: OfficeNotification | null;
|
|
83
|
+
inbox: InboxItem[];
|
|
84
|
+
documents: PlanDocument[];
|
|
85
|
+
isActive: boolean;
|
|
86
|
+
}
|
|
87
|
+
export interface OfficeNotification {
|
|
88
|
+
message: string;
|
|
89
|
+
type: 'skill' | 'handoff' | 'success' | 'info';
|
|
90
|
+
timestamp: number;
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './manager.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './manager.js';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache manager for releases
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Get cached value
|
|
6
|
+
*/
|
|
7
|
+
export declare function getCache<T>(key: string): T | null;
|
|
8
|
+
/**
|
|
9
|
+
* Set cached value
|
|
10
|
+
*/
|
|
11
|
+
export declare function setCache<T>(key: string, data: T, ttl?: number): void;
|
|
12
|
+
/**
|
|
13
|
+
* Clear all cache
|
|
14
|
+
*/
|
|
15
|
+
export declare function clearCache(): number;
|
|
16
|
+
/**
|
|
17
|
+
* Get cache stats
|
|
18
|
+
*/
|
|
19
|
+
export declare function getCacheStats(): {
|
|
20
|
+
entries: number;
|
|
21
|
+
size: number;
|
|
22
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache manager for releases
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync, unlinkSync, statSync } from 'fs';
|
|
5
|
+
import { join } from 'path';
|
|
6
|
+
import { GEMKIT_CACHE_DIR } from '../../utils/paths.js';
|
|
7
|
+
/**
|
|
8
|
+
* Get cache directory path
|
|
9
|
+
*/
|
|
10
|
+
function getCacheDir() {
|
|
11
|
+
if (!existsSync(GEMKIT_CACHE_DIR)) {
|
|
12
|
+
mkdirSync(GEMKIT_CACHE_DIR, { recursive: true });
|
|
13
|
+
}
|
|
14
|
+
return GEMKIT_CACHE_DIR;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get cache file path for key
|
|
18
|
+
*/
|
|
19
|
+
function getCacheFilePath(key) {
|
|
20
|
+
const safeKey = key.replace(/[^a-zA-Z0-9-_]/g, '_');
|
|
21
|
+
return join(getCacheDir(), `${safeKey}.json`);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get cached value
|
|
25
|
+
*/
|
|
26
|
+
export function getCache(key) {
|
|
27
|
+
const filePath = getCacheFilePath(key);
|
|
28
|
+
if (!existsSync(filePath)) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const content = readFileSync(filePath, 'utf-8');
|
|
33
|
+
const entry = JSON.parse(content);
|
|
34
|
+
// Check if expired
|
|
35
|
+
if (Date.now() - entry.timestamp > entry.ttl * 1000) {
|
|
36
|
+
unlinkSync(filePath);
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return entry.data;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Set cached value
|
|
47
|
+
*/
|
|
48
|
+
export function setCache(key, data, ttl = 3600) {
|
|
49
|
+
const filePath = getCacheFilePath(key);
|
|
50
|
+
const entry = {
|
|
51
|
+
key,
|
|
52
|
+
data,
|
|
53
|
+
timestamp: Date.now(),
|
|
54
|
+
ttl,
|
|
55
|
+
};
|
|
56
|
+
writeFileSync(filePath, JSON.stringify(entry, null, 2));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Clear all cache
|
|
60
|
+
*/
|
|
61
|
+
export function clearCache() {
|
|
62
|
+
const cacheDir = getCacheDir();
|
|
63
|
+
const files = readdirSync(cacheDir).filter(f => f.endsWith('.json'));
|
|
64
|
+
for (const file of files) {
|
|
65
|
+
unlinkSync(join(cacheDir, file));
|
|
66
|
+
}
|
|
67
|
+
return files.length;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get cache stats
|
|
71
|
+
*/
|
|
72
|
+
export function getCacheStats() {
|
|
73
|
+
const cacheDir = getCacheDir();
|
|
74
|
+
const files = readdirSync(cacheDir).filter(f => f.endsWith('.json'));
|
|
75
|
+
let totalSize = 0;
|
|
76
|
+
for (const file of files) {
|
|
77
|
+
const stat = statSync(join(cacheDir, file));
|
|
78
|
+
totalSize += stat.size;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
entries: files.length,
|
|
82
|
+
size: totalSize,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration manager
|
|
3
|
+
*/
|
|
4
|
+
import type { GemKitConfig } from '../../types/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Load configuration from file
|
|
7
|
+
*/
|
|
8
|
+
export declare function loadConfig(projectDir?: string): GemKitConfig;
|
|
9
|
+
/**
|
|
10
|
+
* Save configuration to file
|
|
11
|
+
*/
|
|
12
|
+
export declare function saveConfig(config: GemKitConfig, projectDir?: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Get a specific config value by path
|
|
15
|
+
*/
|
|
16
|
+
export declare function getConfigValue(path: string, projectDir?: string): unknown;
|
|
17
|
+
/**
|
|
18
|
+
* Set a specific config value by path
|
|
19
|
+
*/
|
|
20
|
+
export declare function setConfigValue(path: string, value: unknown, projectDir?: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Reset config to defaults
|
|
23
|
+
*/
|
|
24
|
+
export declare function resetConfig(projectDir?: string): void;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration manager
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
5
|
+
import { dirname } from 'path';
|
|
6
|
+
import { getLocalConfigPath } from '../../utils/paths.js';
|
|
7
|
+
import { DEFAULT_CONFIG, mergeConfig, validateConfig } from './schema.js';
|
|
8
|
+
import { ConfigError } from '../../utils/errors.js';
|
|
9
|
+
/**
|
|
10
|
+
* Load configuration from file
|
|
11
|
+
*/
|
|
12
|
+
export function loadConfig(projectDir) {
|
|
13
|
+
const configPath = getLocalConfigPath(projectDir);
|
|
14
|
+
if (!existsSync(configPath)) {
|
|
15
|
+
return DEFAULT_CONFIG;
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
19
|
+
const parsed = JSON.parse(content);
|
|
20
|
+
if (!validateConfig(parsed)) {
|
|
21
|
+
throw new ConfigError('Invalid configuration format');
|
|
22
|
+
}
|
|
23
|
+
return mergeConfig(parsed);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
if (error instanceof ConfigError) {
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
throw new ConfigError(`Failed to load config: ${error}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Save configuration to file
|
|
34
|
+
*/
|
|
35
|
+
export function saveConfig(config, projectDir) {
|
|
36
|
+
const configPath = getLocalConfigPath(projectDir);
|
|
37
|
+
const dir = dirname(configPath);
|
|
38
|
+
if (!existsSync(dir)) {
|
|
39
|
+
mkdirSync(dir, { recursive: true });
|
|
40
|
+
}
|
|
41
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get a specific config value by path
|
|
45
|
+
*/
|
|
46
|
+
export function getConfigValue(path, projectDir) {
|
|
47
|
+
const config = loadConfig(projectDir);
|
|
48
|
+
const keys = path.split('.');
|
|
49
|
+
let value = config;
|
|
50
|
+
for (const key of keys) {
|
|
51
|
+
if (value && typeof value === 'object' && key in value) {
|
|
52
|
+
value = value[key];
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Set a specific config value by path
|
|
62
|
+
*/
|
|
63
|
+
export function setConfigValue(path, value, projectDir) {
|
|
64
|
+
const config = loadConfig(projectDir);
|
|
65
|
+
const keys = path.split('.');
|
|
66
|
+
const lastKey = keys.pop();
|
|
67
|
+
if (!lastKey) {
|
|
68
|
+
throw new ConfigError('Invalid config path');
|
|
69
|
+
}
|
|
70
|
+
let obj = config;
|
|
71
|
+
for (const key of keys) {
|
|
72
|
+
if (!(key in obj) || typeof obj[key] !== 'object') {
|
|
73
|
+
obj[key] = {};
|
|
74
|
+
}
|
|
75
|
+
obj = obj[key];
|
|
76
|
+
}
|
|
77
|
+
obj[lastKey] = value;
|
|
78
|
+
saveConfig(config, projectDir);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Reset config to defaults
|
|
82
|
+
*/
|
|
83
|
+
export function resetConfig(projectDir) {
|
|
84
|
+
saveConfig(DEFAULT_CONFIG, projectDir);
|
|
85
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration schema for GemKit CLI
|
|
3
|
+
*/
|
|
4
|
+
import type { GemKitConfig } from '../../types/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Default configuration - uses starter repo
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_CONFIG: GemKitConfig;
|
|
9
|
+
/**
|
|
10
|
+
* Validate configuration object
|
|
11
|
+
* Only validates it's a valid object - mergeConfig handles defaults
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateConfig(config: unknown): config is GemKitConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Merge partial config with defaults
|
|
16
|
+
*/
|
|
17
|
+
export declare function mergeConfig(partial: Partial<GemKitConfig>): GemKitConfig;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration schema for GemKit CLI
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Default configuration - uses starter repo
|
|
6
|
+
*/
|
|
7
|
+
export const DEFAULT_CONFIG = {
|
|
8
|
+
defaultScope: 'local',
|
|
9
|
+
github: {
|
|
10
|
+
repo: 'therichardngai-code/gemkit-kits-starter',
|
|
11
|
+
apiUrl: 'https://api.github.com',
|
|
12
|
+
},
|
|
13
|
+
cache: {
|
|
14
|
+
enabled: true,
|
|
15
|
+
ttl: 3600,
|
|
16
|
+
},
|
|
17
|
+
installation: {
|
|
18
|
+
excludePatterns: [],
|
|
19
|
+
backupOnUpdate: true,
|
|
20
|
+
},
|
|
21
|
+
ui: {
|
|
22
|
+
colors: true,
|
|
23
|
+
spinner: true,
|
|
24
|
+
verbose: false,
|
|
25
|
+
},
|
|
26
|
+
paths: {},
|
|
27
|
+
spawn: {
|
|
28
|
+
defaultModel: 'gemini-2.5-flash',
|
|
29
|
+
music: false,
|
|
30
|
+
},
|
|
31
|
+
office: {
|
|
32
|
+
enabled: true,
|
|
33
|
+
mode: 'web',
|
|
34
|
+
port: 3847,
|
|
35
|
+
autoOpen: true,
|
|
36
|
+
sounds: false,
|
|
37
|
+
refreshRate: 500,
|
|
38
|
+
},
|
|
39
|
+
update: {
|
|
40
|
+
autoCheck: true,
|
|
41
|
+
checkInterval: 24, // hours
|
|
42
|
+
notifyOnly: true, // only notify, don't auto-update
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Validate configuration object
|
|
47
|
+
* Only validates it's a valid object - mergeConfig handles defaults
|
|
48
|
+
*/
|
|
49
|
+
export function validateConfig(config) {
|
|
50
|
+
if (!config || typeof config !== 'object') {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
// No strict field requirements - mergeConfig fills in defaults
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Merge partial config with defaults
|
|
58
|
+
*/
|
|
59
|
+
export function mergeConfig(partial) {
|
|
60
|
+
return {
|
|
61
|
+
...DEFAULT_CONFIG,
|
|
62
|
+
...partial,
|
|
63
|
+
github: {
|
|
64
|
+
...DEFAULT_CONFIG.github,
|
|
65
|
+
...(partial.github || {}),
|
|
66
|
+
},
|
|
67
|
+
cache: {
|
|
68
|
+
...DEFAULT_CONFIG.cache,
|
|
69
|
+
...(partial.cache || {}),
|
|
70
|
+
},
|
|
71
|
+
installation: {
|
|
72
|
+
...DEFAULT_CONFIG.installation,
|
|
73
|
+
...(partial.installation || {}),
|
|
74
|
+
},
|
|
75
|
+
ui: {
|
|
76
|
+
...DEFAULT_CONFIG.ui,
|
|
77
|
+
...(partial.ui || {}),
|
|
78
|
+
},
|
|
79
|
+
paths: {
|
|
80
|
+
...DEFAULT_CONFIG.paths,
|
|
81
|
+
...(partial.paths || {}),
|
|
82
|
+
},
|
|
83
|
+
spawn: {
|
|
84
|
+
...DEFAULT_CONFIG.spawn,
|
|
85
|
+
...(partial.spawn || {}),
|
|
86
|
+
},
|
|
87
|
+
office: {
|
|
88
|
+
...DEFAULT_CONFIG.office,
|
|
89
|
+
...(partial.office || {}),
|
|
90
|
+
},
|
|
91
|
+
update: {
|
|
92
|
+
...DEFAULT_CONFIG.update,
|
|
93
|
+
...(partial.update || {}),
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill to Extension Converter
|
|
3
|
+
* Converts .claude/skills to .gemini/extensions
|
|
4
|
+
*/
|
|
5
|
+
import { SkillFrontmatter, GeminiExtension, SkillInfo, ConversionResult, ConvertOptions, AgentFrontmatter, AgentInfo } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Parse YAML-like frontmatter from markdown file
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseFrontmatter(content: string): SkillFrontmatter | null;
|
|
10
|
+
/**
|
|
11
|
+
* Get skills directory path
|
|
12
|
+
*/
|
|
13
|
+
export declare function getSkillsDir(projectDir?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Get extensions directory path
|
|
16
|
+
*/
|
|
17
|
+
export declare function getExtensionsDir(projectDir?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* List all available Claude skills
|
|
20
|
+
*/
|
|
21
|
+
export declare function listSkills(projectDir?: string): SkillInfo[];
|
|
22
|
+
/**
|
|
23
|
+
* Check if an extension already exists
|
|
24
|
+
*/
|
|
25
|
+
export declare function extensionExists(name: string, projectDir?: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Generate gemini-extension.json content
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateExtensionJson(frontmatter: SkillFrontmatter, hasReferences: boolean): GeminiExtension;
|
|
30
|
+
/**
|
|
31
|
+
* Convert a single skill to extension
|
|
32
|
+
*/
|
|
33
|
+
export declare function convertSkill(skillName: string, options?: ConvertOptions, projectDir?: string): ConversionResult;
|
|
34
|
+
/**
|
|
35
|
+
* Convert all skills to extensions
|
|
36
|
+
*/
|
|
37
|
+
export declare function convertAllSkills(options?: ConvertOptions, projectDir?: string): ConversionResult[];
|
|
38
|
+
/**
|
|
39
|
+
* Get conversion summary
|
|
40
|
+
*/
|
|
41
|
+
export declare function getConversionSummary(results: ConversionResult[]): {
|
|
42
|
+
total: number;
|
|
43
|
+
success: number;
|
|
44
|
+
skipped: number;
|
|
45
|
+
failed: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Get Claude agents directory path
|
|
49
|
+
*/
|
|
50
|
+
export declare function getClaudeAgentsDir(projectDir?: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Get Gemini agents directory path
|
|
53
|
+
*/
|
|
54
|
+
export declare function getGeminiAgentsDir(projectDir?: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* Parse agent frontmatter
|
|
57
|
+
*/
|
|
58
|
+
export declare function parseAgentFrontmatter(content: string): AgentFrontmatter | null;
|
|
59
|
+
/**
|
|
60
|
+
* List all available Claude agents
|
|
61
|
+
*/
|
|
62
|
+
export declare function listAgents(projectDir?: string): AgentInfo[];
|
|
63
|
+
/**
|
|
64
|
+
* Check if an agent already exists in Gemini
|
|
65
|
+
*/
|
|
66
|
+
export declare function geminiAgentExists(name: string, projectDir?: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Map Claude model to Gemini model
|
|
69
|
+
*/
|
|
70
|
+
export declare function mapModel(model: string | undefined): string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Convert a single agent from Claude to Gemini
|
|
73
|
+
*/
|
|
74
|
+
export declare function convertAgent(agentName: string, options?: ConvertOptions, projectDir?: string): ConversionResult;
|
|
75
|
+
/**
|
|
76
|
+
* Convert all agents from Claude to Gemini
|
|
77
|
+
*/
|
|
78
|
+
export declare function convertAllAgents(options?: ConvertOptions, projectDir?: string): ConversionResult[];
|