a2a-memory 0.11.4 → 0.11.6
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 +7 -19
- package/README.md +1 -1
- package/dist/a2a/client.js +1 -252
- package/dist/a2a/discovery.js +1 -115
- package/dist/a2a/index.js +1 -8
- package/dist/a2a/types.js +1 -42
- package/dist/adapters/anthropic.js +1 -117
- package/dist/chunking/chunker.js +1 -163
- package/dist/claude/sync.js +1 -294
- package/dist/cli/commands/add.js +1 -80
- package/dist/cli/commands/claude-sync.js +1 -70
- package/dist/cli/commands/cleanup.js +1 -83
- package/dist/cli/commands/config.js +1 -73
- package/dist/cli/commands/edit.js +1 -69
- package/dist/cli/commands/embed.js +1 -92
- package/dist/cli/commands/extract.js +1 -103
- package/dist/cli/commands/health.js +1 -105
- package/dist/cli/commands/list.js +1 -49
- package/dist/cli/commands/migrate-chunks.js +1 -205
- package/dist/cli/commands/migrate-file-refs.js +1 -183
- package/dist/cli/commands/proficiency.js +1 -146
- package/dist/cli/commands/rm.js +1 -64
- package/dist/cli/commands/search.js +1 -89
- package/dist/cli/commands/setup-wizard.js +1 -387
- package/dist/cli/commands/setup.js +1 -170
- package/dist/cli/commands/skill.js +1 -151
- package/dist/cli/commands/status.js +1 -70
- package/dist/cli/commands/sync.js +1 -202
- package/dist/cli/commands/team.js +1 -142
- package/dist/cli/index.js +1 -87
- package/dist/config/manager.js +1 -372
- package/dist/db/database.d.ts +10 -1
- package/dist/db/database.js +1 -1367
- package/dist/embedding/e5-provider.js +1 -147
- package/dist/embedding/index.js +1 -34
- package/dist/embedding/local-provider.js +1 -157
- package/dist/embedding/openai-provider.js +1 -92
- package/dist/embedding/quantization.js +1 -89
- package/dist/extraction/dedup-manager.js +1 -161
- package/dist/extraction/emotion-filter.js +1 -33
- package/dist/extraction/extractor.js +1 -642
- package/dist/extraction/file-reference.js +1 -77
- package/dist/extraction/filter.js +1 -85
- package/dist/extraction/scorer.js +1 -142
- package/dist/extraction/similarity.js +1 -85
- package/dist/hooks/client-factory.js +1 -44
- package/dist/hooks/post-tool-use.js +1 -470
- package/dist/hooks/pre-compact.js +1 -209
- package/dist/hooks/session-end.d.ts +1 -0
- package/dist/hooks/session-end.js +1 -623
- package/dist/hooks/session-start.js +1 -549
- package/dist/hooks/shared.js +1 -110
- package/dist/hooks/user-prompt-submit.js +1 -316
- package/dist/i18n/index.js +1 -2
- package/dist/i18n/messages.js +1 -150
- package/dist/index.js +1 -43
- package/dist/lifecycle/cleanup-scheduler.js +1 -137
- package/dist/lifecycle/cleanup.js +1 -116
- package/dist/lifecycle/index.js +1 -13
- package/dist/lifecycle/quality-scorer.js +1 -46
- package/dist/lifecycle/tiering.js +1 -246
- package/dist/llm/client.js +1 -226
- package/dist/llm/index.js +1 -5
- package/dist/proficiency/actr-engine.js +1 -106
- package/dist/proficiency/detection.js +1 -77
- package/dist/proficiency/index.js +1 -9
- package/dist/proficiency/tracker.js +1 -173
- package/dist/proficiency/types.js +1 -8
- package/dist/providers/adapters.js +1 -140
- package/dist/providers/detector.js +1 -57
- package/dist/search/adaptive-router.js +1 -93
- package/dist/search/index.js +1 -9
- package/dist/search/ranker.js +1 -171
- package/dist/search/reranker.js +1 -155
- package/dist/session/parser.js +1 -130
- package/dist/skill/evaluator.js +1 -509
- package/dist/skill/index.js +1 -7
- package/dist/skill/types.js +1 -7
- package/dist/sync/client.d.ts +1 -0
- package/dist/sync/client.js +1 -597
- package/dist/sync/encryption.js +1 -203
- package/dist/sync/index.js +1 -12
- package/dist/sync/queue.js +1 -199
- package/dist/sync/scheduler.js +1 -140
- package/dist/sync/synchronizer.js +1 -241
- package/dist/sync/team-synchronizer.js +1 -204
- package/dist/sync/vector-clock.js +1 -70
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.js +1 -131
- package/dist/utils/keychain.js +1 -170
- package/dist/utils/logger.js +1 -128
- package/package.json +14 -10
- package/dist/a2a/client.d.ts.map +0 -1
- package/dist/a2a/client.js.map +0 -1
- package/dist/a2a/discovery.d.ts.map +0 -1
- package/dist/a2a/discovery.js.map +0 -1
- package/dist/a2a/index.d.ts.map +0 -1
- package/dist/a2a/index.js.map +0 -1
- package/dist/a2a/types.d.ts.map +0 -1
- package/dist/a2a/types.js.map +0 -1
- package/dist/adapters/anthropic.d.ts.map +0 -1
- package/dist/adapters/anthropic.js.map +0 -1
- package/dist/chunking/chunker.d.ts.map +0 -1
- package/dist/chunking/chunker.js.map +0 -1
- package/dist/claude/sync.d.ts.map +0 -1
- package/dist/claude/sync.js.map +0 -1
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/claude-sync.d.ts.map +0 -1
- package/dist/cli/commands/claude-sync.js.map +0 -1
- package/dist/cli/commands/cleanup.d.ts.map +0 -1
- package/dist/cli/commands/cleanup.js.map +0 -1
- package/dist/cli/commands/config.d.ts.map +0 -1
- package/dist/cli/commands/config.js.map +0 -1
- package/dist/cli/commands/edit.d.ts.map +0 -1
- package/dist/cli/commands/edit.js.map +0 -1
- package/dist/cli/commands/embed.d.ts.map +0 -1
- package/dist/cli/commands/embed.js.map +0 -1
- package/dist/cli/commands/extract.d.ts.map +0 -1
- package/dist/cli/commands/extract.js.map +0 -1
- package/dist/cli/commands/health.d.ts.map +0 -1
- package/dist/cli/commands/health.js.map +0 -1
- package/dist/cli/commands/list.d.ts.map +0 -1
- package/dist/cli/commands/list.js.map +0 -1
- package/dist/cli/commands/migrate-chunks.d.ts.map +0 -1
- package/dist/cli/commands/migrate-chunks.js.map +0 -1
- package/dist/cli/commands/migrate-file-refs.d.ts.map +0 -1
- package/dist/cli/commands/migrate-file-refs.js.map +0 -1
- package/dist/cli/commands/proficiency.d.ts.map +0 -1
- package/dist/cli/commands/proficiency.js.map +0 -1
- package/dist/cli/commands/rm.d.ts.map +0 -1
- package/dist/cli/commands/rm.js.map +0 -1
- package/dist/cli/commands/search.d.ts.map +0 -1
- package/dist/cli/commands/search.js.map +0 -1
- package/dist/cli/commands/setup-wizard.d.ts.map +0 -1
- package/dist/cli/commands/setup-wizard.js.map +0 -1
- package/dist/cli/commands/setup.d.ts.map +0 -1
- package/dist/cli/commands/setup.js.map +0 -1
- package/dist/cli/commands/skill.d.ts.map +0 -1
- package/dist/cli/commands/skill.js.map +0 -1
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/sync.d.ts.map +0 -1
- package/dist/cli/commands/sync.js.map +0 -1
- package/dist/cli/commands/team.d.ts.map +0 -1
- package/dist/cli/commands/team.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/config/manager.d.ts.map +0 -1
- package/dist/config/manager.js.map +0 -1
- package/dist/db/database.d.ts.map +0 -1
- package/dist/db/database.js.map +0 -1
- package/dist/embedding/e5-provider.d.ts.map +0 -1
- package/dist/embedding/e5-provider.js.map +0 -1
- package/dist/embedding/index.d.ts.map +0 -1
- package/dist/embedding/index.js.map +0 -1
- package/dist/embedding/local-provider.d.ts.map +0 -1
- package/dist/embedding/local-provider.js.map +0 -1
- package/dist/embedding/openai-provider.d.ts.map +0 -1
- package/dist/embedding/openai-provider.js.map +0 -1
- package/dist/embedding/quantization.d.ts.map +0 -1
- package/dist/embedding/quantization.js.map +0 -1
- package/dist/extraction/dedup-manager.d.ts.map +0 -1
- package/dist/extraction/dedup-manager.js.map +0 -1
- package/dist/extraction/emotion-filter.d.ts.map +0 -1
- package/dist/extraction/emotion-filter.js.map +0 -1
- package/dist/extraction/extractor.d.ts.map +0 -1
- package/dist/extraction/extractor.js.map +0 -1
- package/dist/extraction/file-reference.d.ts.map +0 -1
- package/dist/extraction/file-reference.js.map +0 -1
- package/dist/extraction/filter.d.ts.map +0 -1
- package/dist/extraction/filter.js.map +0 -1
- package/dist/extraction/scorer.d.ts.map +0 -1
- package/dist/extraction/scorer.js.map +0 -1
- package/dist/extraction/similarity.d.ts.map +0 -1
- package/dist/extraction/similarity.js.map +0 -1
- package/dist/hooks/client-factory.d.ts.map +0 -1
- package/dist/hooks/client-factory.js.map +0 -1
- package/dist/hooks/post-tool-use.d.ts.map +0 -1
- package/dist/hooks/post-tool-use.js.map +0 -1
- package/dist/hooks/pre-compact.d.ts.map +0 -1
- package/dist/hooks/pre-compact.js.map +0 -1
- package/dist/hooks/session-end.d.ts.map +0 -1
- package/dist/hooks/session-end.js.map +0 -1
- package/dist/hooks/session-start.d.ts.map +0 -1
- package/dist/hooks/session-start.js.map +0 -1
- package/dist/hooks/shared.d.ts.map +0 -1
- package/dist/hooks/shared.js.map +0 -1
- package/dist/hooks/user-prompt-submit.d.ts.map +0 -1
- package/dist/hooks/user-prompt-submit.js.map +0 -1
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/index.js.map +0 -1
- package/dist/i18n/messages.d.ts.map +0 -1
- package/dist/i18n/messages.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lifecycle/cleanup-scheduler.d.ts.map +0 -1
- package/dist/lifecycle/cleanup-scheduler.js.map +0 -1
- package/dist/lifecycle/cleanup.d.ts.map +0 -1
- package/dist/lifecycle/cleanup.js.map +0 -1
- package/dist/lifecycle/index.d.ts.map +0 -1
- package/dist/lifecycle/index.js.map +0 -1
- package/dist/lifecycle/quality-scorer.d.ts.map +0 -1
- package/dist/lifecycle/quality-scorer.js.map +0 -1
- package/dist/lifecycle/tiering.d.ts.map +0 -1
- package/dist/lifecycle/tiering.js.map +0 -1
- package/dist/llm/client.d.ts.map +0 -1
- package/dist/llm/client.js.map +0 -1
- package/dist/llm/index.d.ts.map +0 -1
- package/dist/llm/index.js.map +0 -1
- package/dist/proficiency/actr-engine.d.ts.map +0 -1
- package/dist/proficiency/actr-engine.js.map +0 -1
- package/dist/proficiency/detection.d.ts.map +0 -1
- package/dist/proficiency/detection.js.map +0 -1
- package/dist/proficiency/index.d.ts.map +0 -1
- package/dist/proficiency/index.js.map +0 -1
- package/dist/proficiency/tracker.d.ts.map +0 -1
- package/dist/proficiency/tracker.js.map +0 -1
- package/dist/proficiency/types.d.ts.map +0 -1
- package/dist/proficiency/types.js.map +0 -1
- package/dist/providers/adapters.d.ts.map +0 -1
- package/dist/providers/adapters.js.map +0 -1
- package/dist/providers/detector.d.ts.map +0 -1
- package/dist/providers/detector.js.map +0 -1
- package/dist/search/adaptive-router.d.ts.map +0 -1
- package/dist/search/adaptive-router.js.map +0 -1
- package/dist/search/index.d.ts.map +0 -1
- package/dist/search/index.js.map +0 -1
- package/dist/search/ranker.d.ts.map +0 -1
- package/dist/search/ranker.js.map +0 -1
- package/dist/search/reranker.d.ts.map +0 -1
- package/dist/search/reranker.js.map +0 -1
- package/dist/session/parser.d.ts.map +0 -1
- package/dist/session/parser.js.map +0 -1
- package/dist/skill/evaluator.d.ts.map +0 -1
- package/dist/skill/evaluator.js.map +0 -1
- package/dist/skill/index.d.ts.map +0 -1
- package/dist/skill/index.js.map +0 -1
- package/dist/skill/types.d.ts.map +0 -1
- package/dist/skill/types.js.map +0 -1
- package/dist/sync/client.d.ts.map +0 -1
- package/dist/sync/client.js.map +0 -1
- package/dist/sync/encryption.d.ts.map +0 -1
- package/dist/sync/encryption.js.map +0 -1
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/index.js.map +0 -1
- package/dist/sync/queue.d.ts.map +0 -1
- package/dist/sync/queue.js.map +0 -1
- package/dist/sync/scheduler.d.ts.map +0 -1
- package/dist/sync/scheduler.js.map +0 -1
- package/dist/sync/synchronizer.d.ts.map +0 -1
- package/dist/sync/synchronizer.js.map +0 -1
- package/dist/sync/team-synchronizer.d.ts.map +0 -1
- package/dist/sync/team-synchronizer.js.map +0 -1
- package/dist/sync/vector-clock.d.ts.map +0 -1
- package/dist/sync/vector-clock.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/utils/keychain.d.ts.map +0 -1
- package/dist/utils/keychain.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
|
@@ -1,202 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sync Command
|
|
3
|
-
*/
|
|
4
|
-
import { Command } from 'commander';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import ora from 'ora';
|
|
7
|
-
import { ConfigManager } from '../../config/manager.js';
|
|
8
|
-
import { MemoryDatabase } from '../../db/database.js';
|
|
9
|
-
import { A2AClient } from '../../sync/client.js';
|
|
10
|
-
import { MemorySynchronizer } from '../../sync/synchronizer.js';
|
|
11
|
-
import { SyncScheduler } from '../../sync/scheduler.js';
|
|
12
|
-
import { createLogger } from '../../utils/logger.js';
|
|
13
|
-
export function syncCommand() {
|
|
14
|
-
const cmd = new Command('sync');
|
|
15
|
-
cmd
|
|
16
|
-
.description('Synchronize memories with A2A server')
|
|
17
|
-
.option('--push', 'Push local memories to server only')
|
|
18
|
-
.option('--pull', 'Pull remote memories from server only')
|
|
19
|
-
.option('--status', 'Show synchronization status')
|
|
20
|
-
.option('--watch', 'Run continuous sync on interval (default: 30min)')
|
|
21
|
-
.option('--interval <ms>', 'Sync interval in milliseconds (with --watch)', parseInt)
|
|
22
|
-
.action(async (options) => {
|
|
23
|
-
const config = new ConfigManager().load();
|
|
24
|
-
const db = new MemoryDatabase(config.db.path);
|
|
25
|
-
try {
|
|
26
|
-
db.initialize();
|
|
27
|
-
// API Key 확인
|
|
28
|
-
if (!config.server.apiKey) {
|
|
29
|
-
console.error(chalk.red('\n❌ API Key가 설정되지 않았습니다.\n'));
|
|
30
|
-
console.log(`다음 명령어로 설정하세요:\n ${chalk.cyan('a2a-memory config set server.apiKey YOUR_API_KEY')}\n`);
|
|
31
|
-
// TODO: process.exit() → throw + 상위 핸들러로 리팩토링 (P3-3)
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
const client = new A2AClient({
|
|
35
|
-
baseUrl: config.server.url,
|
|
36
|
-
apiKey: config.server.apiKey,
|
|
37
|
-
});
|
|
38
|
-
const synchronizer = new MemorySynchronizer(db, client);
|
|
39
|
-
// --status 옵션
|
|
40
|
-
if (options.status) {
|
|
41
|
-
await showSyncStatus(synchronizer);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
// --watch 옵션: 데몬 모드
|
|
45
|
-
if (options.watch) {
|
|
46
|
-
await executeWatch(synchronizer, config, options.interval);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
// 연결 테스트
|
|
50
|
-
const spinner = ora('서버 연결 확인 중...').start();
|
|
51
|
-
const connected = await client.testConnection();
|
|
52
|
-
if (!connected) {
|
|
53
|
-
spinner.fail(chalk.red('서버 연결 실패'));
|
|
54
|
-
console.log(chalk.yellow(`\n서버 URL을 확인하세요: ${chalk.cyan(config.server.url)}\n`));
|
|
55
|
-
// TODO: process.exit() → throw + 상위 핸들러로 리팩토링 (P3-3)
|
|
56
|
-
process.exit(1);
|
|
57
|
-
}
|
|
58
|
-
spinner.succeed(chalk.green('서버 연결 성공'));
|
|
59
|
-
// --push 옵션
|
|
60
|
-
if (options.push) {
|
|
61
|
-
await executePush(synchronizer, 0); // CLI: 무제한
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
// --pull 옵션
|
|
65
|
-
if (options.pull) {
|
|
66
|
-
await executePull(synchronizer);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
// 기본 동작: 양방향 동기화
|
|
70
|
-
await executeSync(synchronizer);
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
if (error instanceof Error) {
|
|
74
|
-
console.error(chalk.red(`\n❌ 오류: ${error.message}\n`));
|
|
75
|
-
}
|
|
76
|
-
// TODO: process.exit() → throw + 상위 핸들러로 리팩토링 (P3-3)
|
|
77
|
-
process.exit(1);
|
|
78
|
-
}
|
|
79
|
-
finally {
|
|
80
|
-
db.close();
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
return cmd;
|
|
84
|
-
}
|
|
85
|
-
async function showSyncStatus(synchronizer) {
|
|
86
|
-
const spinner = ora('동기화 상태 확인 중...').start();
|
|
87
|
-
const status = await synchronizer.getStatus();
|
|
88
|
-
spinner.stop();
|
|
89
|
-
console.log(chalk.bold('\n📊 동기화 상태\n'));
|
|
90
|
-
console.log(`${chalk.dim('로컬→원격 대기:')} ${chalk.yellow(status.pendingPush)}개`);
|
|
91
|
-
console.log(`${chalk.dim('원격→로컬 대기:')} ${chalk.yellow(status.pendingPull)}개`);
|
|
92
|
-
if (status.lastSyncedAt) {
|
|
93
|
-
const lastSynced = new Date(status.lastSyncedAt);
|
|
94
|
-
console.log(`${chalk.dim('마지막 동기화:')} ${chalk.cyan(lastSynced.toLocaleString())}`);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
console.log(`${chalk.dim('마지막 동기화:')} ${chalk.gray('없음')}`);
|
|
98
|
-
}
|
|
99
|
-
console.log();
|
|
100
|
-
}
|
|
101
|
-
async function executeSync(synchronizer) {
|
|
102
|
-
const spinner = ora('양방향 동기화 중...').start();
|
|
103
|
-
const result = await synchronizer.sync();
|
|
104
|
-
spinner.stop();
|
|
105
|
-
console.log(chalk.bold('\n✅ 동기화 완료\n'));
|
|
106
|
-
console.log(`${chalk.dim('로컬→원격:')} ${chalk.green(`${result.pushed}개`)}`);
|
|
107
|
-
console.log(`${chalk.dim('원격→로컬:')} ${chalk.green(`${result.pulled}개`)}`);
|
|
108
|
-
if (result.conflicts > 0) {
|
|
109
|
-
console.log(`${chalk.dim('충돌 해결:')} ${chalk.yellow(`${result.conflicts}개`)}`);
|
|
110
|
-
}
|
|
111
|
-
if (result.errors.length > 0) {
|
|
112
|
-
console.log(chalk.yellow(`\n⚠️ 경고: ${result.errors.length}개의 오류 발생`));
|
|
113
|
-
for (const error of result.errors.slice(0, 5)) {
|
|
114
|
-
console.log(` • ${chalk.dim(error)}`);
|
|
115
|
-
}
|
|
116
|
-
if (result.errors.length > 5) {
|
|
117
|
-
console.log(chalk.dim(` ... 외 ${result.errors.length - 5}개 오류`));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
console.log(chalk.dim(`\n소요 시간: ${(result.duration / 1000).toFixed(2)}초\n`));
|
|
121
|
-
}
|
|
122
|
-
async function executePush(synchronizer, timeoutMs) {
|
|
123
|
-
const spinner = ora('로컬→원격 동기화 중...').start();
|
|
124
|
-
const result = await synchronizer.push({ timeoutMs });
|
|
125
|
-
spinner.stop();
|
|
126
|
-
console.log(chalk.bold('\n✅ Push 완료\n'));
|
|
127
|
-
console.log(`${chalk.dim('전송된 메모리:')} ${chalk.green(`${result.pushed}개`)}`);
|
|
128
|
-
if (result.errors.length > 0) {
|
|
129
|
-
console.log(chalk.yellow(`\n⚠️ 경고: ${result.errors.length}개의 오류 발생`));
|
|
130
|
-
for (const error of result.errors.slice(0, 5)) {
|
|
131
|
-
console.log(` • ${chalk.dim(error)}`);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
console.log(chalk.dim(`\n소요 시간: ${(result.duration / 1000).toFixed(2)}초\n`));
|
|
135
|
-
}
|
|
136
|
-
async function executePull(synchronizer) {
|
|
137
|
-
const spinner = ora('원격→로컬 동기화 중...').start();
|
|
138
|
-
const result = await synchronizer.pull();
|
|
139
|
-
spinner.stop();
|
|
140
|
-
console.log(chalk.bold('\n✅ Pull 완료\n'));
|
|
141
|
-
console.log(`${chalk.dim('가져온 메모리:')} ${chalk.green(`${result.pulled}개`)}`);
|
|
142
|
-
if (result.conflicts > 0) {
|
|
143
|
-
console.log(`${chalk.dim('충돌 해결:')} ${chalk.yellow(`${result.conflicts}개`)}`);
|
|
144
|
-
}
|
|
145
|
-
if (result.errors.length > 0) {
|
|
146
|
-
console.log(chalk.yellow(`\n⚠️ 경고: ${result.errors.length}개의 오류 발생`));
|
|
147
|
-
for (const error of result.errors.slice(0, 5)) {
|
|
148
|
-
console.log(` • ${chalk.dim(error)}`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
console.log(chalk.dim(`\n소요 시간: ${(result.duration / 1000).toFixed(2)}초\n`));
|
|
152
|
-
}
|
|
153
|
-
async function executeWatch(synchronizer, config, intervalOverride) {
|
|
154
|
-
const intervalMs = intervalOverride ?? config.autoSync.intervalMs;
|
|
155
|
-
const logger = createLogger('SyncWatch', config.logging);
|
|
156
|
-
console.log(chalk.bold('\n🔄 Sync Watch 모드 시작\n'));
|
|
157
|
-
console.log(`${chalk.dim('주기:')} ${chalk.cyan(`${(intervalMs / 1000 / 60).toFixed(1)}분`)}`);
|
|
158
|
-
console.log(`${chalk.dim('중지:')} ${chalk.yellow('Ctrl+C')}\n`);
|
|
159
|
-
const scheduler = new SyncScheduler(synchronizer, {
|
|
160
|
-
intervalMs,
|
|
161
|
-
syncOnStart: true,
|
|
162
|
-
onSync: (result) => {
|
|
163
|
-
const now = new Date().toLocaleTimeString();
|
|
164
|
-
const parts = [];
|
|
165
|
-
if (result.pushed > 0)
|
|
166
|
-
parts.push(chalk.green(`↑${result.pushed}`));
|
|
167
|
-
if (result.pulled > 0)
|
|
168
|
-
parts.push(chalk.blue(`↓${result.pulled}`));
|
|
169
|
-
if (result.errors.length > 0)
|
|
170
|
-
parts.push(chalk.red(`!${result.errors.length}`));
|
|
171
|
-
const summary = parts.length > 0 ? parts.join(' ') : chalk.dim('no changes');
|
|
172
|
-
console.log(`[${chalk.dim(now)}] ${summary} (${result.duration}ms)`);
|
|
173
|
-
},
|
|
174
|
-
onError: (err) => {
|
|
175
|
-
const now = new Date().toLocaleTimeString();
|
|
176
|
-
console.log(`[${chalk.dim(now)}] ${chalk.red(`Error: ${err.message}`)}`);
|
|
177
|
-
},
|
|
178
|
-
}, logger);
|
|
179
|
-
// AbortController 기반 정상 종료 메커니즘
|
|
180
|
-
const ac = new AbortController();
|
|
181
|
-
const cleanupAndAbort = () => {
|
|
182
|
-
scheduler.stop();
|
|
183
|
-
const status = scheduler.getStatus();
|
|
184
|
-
console.log(`\n${chalk.bold('📊 Watch 종료')}`);
|
|
185
|
-
console.log(`${chalk.dim('총 동기화 횟수:')} ${status.syncCount}`);
|
|
186
|
-
logger.flush();
|
|
187
|
-
ac.abort();
|
|
188
|
-
};
|
|
189
|
-
process.on('SIGINT', cleanupAndAbort);
|
|
190
|
-
process.on('SIGTERM', cleanupAndAbort);
|
|
191
|
-
await scheduler.start();
|
|
192
|
-
// 프로세스가 종료되지 않도록 유지 (SIGINT/SIGTERM 시 정상 종료)
|
|
193
|
-
try {
|
|
194
|
-
await new Promise((_, reject) => {
|
|
195
|
-
ac.signal.addEventListener('abort', () => reject(new Error('shutdown')));
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
catch {
|
|
199
|
-
// 정상 종료
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
//# sourceMappingURL=sync.js.map
|
|
1
|
+
(function(_0x290232,_0x54aa14){function _0x19ce8e(_0x5f5336,_0x13f1be){return _0xd692(_0x13f1be- -0x34a,_0x5f5336);}const _0x27c541=_0x290232();function _0x2e754d(_0x15b164,_0x35e503){return _0xd692(_0x35e503- -0x145,_0x15b164);}while(!![]){try{const _0x4a0c4f=parseInt(_0x2e754d(-0x17,0x24))/0x1+parseInt(_0x2e754d(0xc,-0x3e))/0x2*(parseInt(_0x2e754d(-0x2c,-0xb))/0x3)+parseInt(_0x19ce8e(-0x1f6,-0x1ee))/0x4*(parseInt(_0x2e754d(-0x5,-0x48))/0x5)+parseInt(_0x19ce8e(-0x289,-0x258))/0x6*(parseInt(_0x2e754d(0x9,0x16))/0x7)+parseInt(_0x2e754d(0x2c,0x3c))/0x8+parseInt(_0x19ce8e(-0x258,-0x222))/0x9*(parseInt(_0x2e754d(0x6c,0x3f))/0xa)+-parseInt(_0x2e754d(-0x37,-0x9))/0xb*(parseInt(_0x2e754d(0x21,0x23))/0xc);if(_0x4a0c4f===_0x54aa14)break;else _0x27c541['push'](_0x27c541['shift']());}catch(_0x4abbfe){_0x27c541['push'](_0x27c541['shift']());}}}(_0x382a,0x8b8f3));import{Command}from'commander';function _0xd692(_0x1ff0a1,_0x1eefdb){_0x1ff0a1=_0x1ff0a1-0xe8;const _0x382a4e=_0x382a();let _0xd69207=_0x382a4e[_0x1ff0a1];if(_0xd692['WhndZn']===undefined){var _0xe4fb51=function(_0x1580dd){const _0x22237c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3c76f4='',_0xad7408='';for(let _0x3a9e89=0x0,_0x4ac18f,_0x2593b4,_0x25a45b=0x0;_0x2593b4=_0x1580dd['charAt'](_0x25a45b++);~_0x2593b4&&(_0x4ac18f=_0x3a9e89%0x4?_0x4ac18f*0x40+_0x2593b4:_0x2593b4,_0x3a9e89++%0x4)?_0x3c76f4+=String['fromCharCode'](0xff&_0x4ac18f>>(-0x2*_0x3a9e89&0x6)):0x0){_0x2593b4=_0x22237c['indexOf'](_0x2593b4);}for(let _0x3ef5ba=0x0,_0x16c760=_0x3c76f4['length'];_0x3ef5ba<_0x16c760;_0x3ef5ba++){_0xad7408+='%'+('00'+_0x3c76f4['charCodeAt'](_0x3ef5ba)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xad7408);};_0xd692['lUWWra']=_0xe4fb51,_0xd692['QyMTYs']={},_0xd692['WhndZn']=!![];}const _0x3dfd99=_0x382a4e[0x0],_0x43918c=_0x1ff0a1+_0x3dfd99,_0x35db09=_0xd692['QyMTYs'][_0x43918c];return!_0x35db09?(_0xd69207=_0xd692['lUWWra'](_0xd69207),_0xd692['QyMTYs'][_0x43918c]=_0xd69207):_0xd69207=_0x35db09,_0xd69207;}function _0x382a(){const _0x4d0973=['cUYgJoYALcdSI5ZQSiq6ia','u0Lhvevstq','6RcCioYyPoULMa','khDPDgGGls13yq','64UK7j2mioUQHEUGUEYwToUHNcdSHktSOju','BwvtDhjPBMC','uNDoDhu','tLDvvLC','ihDPDgGGqtjbia','Aw5PDgLHBgL6zq','B3b0Aw9U','zKzfA0u','CMvK','7isC67keioYxSoQYScdTMzxSNBGG7ksr','Dg9gAxHLza','mty1ntfPBM5mt2C','ytjHlw1LBw9YEq','zhvYyxrPB24','7jAr67cP7zALioUpMEQ4So2zLcdSPjeU','DxjS','ChLuvxe','Cgf0Aa','q3rYBcTd','Dg9mB2nHBgvuAq','rLriB2q','BgvUz3rO','AMXlyKu','t3rRz20','sLzvvhG','BgLZzwnVBMrZia','zgvZy3jPChrPBW','idXTCZ4','EgTjEeK','nMTnBLLhBW','C2vYDMvY','otqXmZHqsxPVB0i','sKfirwO','rxjYB3i6ia','7ko86RIWoG','vxftqw0','yxv0B1n5BMm','icdIGkiG','tefRufa','ug1tuwK','7j247zwy7is47jQuoIa','sgDNsxG','u0Lhsu5u','C3rHCNq','B25SEq','C3LUyW','CwfiAuO','Aw50zxj2ywXnCW','7jUq6RkP4OAs66gC7lUSoG','B24GAw50zxj2yq','CgvUzgLUz1b1CW','cUkDJcdSMktRPzG6ia','cUkCHsbqDxnOioYzHoUJJa','ywn0Aw9U','shr3vKi','C3vJy2vLza','uhvZAcbSB2nHBa','ls1ZDgf0Dxm','cVcFLiqGu3LUyYbxyq','zsbTzw1VCMLLCW','6RcC7j2yioYyPoULMcdRSjZSG50','igzYB20GC2vYDG','mtr3q3fQze0','mJa5mJC2wK1uv2XV','ChvSBa','y3LHBG','q05eDwS','cUkDJcbbueKGs2v5','7isC67keioYxSoQYScdSI6tTJkG','q2jxwu8','z3jLzw4','CgLlzxKGwu9vuG','ls1PBNrLCNzHBa','64+z6RIW7zMuioYdGE2dNcdTMzxSNBGG','t3rSvMq','ndq0mfHZww5AqG','ntqWoti2u3L0uKPw','vuLwz3K','7kce7iAH65cCioUPLoUQQoUMRdO','C2H1DgrVD24','cUkCHsdRJ5NQUldTMzqG7jMe66omcG','tLzvALm','6Rca7kc47jIOioUPLoUQQoUMRdO','uuX5DK8','ywrKrxzLBNrmAq','ls1WDxnO','EwvSBg93','uhvSBcbYzw1VDa','x0fqsv9lrvK','C2LNBMfS','6RcaioYePoYGLEUqMoYNGcdSLyRSLzJSIRu','ls1WDwXS','yM9Sza','BxmP','cUkCHsbqDwXSioYzHoUJJa','ihn0yxr1CW','sK9JCey','zxjYB3i','7ksrlI4U','DcbZzxj2zxiUyq','ndGWmdG3mMfNweDYta','ywjVCNq','t3zmAwS','nJeWmgXlDwnICa','tujUyKq','EuXMywW','yxbPs2v5','BgfZDfn5BMnLza','DMfSigLUig1PBa','zxjYB3jZ','zxHPDa','vurpzwu','66Ei7kEa66EjioUpMEQ4So2zLdO','DgnOioUQQoUtNcdSI5ZSNPek','C2XPy2u','C3LUy0nVDw50','AMvJAMm','B3PdzNe','zNHUs0y','oIaZmg1PBIK','zgLT','CMLUzW','wNPcsKm','thrpAKi','C3rLBMvY','yMX1zq','t2LcteG','lI4U','CfDItgm','nZq4nJq0vw5Hyu9K','ze5VALu','u2HVDYbZEw5JAa','su5qDeC','ig1LBw9YAwvZia','ChvZAa','wKD1thO','7isC67keioYxSoQYScdSHlhQS7u','z2v0u3rHDhvZ','cUkAOo+4JYaG6Rk96RoGoIa','AM9PBG','mtaWqNrYsxLo','uurPzNq','su5kvuC','uNvUignVBNrPBG','y29UzMXPy3rZ','7lAP64+mio2vToQYSdO','y2XVC2u','66gC7lUS4OAs7jUq6RkPoG','64Ui64UKlGO','ChvZAgvK','mtC5mZqYtKzqAunH','ChvSBgvK','8j+tIIbxyxrJAcdSOOxRO4W','rNbXvwC','EwXkz0i','DgnOkq','ls13yxrJAa','Bg9N','BwvZC2fNzq','DwTouxe','7jUq6RkP4OAs66gC7lUSioUpMEQ4So2zLca','C3rHDhvZ','Aw50zxj2ywW','q2nTu3K','Bg1dwu0','uun1zfC','C3rVCa','Bg9Hza'];_0x382a=function(){return _0x4d0973;};return _0x382a();}import _0x58ddd7 from'chalk';import _0x39dac8 from'ora';import{ConfigManager}from'../../config/manager.js';import{MemoryDatabase}from'../../db/database.js';import{A2AClient}from'../../sync/client.js';import{MemorySynchronizer}from'../../sync/synchronizer.js';import{SyncScheduler}from'../../sync/scheduler.js';import{createLogger}from'../../utils/logger.js';export function syncCommand(){function _0x23a876(_0x5f2519,_0xbbb11b){return _0xd692(_0xbbb11b-0x3e4,_0x5f2519);}function _0x52bd9f(_0x5279e6,_0x393b45){return _0xd692(_0x393b45-0xda,_0x5279e6);}const _0x22bfd2={'INJUG':_0x52bd9f(0x26f,0x23a)+_0x52bd9f(0x1fe,0x251)+_0x23a876(0x538,0x4e9),'JAHEj':_0x23a876(0x53a,0x50d)+'\x20config\x20se'+_0x23a876(0x529,0x564)+_0x23a876(0x4f7,0x548)+_0x23a876(0x598,0x559),'ylJgB':function(_0x133ff4,_0x3db4f2){return _0x133ff4(_0x3db4f2);},'qaHiJ':function(_0x2c011a,_0x4359a2,_0x109ed5,_0x51420c){return _0x2c011a(_0x4359a2,_0x109ed5,_0x51420c);},'zXzSd':function(_0x10e3d4,_0x253022){return _0x10e3d4(_0x253022);},'hfoPK':function(_0x84de9e,_0x4e1473){return _0x84de9e===_0x4e1473;},'LtOjB':_0x52bd9f(0x1dd,0x1d8),'NWUVW':_0x52bd9f(0x27a,0x23b),'RwNtu':function(_0x1e5eba,_0x343c2a){return _0x1e5eba instanceof _0x343c2a;},'LaaUa':function(_0x397a50,_0x2017c6){return _0x397a50===_0x2017c6;},'NVUjS':'Synchroniz'+'e\x20memories'+_0x52bd9f(0x1c8,0x1fb)+_0x52bd9f(0x23e,0x215),'FpqUg':_0x23a876(0x59f,0x556),'QLyvO':_0x52bd9f(0x27b,0x24e)+_0x52bd9f(0x227,0x232)+_0x52bd9f(0x224,0x234)+'er\x20only','YJTIM':_0x52bd9f(0x273,0x230),'lmCYM':'Sync\x20inter'+_0x23a876(0x5a0,0x56d)+_0x23a876(0x50b,0x51a)+_0x23a876(0x4c0,0x500)+_0x23a876(0x4cc,0x4f0)},_0x1f11b5=new Command('sync');return _0x1f11b5[_0x23a876(0x557,0x51b)+'n'](_0x22bfd2[_0x23a876(0x538,0x552)])[_0x52bd9f(0x1f7,0x1fd)](_0x22bfd2[_0x23a876(0x4e1,0x4ee)],_0x23a876(0x587,0x539)+_0x52bd9f(0x1f6,0x1d0)+'to\x20server\x20'+_0x52bd9f(0x20b,0x223))['option'](_0x23a876(0x539,0x55c),_0x22bfd2[_0x52bd9f(0x291,0x24a)])[_0x23a876(0x54d,0x507)](_0x22bfd2['YJTIM'],_0x23a876(0x52c,0x4d8)+'ronization'+_0x52bd9f(0x214,0x256))['option'](_0x23a876(0x518,0x4f1),_0x52bd9f(0x1e2,0x1da)+'uous\x20sync\x20'+_0x52bd9f(0x1fb,0x228)+'l\x20(default'+_0x52bd9f(0x1a0,0x1c2))['option'](_0x52bd9f(0x249,0x23f)+_0x52bd9f(0x212,0x212),_0x22bfd2[_0x52bd9f(0x220,0x1ef)],parseInt)[_0x23a876(0x557,0x536)](async _0x2e4e21=>{function _0x3a5215(_0xd1b1a9,_0x554d60){return _0x52bd9f(_0xd1b1a9,_0x554d60-0xda);}const _0x42f2c8=new ConfigManager()[_0x3a5215(0x2be,0x2cc)](),_0x42a31=new MemoryDatabase(_0x42f2c8['db'][_0x3a5215(0x30e,0x2e2)]);function _0x38da2b(_0x4c0c41,_0xaf61fa){return _0x52bd9f(_0x4c0c41,_0xaf61fa- -0x3f9);}try{_0x42a31[_0x38da2b(-0x1c5,-0x1fd)]();!_0x42f2c8['server']['apiKey']&&(console['error'](_0x58ddd7[_0x3a5215(0x2fb,0x2d9)](_0x22bfd2[_0x38da2b(-0x20f,-0x220)])),console[_0x3a5215(0x2ac,0x2c2)](_0x3a5215(0x320,0x2d1)+'하세요:\x0a\x20\x20'+_0x58ddd7['cyan'](_0x22bfd2[_0x3a5215(0x2bb,0x2f1)])+'\x0a'),process['exit'](0x1));const _0x32568d=new A2AClient({'baseUrl':_0x42f2c8[_0x3a5215(0x322,0x2ef)][_0x38da2b(-0x1b8,-0x1f3)],'apiKey':_0x42f2c8[_0x38da2b(-0x223,-0x1e4)][_0x3a5215(0x34f,0x33b)]}),_0x110ffb=new MemorySynchronizer(_0x42a31,_0x32568d);if(_0x2e4e21[_0x3a5215(0x2c0,0x2c6)]){await _0x22bfd2[_0x38da2b(-0x24e,-0x214)](showSyncStatus,_0x110ffb);return;}if(_0x2e4e21['watch']){await _0x22bfd2[_0x3a5215(0x2cb,0x2ff)](executeWatch,_0x110ffb,_0x42f2c8,_0x2e4e21[_0x3a5215(0x2a7,0x2c7)]);return;}const _0x4bb84d=_0x22bfd2['zXzSd'](_0x39dac8,_0x38da2b(-0x1fc,-0x1f9)+_0x3a5215(0x254,0x2a4))[_0x38da2b(-0x20f,-0x1d7)](),_0x1dbcd7=await _0x32568d['testConnec'+'tion']();!_0x1dbcd7&&(_0x22bfd2['hfoPK'](_0x38da2b(-0x1ee,-0x1b8),_0x22bfd2[_0x38da2b(-0x23a,-0x233)])?_0x2d4e97['log'](_0x4e0ab2[_0x3a5215(0x264,0x29d)](_0x38da2b(-0x230,-0x21d))+'\x20'+_0x363740[_0x38da2b(-0x18d,-0x1ac)](_0x48774e['conflicts']+'개')):(_0x4bb84d['fail'](_0x58ddd7[_0x3a5215(0x299,0x2d9)](_0x22bfd2[_0x38da2b(-0x218,-0x1ff)])),console[_0x3a5215(0x314,0x2c2)](_0x58ddd7[_0x38da2b(-0x179,-0x1ac)]('\x0a서버\x20URL을\x20확'+_0x38da2b(-0x18a,-0x1da)+_0x58ddd7[_0x3a5215(0x344,0x312)](_0x42f2c8['server'][_0x38da2b(-0x21d,-0x1f3)])+'\x0a')),process[_0x38da2b(-0x141,-0x194)](0x1)));_0x4bb84d[_0x38da2b(-0x21f,-0x1cb)](_0x58ddd7[_0x38da2b(-0x200,-0x1bc)](_0x38da2b(-0x24b,-0x226)));if(_0x2e4e21['push']){await executePush(_0x110ffb,0x0);return;}if(_0x2e4e21[_0x3a5215(0x30b,0x311)]){await executePull(_0x110ffb);return;}await executeSync(_0x110ffb);}catch(_0x410898){_0x22bfd2[_0x38da2b(-0x231,-0x200)](_0x410898,Error)&&(_0x22bfd2['LaaUa'](_0x38da2b(-0x1c1,-0x209),'QCudW')?console[_0x38da2b(-0x15c,-0x1a1)](_0x58ddd7['red'](_0x3a5215(0x30c,0x304)+_0x410898[_0x3a5215(0x309,0x2c3)]+'\x0a')):_0x35faf2[_0x3a5215(0x26c,0x2c2)]('\x20\x20•\x20'+_0x2ef9ac[_0x3a5215(0x2e0,0x29d)](_0x280bd3))),process[_0x38da2b(-0x1a0,-0x194)](0x1);}finally{_0x42a31[_0x3a5215(0x2b3,0x2b7)]();}}),_0x1f11b5;}async function showSyncStatus(_0x22cd39){const _0x291efe={'axgds':'\x0a📊\x20동기화\x20상태\x0a','OvLik':'로컬→원격\x20대기:','jecjc':function(_0x5c12d3,_0xd423fd){return _0x5c12d3!==_0xd423fd;},'MBnbD':_0x1ab84a(-0x6,0xa),'GXJzz':_0x2676cb(0x51b,0x4d9)},_0x2b3141=_0x39dac8(_0x2676cb(0x4f4,0x510)+_0x2676cb(0x50d,0x4e7))[_0x1ab84a(0x15,0x1e)](),_0x119c0b=await _0x22cd39[_0x2676cb(0x488,0x47d)]();_0x2b3141[_0x1ab84a(0x43,-0x13)]();function _0x1ab84a(_0x122d74,_0x3e0406){return _0xd692(_0x3e0406- -0x12a,_0x122d74);}console['log'](_0x58ddd7['bold'](_0x291efe['axgds']));function _0x2676cb(_0x332e78,_0x46b06a){return _0xd692(_0x332e78-0x38e,_0x46b06a);}console[_0x2676cb(0x49c,0x467)](_0x58ddd7[_0x1ab84a(-0x48,-0x41)](_0x291efe[_0x1ab84a(0x95,0x59)])+'\x20'+_0x58ddd7['yellow'](_0x119c0b[_0x2676cb(0x4dd,0x515)+'h'])+'개'),console[_0x1ab84a(0x20,-0x1c)](_0x58ddd7['dim']('원격→로컬\x20대기:')+'\x20'+_0x58ddd7[_0x1ab84a(0x5b,0x49)](_0x119c0b['pendingPul'+'l'])+'개');if(_0x119c0b[_0x1ab84a(0x6b,0x5e)+'At']){const _0x41a7fe=new Date(_0x119c0b['lastSynced'+'At']);console['log'](_0x58ddd7['dim'](_0x2676cb(0x51b,0x531))+'\x20'+_0x58ddd7[_0x1ab84a(0x1a,0x34)](_0x41a7fe['toLocaleSt'+_0x2676cb(0x478,0x45d)]()));}else _0x291efe[_0x2676cb(0x51f,0x528)](_0x291efe[_0x1ab84a(0x7c,0x5b)],_0x2676cb(0x520,0x56d))?console[_0x2676cb(0x49c,0x4b1)](_0x58ddd7[_0x2676cb(0x477,0x470)](_0x291efe['GXJzz'])+'\x20'+_0x58ddd7['gray']('없음')):_0x3ded30[_0x2676cb(0x49c,0x46c)](_0x3e1355[_0x2676cb(0x477,0x4a0)](_0x1ab84a(-0x1c,-0x28))+'\x20'+_0x15c3ec[_0x2676cb(0x501,0x52c)](_0x3c7ddf['conflicts']+'개'));console[_0x1ab84a(0x33,-0x1c)]();}async function executeSync(_0x4b5480){const _0x5985f4={'yLfal':_0x309b98(0x411,0x3da)+'..','EzEzK':_0x309b98(0x422,0x41c),'HtwVB':_0x236308(-0x118,-0xd3),'SsyiA':_0x236308(-0x152,-0xfc),'pyTUq':function(_0x428a3f,_0x3511a4){return _0x428a3f>_0x3511a4;}};function _0x236308(_0x435e05,_0x5450c9){return _0xd692(_0x5450c9- -0x220,_0x435e05);}const _0x260af2=_0x39dac8(_0x5985f4[_0x236308(-0xc6,-0x9a)])[_0x309b98(0x3d5,0x3f7)](),_0x505fec=await _0x4b5480[_0x236308(-0x9f,-0xd6)]();function _0x309b98(_0x303659,_0x579973){return _0xd692(_0x579973-0x2af,_0x303659);}_0x260af2[_0x309b98(0x3cc,0x3c6)](),console[_0x236308(-0xd2,-0x112)](_0x58ddd7['bold'](_0x5985f4['EzEzK'])),console['log'](_0x58ddd7['dim'](_0x309b98(0x38b,0x3b3))+'\x20'+_0x58ddd7[_0x309b98(0x3da,0x412)](_0x505fec[_0x236308(-0x12a,-0x11a)]+'개')),console['log'](_0x58ddd7[_0x309b98(0x3c8,0x398)](_0x5985f4[_0x309b98(0x3e6,0x402)])+'\x20'+_0x58ddd7[_0x236308(-0x109,-0xbd)](_0x505fec['pulled']+'개'));if(_0x505fec[_0x236308(-0x101,-0x11f)]>0x0){if(_0x236308(-0x12d,-0x131)===_0x5985f4['SsyiA']){const _0xe02842=new _0x5d5869()[_0x236308(-0x10f,-0xf0)+_0x236308(-0xef,-0x102)]();_0x403b4f['log']('['+_0x493c11['dim'](_0xe02842)+']\x20'+_0x497555[_0x236308(-0xbf,-0xfb)](_0x309b98(0x3d4,0x3ed)+_0x358618['message']));}else console['log'](_0x58ddd7['dim'](_0x236308(-0x12d,-0x11e))+'\x20'+_0x58ddd7[_0x236308(-0x99,-0xad)](_0x505fec[_0x309b98(0x3ee,0x3b0)]+'개'));}if(_0x5985f4[_0x309b98(0x3b0,0x3dc)](_0x505fec[_0x236308(-0xb8,-0x96)][_0x309b98(0x397,0x3e1)],0x0)){console[_0x236308(-0x14e,-0x112)](_0x58ddd7[_0x236308(-0x5d,-0xad)](_0x236308(-0x11c,-0x125)+_0x505fec[_0x236308(-0xab,-0x96)]['length']+_0x236308(-0xba,-0xc7)));for(const _0x448b05 of _0x505fec[_0x236308(-0xaa,-0x96)][_0x309b98(0x430,0x43e)](0x0,0x5)){console[_0x309b98(0x3c8,0x3bd)](_0x236308(-0x133,-0xde)+_0x58ddd7[_0x309b98(0x375,0x398)](_0x448b05));}_0x5985f4[_0x236308(-0xb4,-0xf3)](_0x505fec[_0x309b98(0x45b,0x439)]['length'],0x5)&&console[_0x309b98(0x36b,0x3bd)](_0x58ddd7[_0x309b98(0x34d,0x398)]('\x20\x20...\x20외\x20'+(_0x505fec[_0x309b98(0x412,0x439)][_0x236308(-0x9b,-0xee)]-0x5)+_0x309b98(0x396,0x3ca)));}console[_0x236308(-0x114,-0x112)](_0x58ddd7[_0x309b98(0x3c8,0x398)]('\x0a소요\x20시간:\x20'+(_0x505fec[_0x236308(-0x129,-0xf6)]/0x3e8)[_0x309b98(0x3b1,0x3d6)](0x2)+'초\x0a'));}async function executePush(_0x4e4d3f,_0x26e83b){const _0x382e90={'payyH':function(_0x2c749b,_0x336ae7){return _0x2c749b instanceof _0x336ae7;},'FTHod':'로컬→원격\x20동기화\x20'+_0x5a9718(0xbd,0x10b),'dNojU':_0x117fb9(-0xbc,-0xa5),'HggIx':function(_0x5b8520,_0x16c4f2){return _0x5b8520!==_0x16c4f2;},'ZzBJC':_0x5a9718(0x7e,0x29),'LAkPP':function(_0xbccf22,_0x3f7876){return _0xbccf22/_0x3f7876;}},_0x16db19=_0x39dac8(_0x382e90[_0x117fb9(-0x109,-0xdf)])[_0x117fb9(-0xf9,-0xc8)](),_0x2582df=await _0x4e4d3f[_0x117fb9(-0x14f,-0x119)]({'timeoutMs':_0x26e83b});function _0x117fb9(_0x34bb7e,_0x5c8c8f){return _0xd692(_0x5c8c8f- -0x210,_0x34bb7e);}_0x16db19[_0x117fb9(-0xd9,-0xf9)]();function _0x5a9718(_0x46f4e5,_0x28ca3d){return _0xd692(_0x46f4e5- -0xc2,_0x28ca3d);}console[_0x5a9718(0x4c,0x8)](_0x58ddd7['bold'](_0x5a9718(0x8f,0x97)+'\x0a')),console['log'](_0x58ddd7['dim'](_0x382e90[_0x117fb9(-0xec,-0x11d)])+'\x20'+_0x58ddd7[_0x5a9718(0xa1,0xd3)](_0x2582df['pushed']+'개'));if(_0x2582df['errors'][_0x117fb9(-0xec,-0xde)]>0x0){if(_0x382e90[_0x117fb9(-0xc8,-0xca)](_0x382e90[_0x5a9718(0x29,0x7e)],'LSKKx')){console[_0x117fb9(-0x151,-0x102)](_0x58ddd7[_0x117fb9(-0x83,-0x9d)](_0x117fb9(-0x148,-0x115)+_0x2582df['errors'][_0x117fb9(-0x127,-0xde)]+_0x117fb9(-0x6c,-0xb7)));for(const _0x3a480e of _0x2582df[_0x5a9718(0xc8,0x8c)][_0x117fb9(-0x4e,-0x81)](0x0,0x5)){console[_0x5a9718(0x4c,0x55)]('\x20\x20•\x20'+_0x58ddd7[_0x117fb9(-0x13f,-0x127)](_0x3a480e));}}else DkcJqe['payyH'](_0xf49c41,_0x4a7332)&&_0x3507d8['error'](_0x269507[_0x5a9718(0x63,0x45)]('\x0a❌\x20오류:\x20'+_0x48c469[_0x117fb9(-0x151,-0x101)]+'\x0a')),_0x4c27d0[_0x5a9718(0xc9,0x10b)](0x1);}console[_0x5a9718(0x4c,0x18)](_0x58ddd7[_0x5a9718(0x27,0x72)](_0x5a9718(0x57,0xad)+_0x382e90[_0x117fb9(-0x96,-0xcd)](_0x2582df[_0x5a9718(0x68,0x13)],0x3e8)['toFixed'](0x2)+'초\x0a'));}async function executePull(_0x4d7193){const _0x3a6a54={'slfYL':_0x27f156(-0x2a0,-0x25d)+_0x27f156(-0x1c1,-0x1ef),'ukNQq':_0x27f156(-0x1d5,-0x1ff),'JOcpF':_0x214db8(0x23a,0x274),'JWFiU':function(_0x36eaea,_0x2a0c16){return _0x36eaea>_0x2a0c16;}},_0xc94e45=_0x39dac8(_0x3a6a54['slfYL'])[_0x27f156(-0x248,-0x226)]();function _0x27f156(_0x467baf,_0x1b4f6c){return _0xd692(_0x1b4f6c- -0x36e,_0x467baf);}const _0xb21ed2=await _0x4d7193[_0x27f156(-0x216,-0x211)]();_0xc94e45[_0x214db8(0x260,0x289)](),console[_0x27f156(-0x24e,-0x260)](_0x58ddd7[_0x27f156(-0x20b,-0x1f5)](_0x214db8(0x311,0x2ed)+'\x0a')),console[_0x214db8(0x2a6,0x280)](_0x58ddd7[_0x27f156(-0x2cb,-0x285)](_0x3a6a54[_0x27f156(-0x228,-0x25e)])+'\x20'+_0x58ddd7[_0x214db8(0x28c,0x2d5)](_0xb21ed2[_0x214db8(0x293,0x27a)]+'개'));function _0x214db8(_0x46df14,_0x418517){return _0xd692(_0x418517-0x172,_0x46df14);}_0xb21ed2[_0x27f156(-0x219,-0x26d)]>0x0&&console['log'](_0x58ddd7['dim'](_0x3a6a54[_0x27f156(-0x222,-0x1f1)])+'\x20'+_0x58ddd7[_0x27f156(-0x1d7,-0x1fb)](_0xb21ed2['conflicts']+'개'));if(_0x3a6a54['JWFiU'](_0xb21ed2[_0x27f156(-0x1bb,-0x1e4)][_0x27f156(-0x215,-0x23c)],0x0)){console[_0x27f156(-0x251,-0x260)](_0x58ddd7[_0x214db8(0x2e4,0x2e5)](_0x214db8(0x242,0x26d)+_0xb21ed2['errors']['length']+'개의\x20오류\x20발생'));for(const _0x4852d3 of _0xb21ed2[_0x214db8(0x2d7,0x2fc)][_0x27f156(-0x1cd,-0x1df)](0x0,0x5)){console[_0x27f156(-0x242,-0x260)](_0x27f156(-0x25a,-0x22c)+_0x58ddd7[_0x214db8(0x264,0x25b)](_0x4852d3));}}console['log'](_0x58ddd7[_0x27f156(-0x24c,-0x285)]('\x0a소요\x20시간:\x20'+(_0xb21ed2[_0x27f156(-0x242,-0x244)]/0x3e8)[_0x27f156(-0x28b,-0x247)](0x2)+'초\x0a'));}async function executeWatch(_0x354085,_0x50e064,_0x1161ed){function _0xa39c1(_0x238f7d,_0x44c69e){return _0xd692(_0x44c69e-0x11c,_0x238f7d);}const _0x459a1c={'PmSQi':function(_0x2b34e8,_0x56420b){return _0x2b34e8>_0x56420b;},'pWbLc':function(_0x258518,_0x5c7565){return _0x258518>_0x5c7565;},'CbWYO':function(_0x5d07be,_0x471e5e){return _0x5d07be>_0x471e5e;},'oFBaI':'no\x20changes','jlKbE':_0x16d96b(-0xc7,-0xfc),'fxnKF':'총\x20동기화\x20횟수:','UIVgy':'\x0a❌\x20API\x20Key'+_0x16d96b(-0xa2,-0xe4)+_0xa39c1(0x242,0x221),'iuRkV':_0x16d96b(-0x15c,-0x132)+'\x20config\x20se'+_0xa39c1(0x2ec,0x29c)+_0x16d96b(-0xcf,-0xf7)+'_API_KEY','UDOee':function(_0x4d564f,_0xb55528,_0xa8a321){return _0x4d564f(_0xb55528,_0xa8a321);},'INPtG':'SyncWatch','ZGuLz':_0xa39c1(0x253,0x273)+_0xa39c1(0x2f4,0x2aa),'zCGVY':_0xa39c1(0x240,0x25b),'AKURa':function(_0x264dde,_0x11443c){return _0x264dde/_0x11443c;},'JVUTx':'중지:','xkIxI':_0x16d96b(-0x182,-0x12c)},_0x4a5978=_0x1161ed??_0x50e064[_0xa39c1(0x25a,0x25d)][_0xa39c1(0x298,0x268)],_0x58e2bd=_0x459a1c[_0x16d96b(-0xda,-0xcf)](createLogger,_0x459a1c[_0x16d96b(-0x13f,-0x166)],_0x50e064['logging']);console[_0x16d96b(-0x19d,-0x14d)](_0x58ddd7[_0x16d96b(-0x135,-0xe2)](_0x459a1c[_0xa39c1(0x1df,0x214)])),console[_0xa39c1(0x20e,0x22a)](_0x58ddd7['dim'](_0x459a1c['zCGVY'])+'\x20'+_0x58ddd7[_0x16d96b(-0x10f,-0xfd)]((_0x459a1c['AKURa'](_0x4a5978,0x3e8)/0x3c)[_0xa39c1(0x248,0x243)](0x1)+'분')),console['log'](_0x58ddd7[_0x16d96b(-0x142,-0x172)](_0x459a1c[_0x16d96b(-0x16f,-0x126)])+'\x20'+_0x58ddd7[_0xa39c1(0x26a,0x28f)](_0x459a1c[_0x16d96b(-0x143,-0x122)])+'\x0a');const _0x4aa834=new SyncScheduler(_0x354085,{'intervalMs':_0x4a5978,'syncOnStart':!![],'onSync':_0x9ca390=>{const _0x1e2618=new Date()[_0x5e5983(0xc1,0xa4)+'meString'](),_0x3dd485=[];function _0x1f3309(_0x5f2788,_0x40d53d){return _0x16d96b(_0x40d53d,_0x5f2788-0x2b6);}if(_0x459a1c[_0x5e5983(0xdd,0xb8)](_0x9ca390['pushed'],0x0))_0x3dd485[_0x5e5983(0x31,0x6b)](_0x58ddd7[_0x1f3309(0x1be,0x1a6)]('↑'+_0x9ca390[_0x5e5983(0x85,0x7a)]));function _0x5e5983(_0x127f43,_0x1a424e){return _0x16d96b(_0x127f43,_0x1a424e-0x1cf);}if(_0x459a1c[_0x1f3309(0x14c,0x15b)](_0x9ca390[_0x5e5983(0x26,0x7c)],0x0))_0x3dd485[_0x1f3309(0x152,0x13b)](_0x58ddd7[_0x5e5983(0x76,0x62)]('↓'+_0x9ca390[_0x1f3309(0x163,0x180)]));if(_0x9ca390[_0x5e5983(0xba,0xfe)][_0x5e5983(0xe3,0xa6)]>0x0)_0x3dd485[_0x5e5983(0xa3,0x6b)](_0x58ddd7['red']('!'+_0x9ca390['errors'][_0x1f3309(0x18d,0x190)]));const _0x146d33=_0x459a1c[_0x5e5983(0x100,0xd6)](_0x3dd485[_0x1f3309(0x18d,0x156)],0x0)?_0x3dd485[_0x1f3309(0x157,0x17e)]('\x20'):_0x58ddd7[_0x5e5983(0x60,0x5d)](_0x459a1c['oFBaI']);console[_0x5e5983(0x8a,0x82)]('['+_0x58ddd7['dim'](_0x1e2618)+']\x20'+_0x146d33+'\x20('+_0x9ca390['duration']+_0x1f3309(0x1d5,0x21c));},'onError':_0x242e9c=>{function _0x321d2b(_0x930d8e,_0x468625){return _0x16d96b(_0x468625,_0x930d8e-0x505);}const _0x4d501f=new Date()['toLocaleTi'+'meString']();function _0x5ec1f3(_0x40d617,_0x4c0617){return _0x16d96b(_0x4c0617,_0x40d617-0x16d);}console['log']('['+_0x58ddd7[_0x321d2b(0x393,0x3d9)](_0x4d501f)+']\x20'+_0x58ddd7[_0x321d2b(0x3cf,0x390)](_0x5ec1f3(0x50,0x4e)+_0x242e9c[_0x5ec1f3(0x21,0x19)]));}},_0x58e2bd),_0x12f1df=new AbortController(),_0x494dff=()=>{function _0x24f58d(_0x9570b1,_0x13563d){return _0xa39c1(_0x9570b1,_0x13563d- -0x3f5);}function _0x158966(_0x3291b8,_0x5931a0){return _0xa39c1(_0x3291b8,_0x5931a0- -0x8b);}if(_0x459a1c[_0x158966(0x1ac,0x1c4)]!=='MXaRo'){_0x4aa834[_0x158966(0x1d3,0x1a8)]();const _0xca9040=_0x4aa834[_0x24f58d(-0x21c,-0x1df)]();console[_0x158966(0x158,0x19f)]('\x0a'+_0x58ddd7[_0x24f58d(-0x185,-0x160)](_0x158966(0x1f0,0x19a))),console[_0x24f58d(-0x198,-0x1cb)](_0x58ddd7[_0x158966(0x14b,0x17a)](_0x459a1c[_0x158966(0x279,0x224)])+'\x20'+_0xca9040[_0x158966(0x1fc,0x221)]),_0x58e2bd['flush'](),_0x12f1df['abort']();}else _0x587933['error'](_0x540a98[_0x24f58d(-0x17c,-0x1b4)](_0x24f58d(-0x1a6,-0x189)+_0x5401ab[_0x158966(0x1a0,0x1a0)]+'\x0a'));};process['on'](_0xa39c1(0x272,0x263),_0x494dff),process['on'](_0x16d96b(-0xf1,-0x141),_0x494dff);function _0x16d96b(_0x20ad03,_0x1b574a){return _0xd692(_0x1b574a- -0x25b,_0x20ad03);}await _0x4aa834[_0x16d96b(-0x138,-0x113)]();try{'CcmSy'!==_0xa39c1(0x277,0x230)?(_0x25a45b[_0xa39c1(0x25a,0x29a)](_0x3ef5ba[_0x16d96b(-0xea,-0x136)](diqDqe[_0xa39c1(0x29b,0x286)])),_0x16c760[_0x16d96b(-0x140,-0x14d)]('다음\x20명령어로\x20설정'+'하세요:\x0a\x20\x20'+_0x39241f['cyan'](diqDqe['iuRkV'])+'\x0a'),_0x3e733e[_0xa39c1(0x2ab,0x2a7)](0x1)):await new Promise((_0x5e7bb1,_0x4fd4a0)=>{function _0x5224fa(_0x2df692,_0x10c79d){return _0xa39c1(_0x10c79d,_0x2df692- -0x4d2);}function _0xfb5878(_0x19ed3e,_0x3b18ce){return _0xa39c1(_0x19ed3e,_0x3b18ce-0x1bc);}_0x12f1df[_0xfb5878(0x41a,0x44e)][_0xfb5878(0x406,0x449)+_0xfb5878(0x3e3,0x3c5)](_0xfb5878(0x430,0x45a),()=>_0x4fd4a0(new Error(_0x5224fa(-0x24a,-0x296))));});}catch{}}
|
|
@@ -1,142 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI Team Commands
|
|
3
|
-
* 팀 메모리 관리 (가입, 탈퇴, 목록, 상태, 동기화)
|
|
4
|
-
*/
|
|
5
|
-
import { Command } from 'commander';
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import { ConfigManager, generateNodeId } from '../../config/manager.js';
|
|
8
|
-
export function teamCommand() {
|
|
9
|
-
const cmd = new Command('team')
|
|
10
|
-
.description('팀 메모리 관리');
|
|
11
|
-
cmd
|
|
12
|
-
.command('join <team-path>')
|
|
13
|
-
.description('팀에 가입합니다')
|
|
14
|
-
.action(async (teamPath) => {
|
|
15
|
-
const configManager = new ConfigManager();
|
|
16
|
-
const config = configManager.load();
|
|
17
|
-
const nodeId = generateNodeId();
|
|
18
|
-
config.mode = 'team';
|
|
19
|
-
config.team = {
|
|
20
|
-
teamId: teamPath.split('/')[0] ?? teamPath,
|
|
21
|
-
teamPath,
|
|
22
|
-
nodeId,
|
|
23
|
-
};
|
|
24
|
-
configManager.save(config);
|
|
25
|
-
console.log(chalk.green(`✓ Joined team: ${teamPath}`));
|
|
26
|
-
console.log(chalk.dim(` Node ID: ${nodeId}`));
|
|
27
|
-
});
|
|
28
|
-
cmd
|
|
29
|
-
.command('leave')
|
|
30
|
-
.description('팀에서 탈퇴합니다')
|
|
31
|
-
.action(async () => {
|
|
32
|
-
const configManager = new ConfigManager();
|
|
33
|
-
const config = configManager.load();
|
|
34
|
-
if (config.mode !== 'team') {
|
|
35
|
-
console.log(chalk.yellow('Not in a team'));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
config.mode = 'local';
|
|
39
|
-
delete config.team;
|
|
40
|
-
configManager.save(config);
|
|
41
|
-
console.log(chalk.green('✓ Left team. Mode set to local.'));
|
|
42
|
-
});
|
|
43
|
-
cmd
|
|
44
|
-
.command('status')
|
|
45
|
-
.description('팀 동기화 상태를 확인합니다')
|
|
46
|
-
.action(async () => {
|
|
47
|
-
const configManager = new ConfigManager();
|
|
48
|
-
const config = configManager.load();
|
|
49
|
-
if (config.mode !== 'team' || !config.team) {
|
|
50
|
-
console.log(chalk.yellow('Not in a team. Use "a2a-memory team join <team-path>" first.'));
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
console.log(chalk.bold('Team Status'));
|
|
54
|
-
console.log(` Team: ${config.team.teamPath}`);
|
|
55
|
-
console.log(` Node ID: ${config.team.nodeId}`);
|
|
56
|
-
console.log(` Mode: ${config.mode}`);
|
|
57
|
-
try {
|
|
58
|
-
const { MemoryDatabase } = await import('../../db/database.js');
|
|
59
|
-
const db = new MemoryDatabase(config.db.path);
|
|
60
|
-
db.initialize();
|
|
61
|
-
const stats = db.getStats();
|
|
62
|
-
const pending = db.getPendingSyncMemories().length;
|
|
63
|
-
console.log(` Local memories: ${stats.totalMemories}`);
|
|
64
|
-
console.log(` Pending sync: ${pending}`);
|
|
65
|
-
db.close();
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
// DB 접근 실패 무시
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
cmd
|
|
72
|
-
.command('list')
|
|
73
|
-
.description('팀 메모리 목록을 조회합니다')
|
|
74
|
-
.option('-l, --limit <number>', '최대 표시 수', '20')
|
|
75
|
-
.action(async (options) => {
|
|
76
|
-
const configManager = new ConfigManager();
|
|
77
|
-
const config = configManager.load();
|
|
78
|
-
if (config.mode !== 'team' || !config.team || !config.server.apiKey) {
|
|
79
|
-
console.log(chalk.yellow('Not in a team or API key not set.'));
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
try {
|
|
83
|
-
const { A2AClient } = await import('../../sync/client.js');
|
|
84
|
-
const client = new A2AClient({
|
|
85
|
-
baseUrl: config.server.url,
|
|
86
|
-
apiKey: config.server.apiKey,
|
|
87
|
-
});
|
|
88
|
-
const memories = await client.listTeamMemories(config.team.teamPath, {
|
|
89
|
-
limit: parseInt(options.limit, 10),
|
|
90
|
-
});
|
|
91
|
-
if (memories.length === 0) {
|
|
92
|
-
console.log(chalk.dim('No team memories found.'));
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
console.log(chalk.bold(`Team Memories (${memories.length}):`));
|
|
96
|
-
for (const mem of memories) {
|
|
97
|
-
const preview = mem.content.split('\n')[0].slice(0, 80);
|
|
98
|
-
console.log(` [${mem.category}] ${preview}`);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
console.error(chalk.red(`Error: ${error instanceof Error ? error.message : String(error)}`));
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
cmd
|
|
106
|
-
.command('sync')
|
|
107
|
-
.description('팀과 수동으로 동기화합니다')
|
|
108
|
-
.action(async () => {
|
|
109
|
-
const configManager = new ConfigManager();
|
|
110
|
-
const config = configManager.load();
|
|
111
|
-
if (config.mode !== 'team' || !config.team || !config.server.apiKey) {
|
|
112
|
-
console.log(chalk.yellow('Not in a team or API key not set.'));
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
try {
|
|
116
|
-
const { MemoryDatabase } = await import('../../db/database.js');
|
|
117
|
-
const { A2AClient } = await import('../../sync/client.js');
|
|
118
|
-
const { TeamSynchronizer } = await import('../../sync/team-synchronizer.js');
|
|
119
|
-
const db = new MemoryDatabase(config.db.path);
|
|
120
|
-
db.initialize();
|
|
121
|
-
const client = new A2AClient({
|
|
122
|
-
baseUrl: config.server.url,
|
|
123
|
-
apiKey: config.server.apiKey,
|
|
124
|
-
});
|
|
125
|
-
const syncer = new TeamSynchronizer(db, client, config.team.teamPath, config.team.nodeId);
|
|
126
|
-
const result = await syncer.syncDelta();
|
|
127
|
-
console.log(chalk.green('✓ Sync complete'));
|
|
128
|
-
console.log(` Pushed: ${result.pushed}`);
|
|
129
|
-
console.log(` Pulled: ${result.pulled}`);
|
|
130
|
-
if (result.errors.length > 0) {
|
|
131
|
-
console.log(chalk.yellow(` Errors: ${result.errors.join(', ')}`));
|
|
132
|
-
}
|
|
133
|
-
console.log(chalk.dim(` Duration: ${result.duration}ms`));
|
|
134
|
-
db.close();
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
console.error(chalk.red(`Sync failed: ${error instanceof Error ? error.message : String(error)}`));
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
return cmd;
|
|
141
|
-
}
|
|
142
|
-
//# sourceMappingURL=team.js.map
|
|
1
|
+
function _0x1023(_0x18365a,_0x5b1b25){_0x18365a=_0x18365a-0xd3;const _0x32d682=_0x32d6();let _0x102370=_0x32d682[_0x18365a];if(_0x1023['QXIWbP']===undefined){var _0x4d46c1=function(_0x1c3e60){const _0x45113d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5af0d2='',_0x5f1d5f='';for(let _0x36b425=0x0,_0x5d1eee,_0x572d22,_0x492891=0x0;_0x572d22=_0x1c3e60['charAt'](_0x492891++);~_0x572d22&&(_0x5d1eee=_0x36b425%0x4?_0x5d1eee*0x40+_0x572d22:_0x572d22,_0x36b425++%0x4)?_0x5af0d2+=String['fromCharCode'](0xff&_0x5d1eee>>(-0x2*_0x36b425&0x6)):0x0){_0x572d22=_0x45113d['indexOf'](_0x572d22);}for(let _0x733917=0x0,_0x171e1e=_0x5af0d2['length'];_0x733917<_0x171e1e;_0x733917++){_0x5f1d5f+='%'+('00'+_0x5af0d2['charCodeAt'](_0x733917)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5f1d5f);};_0x1023['KUqcJl']=_0x4d46c1,_0x1023['FBUXXJ']={},_0x1023['QXIWbP']=!![];}const _0x4289e0=_0x32d682[0x0],_0x256ccc=_0x18365a+_0x4289e0,_0x3d7690=_0x1023['FBUXXJ'][_0x256ccc];return!_0x3d7690?(_0x102370=_0x1023['KUqcJl'](_0x102370),_0x1023['FBUXXJ'][_0x256ccc]=_0x102370):_0x102370=_0x3d7690,_0x102370;}(function(_0x24d236,_0x5dfb13){function _0x42c5a6(_0x497455,_0x57692e){return _0x1023(_0x57692e- -0x313,_0x497455);}const _0x303a67=_0x24d236();function _0x5a4fa1(_0x130855,_0xa1d73c){return _0x1023(_0x130855-0x3d3,_0xa1d73c);}while(!![]){try{const _0x5c6d83=parseInt(_0x42c5a6(-0x22b,-0x215))/0x1*(-parseInt(_0x42c5a6(-0x1c8,-0x1f8))/0x2)+-parseInt(_0x5a4fa1(0x4ae,0x47e))/0x3+parseInt(_0x5a4fa1(0x4bf,0x4e2))/0x4+-parseInt(_0x5a4fa1(0x4de,0x51c))/0x5*(-parseInt(_0x42c5a6(-0x1e0,-0x1e8))/0x6)+-parseInt(_0x5a4fa1(0x504,0x531))/0x7+parseInt(_0x42c5a6(-0x257,-0x23e))/0x8*(parseInt(_0x42c5a6(-0x1c5,-0x1f9))/0x9)+parseInt(_0x5a4fa1(0x4ab,0x481))/0xa*(parseInt(_0x5a4fa1(0x519,0x508))/0xb);if(_0x5c6d83===_0x5dfb13)break;else _0x303a67['push'](_0x303a67['shift']());}catch(_0x5b14f9){_0x303a67['push'](_0x303a67['shift']());}}}(_0x32d6,0xab72f));import{Command}from'commander';import _0x50dd44 from'chalk';import{ConfigManager,generateNodeId}from'../../config/manager.js';export function teamCommand(){const _0x33e297={'YRkzG':function(_0x50110e){return _0x50110e();},'sWTmZ':function(_0x423395,_0x1ac5f2){return _0x423395!==_0x1ac5f2;},'hkOML':_0x2ddfa1(0x254,0x231)+_0x2ddfa1(0x205,0x212),'VBlfg':_0x3aa5c3(0x349,0x311),'WzOsj':_0x3aa5c3(0x342,0x312),'FlNMd':_0x3aa5c3(0x2cd,0x2f8),'mZkXQ':'../../sync'+_0x3aa5c3(0x2f3,0x2ca),'fJCyp':function(_0x1f5fd8,_0x4ac99e,_0x17c42d){return _0x1f5fd8(_0x4ac99e,_0x17c42d);},'HJOcd':_0x3aa5c3(0x2aa,0x2a6),'ktYpI':function(_0x3d35a7,_0x559797){return _0x3d35a7(_0x559797);},'IpfJm':_0x3aa5c3(0x2b8,0x2bf)+_0x2ddfa1(0x1d6,0x1fc)+'hronizer.j'+'s','kOHbl':_0x2ddfa1(0x1ba,0x1f2),'Nevfr':function(_0x527277,_0x219174){return _0x527277 instanceof _0x219174;},'qdWDp':function(_0x43f56f,_0x5b59ee){return _0x43f56f(_0x5b59ee);},'IIlRM':_0x3aa5c3(0x2a4,0x2bc),'QJJSp':_0x3aa5c3(0x305,0x2e7)+_0x3aa5c3(0x337,0x30b),'kHEbw':_0x2ddfa1(0x1ea,0x1c1)+_0x2ddfa1(0x22f,0x239),'RxoED':_0x2ddfa1(0x1e9,0x1d8),'BqgKh':_0x3aa5c3(0x299,0x2b7)},_0x411edd=new Command(_0x33e297[_0x3aa5c3(0x329,0x30e)])[_0x2ddfa1(0x190,0x1c4)+'n'](_0x33e297[_0x3aa5c3(0x2a4,0x2e2)]);_0x411edd[_0x2ddfa1(0x222,0x1f5)](_0x33e297[_0x2ddfa1(0x215,0x205)])[_0x3aa5c3(0x295,0x29a)+'n']('팀에\x20가입합니다')['action'](async _0x4ef328=>{const _0x4db92f=new ConfigManager(),_0x41499a=_0x4db92f[_0xd5de82(0x61,0x65)]();function _0xd5de82(_0x30a932,_0x4c5670){return _0x2ddfa1(_0x4c5670,_0x30a932- -0x1be);}const _0xce1756=_0x33e297[_0x388d68(-0x3b,-0x2d)](generateNodeId);_0x41499a[_0xd5de82(0x6a,0x8c)]=_0xd5de82(0x64,0x71),_0x41499a[_0x388d68(0x24,0x18)]={'teamId':_0x4ef328[_0x388d68(0x1f,0x28)]('/')[0x0]??_0x4ef328,'teamPath':_0x4ef328,'nodeId':_0xce1756},_0x4db92f['save'](_0x41499a),console['log'](_0x50dd44[_0x388d68(0x19,-0x8)](_0x388d68(-0x57,-0x2b)+_0xd5de82(0x41,0x3b)+_0x4ef328));function _0x388d68(_0x3295f1,_0x23abbe){return _0x2ddfa1(_0x3295f1,_0x23abbe- -0x20a);}console[_0xd5de82(0x9,0x36)](_0x50dd44['dim'](_0xd5de82(0x2e,0x11)+'\x20'+_0xce1756));});function _0x2ddfa1(_0x12392c,_0x2328fb){return _0x1023(_0x2328fb-0xed,_0x12392c);}_0x411edd[_0x3aa5c3(0x2f3,0x2cb)](_0x2ddfa1(0x1f0,0x1c0))['descriptio'+'n'](_0x2ddfa1(0x1f0,0x1fb))[_0x3aa5c3(0x2e8,0x2c7)](async()=>{const _0xfc0a13=new ConfigManager(),_0x34f5b8=_0xfc0a13[_0x59e1bd(0x24e,0x242)]();if(_0x33e297['sWTmZ'](_0x34f5b8[_0x59e1bd(0x257,0x25b)],_0x1048af(0xe5,0xd7))){console[_0x1048af(0x5a,0x7c)](_0x50dd44['yellow'](_0x33e297[_0x59e1bd(0x1fe,0x1eb)]));return;}function _0x1048af(_0x57f52a,_0x53ae4a){return _0x3aa5c3(_0x57f52a,_0x53ae4a- -0x221);}_0x34f5b8[_0x1048af(0x117,0xdd)]=_0x1048af(0x7b,0x9f),delete _0x34f5b8['team'];function _0x59e1bd(_0x2539d8,_0x5a0b95){return _0x3aa5c3(_0x5a0b95,_0x2539d8- -0xa7);}_0xfc0a13['save'](_0x34f5b8),console[_0x59e1bd(0x1f6,0x207)](_0x50dd44['green']('✓\x20Left\x20tea'+_0x1048af(0xbc,0x88)+_0x1048af(0xb8,0xda)+'.'));}),_0x411edd[_0x3aa5c3(0x2b4,0x2cb)](_0x3aa5c3(0x30a,0x2ea))[_0x3aa5c3(0x28b,0x29a)+'n'](_0x33e297[_0x3aa5c3(0x2e4,0x2f6)])[_0x2ddfa1(0x217,0x1f1)](async()=>{const _0x1c3542=new ConfigManager(),_0x4aeb68=_0x1c3542[_0x1ad85c(0x2c7,0x2cd)]();if(_0x33e297[_0x5422f1(-0x137,-0x13a)](_0x4aeb68[_0x1ad85c(0x2e7,0x2d6)],_0x1ad85c(0x2c7,0x2d0))||!_0x4aeb68['team']){console['log'](_0x50dd44[_0x5422f1(-0x11d,-0x11f)](_0x5422f1(-0xcc,-0xca)+_0x5422f1(-0x110,-0xf3)+_0x5422f1(-0x131,-0x100)+_0x5422f1(-0x11b,-0xf7)+'\x20<team-pat'+_0x1ad85c(0x281,0x27c)));return;}function _0x5422f1(_0x1db8c4,_0x10c333){return _0x3aa5c3(_0x10c333,_0x1db8c4- -0x3d3);}function _0x1ad85c(_0x3545bc,_0x87e490){return _0x3aa5c3(_0x3545bc,_0x87e490- -0x28);}console[_0x5422f1(-0x136,-0xff)](_0x50dd44[_0x1ad85c(0x269,0x29d)](_0x5422f1(-0xf9,-0x136)+'s')),console[_0x1ad85c(0x265,0x275)]('\x20\x20Team:\x20'+_0x4aeb68[_0x5422f1(-0xdb,-0xe0)][_0x5422f1(-0xed,-0xbd)]),console[_0x5422f1(-0x136,-0x158)](_0x5422f1(-0x111,-0x141)+'\x20'+_0x4aeb68[_0x1ad85c(0x2bf,0x2d0)]['nodeId']),console[_0x5422f1(-0x136,-0xfe)]('\x20\x20Mode:\x20'+_0x4aeb68[_0x5422f1(-0xd5,-0xdf)]);try{if(_0x33e297[_0x1ad85c(0x256,0x274)](_0x33e297[_0x1ad85c(0x285,0x28a)],_0x33e297['WzOsj'])){const {MemoryDatabase:_0x196323}=await import(_0x1ad85c(0x2e6,0x2d9)+'atabase.js'),_0x3759f=new _0x196323(_0x4aeb68['db'][_0x5422f1(-0x100,-0x133)]);_0x3759f['initialize']();const _0x24163c=_0x3759f['getStats'](),_0x32a1e9=_0x3759f[_0x5422f1(-0xc6,-0xf4)+'SyncMemori'+'es']()[_0x1ad85c(0x2b5,0x2da)];console['log'](_0x1ad85c(0x315,0x2e4)+_0x1ad85c(0x2d8,0x2ac)+_0x24163c[_0x1ad85c(0x264,0x288)+_0x5422f1(-0xd6,-0x108)]),console['log'](_0x1ad85c(0x2c8,0x2c4)+_0x5422f1(-0xd0,-0xda)+_0x32a1e9),_0x3759f[_0x5422f1(-0xcf,-0xc3)]();}else{const _0x341364=_0x28bbfc[_0x1ad85c(0x277,0x27f)][_0x1ad85c(0x303,0x2e0)]('\x0a')[0x0][_0x5422f1(-0x133,-0x171)](0x0,0x50);_0x1dc495[_0x1ad85c(0x242,0x275)]('\x20\x20['+_0x307705['category']+']\x20'+_0x341364);}}catch{}});function _0x3aa5c3(_0x51ca91,_0x81ad40){return _0x1023(_0x81ad40-0x1c3,_0x51ca91);}return _0x411edd[_0x2ddfa1(0x1e8,0x1f5)](_0x33e297[_0x2ddfa1(0x208,0x21a)])[_0x2ddfa1(0x1e4,0x1c4)+'n'](_0x2ddfa1(0x1ee,0x1f9)+_0x3aa5c3(0x2d0,0x2d9))[_0x2ddfa1(0x1f0,0x226)](_0x2ddfa1(0x1c2,0x1ee)+_0x3aa5c3(0x304,0x2d0),_0x33e297['BqgKh'],'20')[_0x3aa5c3(0x292,0x2c7)](async _0x5ef18=>{function _0x4dc7ac(_0x315d84,_0x594612){return _0x2ddfa1(_0x594612,_0x315d84- -0x87);}function _0x42b598(_0x541e48,_0x37161f){return _0x2ddfa1(_0x541e48,_0x37161f-0x123);}const _0xadec1e=new ConfigManager(),_0x31fd94=_0xadec1e[_0x42b598(0x364,0x342)]();if(_0x33e297[_0x4dc7ac(0x13f,0x16b)](_0x31fd94['mode'],_0x33e297[_0x42b598(0x335,0x35b)])||!_0x31fd94[_0x42b598(0x311,0x345)]||!_0x31fd94[_0x42b598(0x360,0x33f)]['apiKey']){console[_0x4dc7ac(0x140,0x114)](_0x50dd44['yellow'](_0x42b598(0x33c,0x354)+_0x4dc7ac(0x16f,0x158)+'\x20key\x20not\x20s'+_0x4dc7ac(0x15c,0x176)));return;}try{const {A2AClient:_0x754b7f}=await import(_0x33e297[_0x42b598(0x2eb,0x301)]),_0x3bb80d=new _0x754b7f({'baseUrl':_0x31fd94[_0x42b598(0x373,0x33f)][_0x42b598(0x316,0x33a)],'apiKey':_0x31fd94['server'][_0x42b598(0x319,0x2fe)]}),_0x3d2e42=await _0x3bb80d[_0x42b598(0x330,0x313)+_0x4dc7ac(0x186,0x1b3)](_0x31fd94['team'][_0x4dc7ac(0x189,0x161)],{'limit':_0x33e297[_0x4dc7ac(0x13c,0x14c)](parseInt,_0x5ef18[_0x4dc7ac(0x187,0x17b)],0xa)});if(_0x3d2e42[_0x4dc7ac(0x1a5,0x1b3)]===0x0){if(_0x33e297['sWTmZ'](_0x33e297[_0x4dc7ac(0x161,0x133)],_0x33e297['HJOcd']))_0x4837e7[_0x4dc7ac(0x140,0x144)](_0x434cd7[_0x42b598(0x2d6,0x303)](_0x4dc7ac(0x14e,0x14c)+_0x3c5bb7[_0x42b598(0x36e,0x336)]['join'](',\x20')));else{console[_0x42b598(0x306,0x2ea)](_0x50dd44[_0x42b598(0x336,0x30a)]('No\x20team\x20me'+_0x42b598(0x301,0x33c)+_0x4dc7ac(0x1a3,0x172)));return;}}console[_0x42b598(0x2fb,0x2ea)](_0x50dd44['bold'](_0x4dc7ac(0x16c,0x152)+_0x42b598(0x324,0x2f5)+_0x3d2e42[_0x4dc7ac(0x1a5,0x185)]+'):'));for(const _0x56d4e2 of _0x3d2e42){const _0x240e8e=_0x56d4e2[_0x4dc7ac(0x14a,0x182)][_0x4dc7ac(0x1ab,0x1b7)]('\x0a')[0x0][_0x42b598(0x2e5,0x2ed)](0x0,0x50);console[_0x4dc7ac(0x140,0x127)](_0x4dc7ac(0x1a8,0x17d)+_0x56d4e2[_0x42b598(0x2c5,0x2ec)]+']\x20'+_0x240e8e);}}catch(_0x555d1c){console['error'](_0x50dd44[_0x4dc7ac(0x18e,0x186)](_0x4dc7ac(0x14f,0x135)+(_0x555d1c instanceof Error?_0x555d1c[_0x42b598(0x306,0x2fa)]:_0x33e297[_0x4dc7ac(0x1ad,0x191)](String,_0x555d1c))));}}),_0x411edd['command'](_0x2ddfa1(0x23b,0x224))[_0x3aa5c3(0x26b,0x29a)+'n'](_0x2ddfa1(0x21d,0x201)+_0x3aa5c3(0x2ff,0x2f7))[_0x3aa5c3(0x2eb,0x2c7)](async()=>{function _0x584cd9(_0x38d347,_0x591f2c){return _0x3aa5c3(_0x38d347,_0x591f2c- -0x152);}function _0xe91c24(_0x2f73e6,_0x5fa5e3){return _0x3aa5c3(_0x2f73e6,_0x5fa5e3- -0x578);}const _0x1449d1={'CsRIz':_0xe91c24(-0x2ab,-0x271)+_0x584cd9(0x13f,0x171)+'a2a-memory'+_0xe91c24(-0x294,-0x2c0)+_0x584cd9(0x171,0x18e)+_0xe91c24(-0x2d3,-0x2d4)},_0x26da6c=new ConfigManager(),_0x2d2b98=_0x26da6c[_0x584cd9(0x194,0x1a3)]();if(_0x2d2b98['mode']!==_0x33e297['FlNMd']||!_0x2d2b98['team']||!_0x2d2b98[_0xe91c24(-0x247,-0x286)][_0x584cd9(0x196,0x15f)]){console[_0xe91c24(-0x2b5,-0x2db)](_0x50dd44[_0x584cd9(0x12c,0x164)](_0x584cd9(0x1ac,0x1b5)+_0xe91c24(-0x295,-0x2ac)+_0xe91c24(-0x2f5,-0x2bd)+_0xe91c24(-0x292,-0x2bf)));return;}try{const {MemoryDatabase:_0x134cda}=await import('../../db/d'+_0x584cd9(0x15e,0x184)),{A2AClient:_0x393631}=await import(_0x33e297[_0x584cd9(0x169,0x162)]),{TeamSynchronizer:_0x327666}=await import(_0x33e297[_0xe91c24(-0x2b2,-0x299)]),_0x12329f=new _0x134cda(_0x2d2b98['db'][_0x584cd9(0x14e,0x181)]);_0x12329f[_0xe91c24(-0x26b,-0x279)]();const _0xd86b8a=new _0x393631({'baseUrl':_0x2d2b98[_0x584cd9(0x1bf,0x1a0)][_0x584cd9(0x1a8,0x19b)],'apiKey':_0x2d2b98[_0xe91c24(-0x285,-0x286)][_0x584cd9(0x13d,0x15f)]}),_0x284f69=new _0x327666(_0x12329f,_0xd86b8a,_0x2d2b98[_0x584cd9(0x1a2,0x1a6)]['teamPath'],_0x2d2b98[_0xe91c24(-0x279,-0x280)][_0xe91c24(-0x261,-0x27f)]),_0x34a25a=await _0x284f69[_0xe91c24(-0x283,-0x2ab)]();console[_0xe91c24(-0x2e9,-0x2db)](_0x50dd44[_0x584cd9(0x152,0x186)]('✓\x20Sync\x20com'+_0x584cd9(0x1c9,0x19f))),console[_0xe91c24(-0x2d7,-0x2db)](_0x584cd9(0x1c1,0x193)+_0x34a25a[_0x584cd9(0x17c,0x168)]),console[_0xe91c24(-0x2a8,-0x2db)](_0x584cd9(0x1b7,0x1a1)+_0x34a25a['pulled']);if(_0x34a25a[_0x584cd9(0x19b,0x197)][_0x584cd9(0x187,0x1b0)]>0x0){if('wUBqs'===_0x33e297[_0x584cd9(0x1d9,0x1be)])console['log'](_0x50dd44[_0x584cd9(0x172,0x164)](_0x584cd9(0x12f,0x159)+_0x34a25a[_0x584cd9(0x194,0x197)]['join'](',\x20')));else{_0x17cdc9[_0xe91c24(-0x2aa,-0x2db)](_0x93477b[_0x584cd9(0x137,0x164)](Shqjxs[_0xe91c24(-0x2c2,-0x297)]));return;}}console[_0xe91c24(-0x317,-0x2db)](_0x50dd44[_0xe91c24(-0x2e9,-0x2bb)](_0x584cd9(0x186,0x1b4)+':\x20'+_0x34a25a[_0x584cd9(0x130,0x14f)]+'ms')),_0x12329f['close']();}catch(_0x10e92e){console['error'](_0x50dd44[_0xe91c24(-0x26c,-0x28d)](_0x584cd9(0x190,0x158)+_0xe91c24(-0x294,-0x29c)+(_0x33e297['Nevfr'](_0x10e92e,Error)?_0x10e92e['message']:_0x33e297[_0xe91c24(-0x2ec,-0x2d5)](String,_0x10e92e))));}}),_0x411edd;}function _0x32d6(){const _0x2c2d74=['7zMv7j247zwP64Ui64UK','A09iyMW','rwXpyvC','u3bnq3O','BgvHDMu','7yYaioUpMEQ4So2zLcdSG4hTG5ZRPBWG','oe1sr29msW','zKPdExa','zgvZy3jPChrPBW','mZuWt0ndDuXg','C1DuBvO','Bg9N','mtGZnZGWmfHNDxrVtG','y2f0zwDVCNK','C2XPy2u','zhvYyxrPB24','ytjHlw1LBw9YEq','Cwrxrha','Ad4IigzPCNn0lG','AgTptuW','zuPXq3q','y29UDgvUDa','AwvZicG','Bs4Gtw9KzsbZzq','u3LUyYbMywLSzq','icbfCNjVCNm6ia','rxjYB3i6ia','BwvZC2fNzq','BgLZDa','mJi1mZjfEMrjENa','Dg90ywXnzw1VCG','yxbPs2v5','vKjSzMC','wvjREKC','BvPRwfe','4PYtiePVAw5Lzcb0','EwvSBg93','7lwC64Yaio2rNoYlNcdSIjG','ihrLyw0GAM9PBG','zxqU','ChvZAgvK','igTLEsbUB3qGCW','7yYaioUPLoUQQoUMRcdQTidRPQW','zgLT','sePpy2q','lI4VlI4VC3LUyW','Bg9JywW','nvrjrLPYva','icboB2rLieLeoG','zwfTlIbvC2uGiG','lwWSic0TBgLTAq','yM9Sza','BgLZDfrLyw1nzq','ywn0Aw9U','D1vcCxm','vgvHBsbnzw1VCG','l2nSAwvUDc5QCW','y29TBwfUza','zwfTig9Yiefqsq','C3LUy0rLBhrH','mtG4nxjVs2zLtW','7yYaioUPLoUQQoUMRcdRQQNROz3SNyqG','Dca8BNvTyMvYpG','7yYa7jEq7isCio2dIo2hTo2vQEUlIoUlPa','l3rLyw0TC3LUyW','Cgf0Aa','Bw9YAwvZoIa','zwfToIa','yxrHyMfZzs5QCW','7yYa6Ro8ioYiMoUpMEYCVoUHNcdRJ5NQUla','z3jLzw4','7kgW7zQm7zwP64Ui64UK','vgvHBsbtDgf0Dq','uuPku3a','zdOG','nJaXodK2nLfgCePkua','ndaYndq2uNrhDen6','sxbMsM0','idX0zwfTlxbHDa','q3nssxO','suLSuK0','Bw9YAwvZ','BgLTAxq','icbqDxnOzwq6ia','DgvHBvbHDgG','AM9PBIa8DgvHBq','zwfT','zxjYB3jZ','C3rHDhvZ','CMvK','icbqzw5KAw5Nia','DxjS','nJy3mKDAAw1ItW','Bw9YAwvZigzVDq','uNHVruq','CgXLDgu','C2vYDMvY','icbqDwXSzwq6ia','nJG0ndm2mNfuy0DLvW','Bg9Hza','A0HfyNC','7zMu7zwP64Ui64UK','DgvHBq','BM9KzuLK','C3LUyW','Dcb0BYbSB2nHBa','B3b0Aw9U','AwvZ','Bw9Kzq','Aw5PDgLHBgL6zq','BMqU','lI4VlI4VzgiVza','BgvUz3rO','C3LUyZOG','y2XVC2u','icbB','icbeDxjHDgLVBG','tM90igLUigeGDa','C3bSAxq','nJKZmdmZswPjru13','A3rzCeK','lxbHDgG+','icbmB2nHBcbTzq','z2v0ugvUzgLUzW','rMXotwq'];_0x32d6=function(){return _0x2c2d74;};return _0x32d6();}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,88 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
* A2A Memory CLI
|
|
4
|
-
*
|
|
5
|
-
* 명령어:
|
|
6
|
-
* a2a-memory setup - 초기 설정 마법사
|
|
7
|
-
* a2a-memory status - 현재 상태 확인
|
|
8
|
-
* a2a-memory search - 메모리 검색
|
|
9
|
-
* a2a-memory list - 메모리 목록
|
|
10
|
-
* a2a-memory extract - 세션에서 메모리 추출
|
|
11
|
-
* a2a-memory config - 설정 관리
|
|
12
|
-
* a2a-memory add - 메모리 추가
|
|
13
|
-
* a2a-memory edit - 메모리 수정
|
|
14
|
-
* a2a-memory rm - 메모리 삭제
|
|
15
|
-
* a2a-memory cleanup - 메모리 정리
|
|
16
|
-
* a2a-memory embed - 임베딩 관리
|
|
17
|
-
*/
|
|
18
|
-
import { createRequire } from 'module';
|
|
19
|
-
import { Command } from 'commander';
|
|
20
|
-
import { setupCommand } from './commands/setup.js';
|
|
21
|
-
import { statusCommand } from './commands/status.js';
|
|
22
|
-
import { searchCommand } from './commands/search.js';
|
|
23
|
-
import { listCommand } from './commands/list.js';
|
|
24
|
-
import { extractCommand } from './commands/extract.js';
|
|
25
|
-
import { configCommand } from './commands/config.js';
|
|
26
|
-
import { syncCommand } from './commands/sync.js';
|
|
27
|
-
import { teamCommand } from './commands/team.js';
|
|
28
|
-
import { addCommand } from './commands/add.js';
|
|
29
|
-
import { editCommand } from './commands/edit.js';
|
|
30
|
-
import { rmCommand } from './commands/rm.js';
|
|
31
|
-
import { cleanupCommand } from './commands/cleanup.js';
|
|
32
|
-
import { embedCommand } from './commands/embed.js';
|
|
33
|
-
import { healthCommand } from './commands/health.js';
|
|
34
|
-
import { claudeSyncCommand } from './commands/claude-sync.js';
|
|
35
|
-
import { skillCommand } from './commands/skill.js';
|
|
36
|
-
import { proficiencyCommand } from './commands/proficiency.js';
|
|
37
|
-
import { migrateChunksCommand } from './commands/migrate-chunks.js';
|
|
38
|
-
import { migrateFileRefsCommand } from './commands/migrate-file-refs.js';
|
|
39
|
-
import { setLocale, detectLocale } from '../i18n/index.js';
|
|
40
|
-
import { ConfigManager } from '../config/manager.js';
|
|
41
|
-
const require = createRequire(import.meta.url);
|
|
42
|
-
const pkg = require('../../package.json');
|
|
43
|
-
// Initialize locale from config or environment
|
|
44
|
-
try {
|
|
45
|
-
const config = new ConfigManager().load();
|
|
46
|
-
if (config.locale) {
|
|
47
|
-
setLocale(config.locale);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
setLocale(detectLocale());
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
setLocale(detectLocale());
|
|
55
|
-
}
|
|
56
|
-
const program = new Command();
|
|
57
|
-
program
|
|
58
|
-
.name('a2a-memory')
|
|
59
|
-
.description('A2A Memory Plugin for Claude Code')
|
|
60
|
-
.version(pkg.version)
|
|
61
|
-
.option('--lang <locale>', 'Language (en, ko)')
|
|
62
|
-
.hook('preAction', (thisCommand) => {
|
|
63
|
-
const lang = thisCommand.opts().lang;
|
|
64
|
-
if (lang === 'en' || lang === 'ko') {
|
|
65
|
-
setLocale(lang);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
program.addCommand(setupCommand());
|
|
69
|
-
program.addCommand(statusCommand());
|
|
70
|
-
program.addCommand(searchCommand());
|
|
71
|
-
program.addCommand(listCommand());
|
|
72
|
-
program.addCommand(extractCommand());
|
|
73
|
-
program.addCommand(configCommand());
|
|
74
|
-
program.addCommand(syncCommand());
|
|
75
|
-
program.addCommand(teamCommand());
|
|
76
|
-
program.addCommand(addCommand());
|
|
77
|
-
program.addCommand(editCommand());
|
|
78
|
-
program.addCommand(rmCommand());
|
|
79
|
-
program.addCommand(cleanupCommand());
|
|
80
|
-
program.addCommand(embedCommand());
|
|
81
|
-
program.addCommand(healthCommand());
|
|
82
|
-
program.addCommand(claudeSyncCommand());
|
|
83
|
-
program.addCommand(skillCommand());
|
|
84
|
-
program.addCommand(proficiencyCommand());
|
|
85
|
-
program.addCommand(migrateChunksCommand());
|
|
86
|
-
program.addCommand(migrateFileRefsCommand());
|
|
87
|
-
program.parse();
|
|
88
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
(function(_0x32d3e5,_0x5263cf){const _0x53e35e=_0x32d3e5();function _0x1135c7(_0x4a8866,_0x8573a){return _0x46e8(_0x4a8866-0x338,_0x8573a);}function _0x225702(_0x4a0fc5,_0x20e39b){return _0x46e8(_0x4a0fc5- -0x31c,_0x20e39b);}while(!![]){try{const _0x42f26e=parseInt(_0x225702(-0x143,-0x137))/0x1+-parseInt(_0x225702(-0x14c,-0x155))/0x2+-parseInt(_0x1135c7(0x506,0x50e))/0x3+-parseInt(_0x225702(-0x14b,-0x146))/0x4*(-parseInt(_0x1135c7(0x523,0x520))/0x5)+-parseInt(_0x1135c7(0x514,0x504))/0x6*(parseInt(_0x225702(-0x147,-0x153))/0x7)+parseInt(_0x1135c7(0x51b,0x51f))/0x8*(-parseInt(_0x225702(-0x148,-0x144))/0x9)+parseInt(_0x1135c7(0x518,0x521))/0xa*(parseInt(_0x225702(-0x13e,-0x145))/0xb);if(_0x42f26e===_0x5263cf)break;else _0x53e35e['push'](_0x53e35e['shift']());}catch(_0xbe0f1c){_0x53e35e['push'](_0x53e35e['shift']());}}}(_0x23d7,0x9488f));import{createRequire}from'module';import{Command}from'commander';import{setupCommand}from'./commands/setup.js';import{statusCommand}from'./commands/status.js';import{searchCommand}from'./commands/search.js';import{listCommand}from'./commands/list.js';import{extractCommand}from'./commands/extract.js';function _0x46e8(_0x4e6c53,_0x51a6d9){_0x4e6c53=_0x4e6c53-0x1ce;const _0x23d737=_0x23d7();let _0x46e893=_0x23d737[_0x4e6c53];if(_0x46e8['iVWEEq']===undefined){var _0x301443=function(_0xc75e79){const _0x560874='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3bf933='',_0x4fb7e8='';for(let _0x1c9c2e=0x0,_0x5f423b,_0x381382,_0x1e325f=0x0;_0x381382=_0xc75e79['charAt'](_0x1e325f++);~_0x381382&&(_0x5f423b=_0x1c9c2e%0x4?_0x5f423b*0x40+_0x381382:_0x381382,_0x1c9c2e++%0x4)?_0x3bf933+=String['fromCharCode'](0xff&_0x5f423b>>(-0x2*_0x1c9c2e&0x6)):0x0){_0x381382=_0x560874['indexOf'](_0x381382);}for(let _0x173607=0x0,_0xfc6297=_0x3bf933['length'];_0x173607<_0xfc6297;_0x173607++){_0x4fb7e8+='%'+('00'+_0x3bf933['charCodeAt'](_0x173607)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4fb7e8);};_0x46e8['TVBwKn']=_0x301443,_0x46e8['zQbhsX']={},_0x46e8['iVWEEq']=!![];}const _0x21a883=_0x23d737[0x0],_0x598465=_0x4e6c53+_0x21a883,_0x1d0c54=_0x46e8['zQbhsX'][_0x598465];return!_0x1d0c54?(_0x46e893=_0x46e8['TVBwKn'](_0x46e893),_0x46e8['zQbhsX'][_0x598465]=_0x46e893):_0x46e893=_0x1d0c54,_0x46e893;}import{configCommand}from'./commands/config.js';import{syncCommand}from'./commands/sync.js';import{teamCommand}from'./commands/team.js';import{addCommand}from'./commands/add.js';import{editCommand}from'./commands/edit.js';import{rmCommand}from'./commands/rm.js';import{cleanupCommand}from'./commands/cleanup.js';import{embedCommand}from'./commands/embed.js';import{healthCommand}from'./commands/health.js';import{claudeSyncCommand}from'./commands/claude-sync.js';import{skillCommand}from'./commands/skill.js';import{proficiencyCommand}from'./commands/proficiency.js';import{migrateChunksCommand}from'./commands/migrate-chunks.js';import{migrateFileRefsCommand}from'./commands/migrate-file-refs.js';import{setLocale,detectLocale}from'../i18n/index.js';import{ConfigManager}from'../config/manager.js';function _0x23d7(){const _0x677fd0=['ndmYmdLOwgjyruS','mZvjueTdtuq','u3PltMS','ChjLqwn0Aw9U','zgvZy3jPChrPBW','mZKYodm3EfHUq0D0','y2fSzt4','Bg9JywXL','mtGXndm0ufLZsxLc','ifbSDwDPBIbMBW','mtu4odK4ndfozxzVuhK','zw4SigTVkq','mtb2r0TvA0C','qtjbie1LBw9YEq','Bg9Hza','mte5mLrpqwL3Eq','ywrKq29TBwfUza','DMvYC2LVBG','B3b0Aw9U','ls1Syw5NidXSBW','BMfTzq','ywDLlMPZB24','CIbdBgf1zguGqW','mJb0vw10uum','tgfUz3vHz2uGka','B3b0CW','nZK5mZi5u2voqw16','ytjHlw1LBw9YEq','mtaYnZK0ogzHq1jNza','nde3otKYufLTAM5O','BgfUzW','B2rL'];_0x23d7=function(){return _0x677fd0;};return _0x23d7();}const require=createRequire(import.meta.url),pkg=require('../../pack'+_0x1069d0(0xba,0xc8));try{const config=new ConfigManager()[_0x1069d0(0xb3,0xbc)]();config[_0x1069d0(0xac,0x9f)]?setLocale(config[_0x26452f(0x174,0x169)]):setLocale(detectLocale());}catch{setLocale(detectLocale());}const program=new Command();program[_0x1069d0(0xb9,0xb0)](_0x1069d0(0xa0,0xa7))[_0x26452f(0x168,0x166)+'n'](_0x1069d0(0xb2,0xbc)+_0x1069d0(0xae,0xa0)+_0x26452f(0x179,0x178)+_0x1069d0(0xa4,0xaf))[_0x1069d0(0xb6,0xac)](pkg[_0x1069d0(0xb6,0xaf)])[_0x26452f(0x16b,0x174)](_0x26452f(0x180,0x175)+_0x26452f(0x166,0x168),_0x1069d0(0xbd,0xb8)+_0x26452f(0x171,0x16d))['hook'](_0x26452f(0x156,0x165),_0x1258c4=>{function _0x2471d7(_0xad84e,_0x5bc42c){return _0x26452f(_0x5bc42c,_0xad84e- -0x284);}function _0xbbe39d(_0x1a81c3,_0x194545){return _0x26452f(_0x194545,_0x1a81c3- -0x28b);}const _0x464ce2={'SzKNk':function(_0x1633a1,_0x4ec5af){return _0x1633a1===_0x4ec5af;}},_0x8802b3=_0x1258c4[_0x2471d7(-0x109,-0x114)]()[_0xbbe39d(-0x12b,-0x135)];(_0x464ce2[_0x2471d7(-0x120,-0x126)](_0x8802b3,'en')||_0x8802b3==='ko')&&setLocale(_0x8802b3);}),program[_0x26452f(0x177,0x172)](setupCommand()),program[_0x1069d0(0xb5,0xbb)](statusCommand()),program['addCommand'](searchCommand()),program['addCommand'](listCommand()),program[_0x26452f(0x17b,0x172)](extractCommand()),program[_0x1069d0(0xb5,0xb7)](configCommand());function _0x26452f(_0x168473,_0x40f2e4){return _0x46e8(_0x40f2e4- -0x72,_0x168473);}program[_0x26452f(0x170,0x172)](syncCommand()),program[_0x26452f(0x17a,0x172)](teamCommand()),program[_0x26452f(0x176,0x172)](addCommand()),program[_0x26452f(0x170,0x172)](editCommand()),program[_0x26452f(0x17a,0x172)](rmCommand()),program['addCommand'](cleanupCommand()),program[_0x26452f(0x179,0x172)](embedCommand()),program['addCommand'](healthCommand());function _0x1069d0(_0x27c7ae,_0x4ab635){return _0x46e8(_0x27c7ae- -0x12f,_0x4ab635);}program[_0x26452f(0x162,0x172)](claudeSyncCommand()),program['addCommand'](skillCommand()),program[_0x26452f(0x16a,0x172)](proficiencyCommand()),program[_0x1069d0(0xb5,0xb4)](migrateChunksCommand()),program[_0x1069d0(0xb5,0xa8)](migrateFileRefsCommand()),program['parse']();
|