a2a-memory 0.11.5 → 0.12.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/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.d.ts +8 -2
- package/dist/claude/sync.js +1 -298
- package/dist/cli/commands/add.js +1 -80
- package/dist/cli/commands/claude-sync.d.ts +3 -3
- package/dist/cli/commands/claude-sync.js +1 -70
- package/dist/cli/commands/cleanup.js +1 -83
- package/dist/cli/commands/config.js +1 -79
- 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 -46
- 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 -90
- 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 +36 -0
- package/dist/db/database.js +1 -1400
- 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.d.ts +0 -3
- package/dist/extraction/extractor.js +1 -648
- package/dist/extraction/file-reference.js +1 -77
- package/dist/extraction/filter.js +1 -86
- 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 -518
- package/dist/hooks/pre-compact.js +1 -209
- package/dist/hooks/session-end.js +1 -633
- package/dist/hooks/session-start.js +1 -549
- package/dist/hooks/shared.js +1 -110
- package/dist/hooks/stop.d.ts +21 -0
- package/dist/hooks/stop.js +1 -0
- 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.d.ts +1 -1
- package/dist/index.js +1 -43
- package/dist/lifecycle/cleanup-scheduler.js +1 -137
- package/dist/lifecycle/cleanup.d.ts +1 -0
- package/dist/lifecycle/cleanup.js +1 -116
- package/dist/lifecycle/consolidation.d.ts +22 -0
- package/dist/lifecycle/consolidation.js +1 -0
- package/dist/lifecycle/index.d.ts +2 -0
- package/dist/lifecycle/index.js +1 -13
- package/dist/lifecycle/injection-flush.d.ts +24 -0
- package/dist/lifecycle/injection-flush.js +1 -0
- package/dist/lifecycle/quality-scorer.d.ts +5 -6
- 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 +7 -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 -214
- 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 +13 -1
- package/dist/types/index.js +1 -132
- package/dist/utils/keychain.js +1 -170
- package/dist/utils/logger.js +1 -128
- package/package.json +15 -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(_0x3a2e81,_0x13686e){const _0x431d51=_0x3a2e81();function _0x449e8d(_0x3f886d,_0x2ecfff){return _0x5ee9(_0x2ecfff-0xf2,_0x3f886d);}function _0x217d93(_0x511449,_0x2bd51e){return _0x5ee9(_0x2bd51e-0x378,_0x511449);}while(!![]){try{const _0x7462f4=parseInt(_0x449e8d(0x24e,0x24f))/0x1+-parseInt(_0x449e8d(0x258,0x220))/0x2*(-parseInt(_0x449e8d(0x1df,0x203))/0x3)+parseInt(_0x449e8d(0x23e,0x211))/0x4+-parseInt(_0x217d93(0x4b6,0x46d))/0x5+parseInt(_0x449e8d(0x24d,0x248))/0x6*(-parseInt(_0x217d93(0x516,0x4e7))/0x7)+-parseInt(_0x449e8d(0x25d,0x20a))/0x8*(-parseInt(_0x217d93(0x4d7,0x487))/0x9)+-parseInt(_0x449e8d(0x1d4,0x1c8))/0xa;if(_0x7462f4===_0x13686e)break;else _0x431d51['push'](_0x431d51['shift']());}catch(_0xd5b9b6){_0x431d51['push'](_0x431d51['shift']());}}}(_0x4e08,0xbfcaf));import{Command}from'commander';import _0x76696 from'chalk';import _0x448171 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';function _0x5ee9(_0x27eb20,_0x5ad582){_0x27eb20=_0x27eb20-0xca;const _0x4e0819=_0x4e08();let _0x5ee991=_0x4e0819[_0x27eb20];if(_0x5ee9['UtOsTL']===undefined){var _0x52c243=function(_0x493cd1){const _0x5abadc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2a8abd='',_0x1974e4='';for(let _0x45db62=0x0,_0x4c0c25,_0x424256,_0x328992=0x0;_0x424256=_0x493cd1['charAt'](_0x328992++);~_0x424256&&(_0x4c0c25=_0x45db62%0x4?_0x4c0c25*0x40+_0x424256:_0x424256,_0x45db62++%0x4)?_0x2a8abd+=String['fromCharCode'](0xff&_0x4c0c25>>(-0x2*_0x45db62&0x6)):0x0){_0x424256=_0x5abadc['indexOf'](_0x424256);}for(let _0x5ca843=0x0,_0x51b36d=_0x2a8abd['length'];_0x5ca843<_0x51b36d;_0x5ca843++){_0x1974e4+='%'+('00'+_0x2a8abd['charCodeAt'](_0x5ca843)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1974e4);};_0x5ee9['BcUeJU']=_0x52c243,_0x5ee9['HAvvKC']={},_0x5ee9['UtOsTL']=!![];}const _0x5b70d7=_0x4e0819[0x0],_0x10ad24=_0x27eb20+_0x5b70d7,_0x272300=_0x5ee9['HAvvKC'][_0x10ad24];return!_0x272300?(_0x5ee991=_0x5ee9['BcUeJU'](_0x5ee991),_0x5ee9['HAvvKC'][_0x10ad24]=_0x5ee991):_0x5ee991=_0x272300,_0x5ee991;}import{createLogger}from'../../utils/logger.js';export function syncCommand(){const _0x25e605={'rLsmR':'서버\x20연결\x20실패','CntDW':function(_0x153f4f,_0x3a5190){return _0x153f4f!==_0x3a5190;},'MrfyE':_0x5f4040(0x8b,0x4e),'KrcZY':_0x5f4040(-0x4b,-0x6)+_0x5f4040(0x30,0x1f)+'니다.\x0a','eoTLe':_0x5f4040(0x38,0x88)+'\x20config\x20se'+_0x4f95c6(-0x150,-0x141)+'piKey\x20YOUR'+_0x4f95c6(-0x16b,-0x177),'kocTq':function(_0x5526fc,_0x48e501){return _0x5526fc(_0x48e501);},'XOgLL':function(_0x3e41d9,_0x4b4f0b){return _0x3e41d9===_0x4b4f0b;},'JYZQm':_0x5f4040(0x5e,0x62),'Ullpo':function(_0x2e4002,_0x171737,_0x1430ba){return _0x2e4002(_0x171737,_0x1430ba);},'LtTGL':function(_0x5f4836,_0x5e969b){return _0x5f4836 instanceof _0x5e969b;},'diLvW':_0x4f95c6(-0x156,-0x133)+_0x4f95c6(-0x17b,-0x161)+_0x4f95c6(-0x146,-0x12e)+_0x5f4040(0x2a,0x45),'uDVBu':'--watch','SqFHO':_0x5f4040(0x82,0x4d)+_0x5f4040(0xad,0x67)},_0x98580a=new Command(_0x5f4040(0x7f,0x7d));function _0x4f95c6(_0x1ec2f3,_0x3ca262){return _0x5ee9(_0x1ec2f3- -0x2ae,_0x3ca262);}function _0x5f4040(_0x1c892b,_0x35585c){return _0x5ee9(_0x35585c- -0xe4,_0x1c892b);}return _0x98580a[_0x5f4040(0x9c,0x77)+'n']('Synchroniz'+_0x4f95c6(-0x17b,-0x13b)+_0x4f95c6(-0x183,-0x180)+_0x4f95c6(-0x1db,-0x20a))[_0x5f4040(0x49,0x3e)]('--push',_0x4f95c6(-0x154,-0x167)+'\x20memories\x20'+'to\x20server\x20'+_0x5f4040(0x74,0x53))[_0x4f95c6(-0x18c,-0x144)]('--pull',_0x25e605[_0x4f95c6(-0x1ba,-0x203)])[_0x4f95c6(-0x18c,-0x164)](_0x5f4040(0x70,0x66),_0x5f4040(0x66,0x7f)+_0x5f4040(0xb7,0x6a)+'\x20status')['option'](_0x25e605[_0x4f95c6(-0x197,-0x1ea)],_0x4f95c6(-0x148,-0x10a)+_0x5f4040(0x7,0x3)+_0x5f4040(0x89,0x41)+'l\x20(default'+_0x4f95c6(-0x155,-0x13f))[_0x4f95c6(-0x18c,-0x142)](_0x25e605[_0x4f95c6(-0x19c,-0x1cd)],_0x4f95c6(-0x16f,-0x19d)+_0x5f4040(0x1a,-0x9)+'liseconds\x20'+_0x5f4040(0x18,0x57)+_0x5f4040(0x38,0x70),parseInt)[_0x5f4040(0x59,0x5e)](async _0x36e4ea=>{function _0x49d346(_0x481707,_0x2798ea){return _0x4f95c6(_0x2798ea-0x612,_0x481707);}function _0x50be85(_0x6911e1,_0xaaf253){return _0x4f95c6(_0x6911e1-0xcb,_0xaaf253);}const _0x189fa8={'JuubA':_0x25e605[_0x49d346(0x4a5,0x4b0)],'Syutk':_0x49d346(0x468,0x490)},_0x413a2e=new ConfigManager()[_0x50be85(-0xdf,-0x96)](),_0x43f62a=new MemoryDatabase(_0x413a2e['db'][_0x49d346(0x459,0x45c)]);try{if(_0x25e605[_0x49d346(0x480,0x49a)](_0x50be85(-0xb1,-0xa6),_0x25e605[_0x49d346(0x44a,0x44e)])){_0x2b73ee['log'](_0x1ed4ed[_0x50be85(-0xfe,-0x124)](_0x49d346(0x454,0x439)+_0x1f278f[_0x49d346(0x48e,0x4c8)][_0x50be85(-0x91,-0x79)]+_0x49d346(0x47a,0x461)));for(const _0x491f09 of _0x46a986['errors'][_0x50be85(-0xe5,-0xb1)](0x0,0x5)){_0x27adba[_0x50be85(-0xc2,-0x9b)]('\x20\x20•\x20'+_0x2692cb[_0x50be85(-0x96,-0xe0)](_0x491f09));}_0x4b1ebc[_0x50be85(-0x7f,-0xbc)]['length']>0x5&&_0x510e05[_0x49d346(0x491,0x485)](_0x46ac95[_0x50be85(-0x96,-0x85)](_0x50be85(-0x118,-0x148)+(_0x192b6b['errors'][_0x49d346(0x4fa,0x4b6)]-0x5)+_0x50be85(-0x9f,-0xa2)));}else{_0x43f62a[_0x49d346(0x46d,0x4b4)]();!_0x413a2e['server'][_0x50be85(-0x75,-0x5e)]&&(console[_0x49d346(0x4a0,0x466)](_0x76696[_0x50be85(-0x117,-0x138)](_0x25e605[_0x49d346(0x454,0x491)])),console['log'](_0x49d346(0x495,0x443)+_0x50be85(-0x81,-0x63)+_0x76696[_0x49d346(0x4bd,0x48b)](_0x25e605['eoTLe'])+'\x0a'),process[_0x49d346(0x3f0,0x42e)](0x1));const _0x45f9e2=new A2AClient({'baseUrl':_0x413a2e[_0x50be85(-0x110,-0xf5)][_0x49d346(0x4e9,0x4d1)],'apiKey':_0x413a2e['server']['apiKey']}),_0x21f544=new MemorySynchronizer(_0x43f62a,_0x45f9e2);if(_0x36e4ea[_0x50be85(-0xa3,-0x97)]){await _0x25e605[_0x49d346(0x502,0x4d4)](showSyncStatus,_0x21f544);return;}if(_0x36e4ea[_0x49d346(0x4ae,0x4b9)]){if(_0x25e605[_0x50be85(-0xe9,-0xca)](_0x25e605[_0x49d346(0x477,0x433)],_0x50be85(-0x103,-0xd4)))_0x3ec555[_0x49d346(0x4d4,0x48e)](_0x3f0076[_0x50be85(-0x117,-0x10d)](_0x189fa8[_0x49d346(0x41e,0x470)])),_0x4f40cc[_0x50be85(-0xc2,-0xb9)](_0x148672[_0x50be85(-0xfe,-0x134)](_0x50be85(-0xdd,-0xca)+'인하세요:\x20'+_0x1076d9[_0x49d346(0x45a,0x48b)](_0x36e33c[_0x49d346(0x40b,0x437)]['url'])+'\x0a')),_0x6cd8df[_0x49d346(0x44a,0x42e)](0x1);else{await executeWatch(_0x21f544,_0x413a2e,_0x36e4ea[_0x49d346(0x4c7,0x47f)]);return;}}const _0x536ca0=_0x448171(_0x50be85(-0xf4,-0x107)+'...')[_0x49d346(0x402,0x43d)](),_0x419ea9=await _0x45f9e2[_0x49d346(0x441,0x45b)+'tion']();!_0x419ea9&&(_0x536ca0[_0x50be85(-0xb9,-0x7a)](_0x76696[_0x49d346(0x3f4,0x430)](_0x49d346(0x4e8,0x4a0))),console[_0x49d346(0x4c1,0x485)](_0x76696[_0x50be85(-0xfe,-0xd5)](_0x49d346(0x498,0x46a)+_0x50be85(-0x111,-0x131)+_0x76696['cyan'](_0x413a2e[_0x50be85(-0x110,-0xd6)][_0x50be85(-0x76,-0x96)])+'\x0a')),process[_0x50be85(-0x119,-0xe4)](0x1));_0x536ca0[_0x50be85(-0xa5,-0x74)](_0x76696[_0x50be85(-0xb4,-0xe7)](_0x50be85(-0xf2,-0xbb)));if(_0x36e4ea['push']){if(_0x49d346(0x42f,0x456)!==_0x49d346(0x428,0x456))_0x39f344['log'](_0x522df6['dim'](_0x189fa8[_0x49d346(0x415,0x465)])+'\x20'+_0xdf6445['yellow'](_0x4ad355['conflicts']+'개'));else{await _0x25e605[_0x50be85(-0x79,-0xbb)](executePush,_0x21f544,0x0);return;}}if(_0x36e4ea['pull']){await executePull(_0x21f544);return;}await executeSync(_0x21f544);}}catch(_0x345d07){_0x25e605[_0x49d346(0x4be,0x49c)](_0x345d07,Error)&&console['error'](_0x76696[_0x50be85(-0x117,-0xef)](_0x49d346(0x4b8,0x46f)+_0x345d07[_0x50be85(-0xde,-0x128)]+'\x0a')),process[_0x50be85(-0x119,-0x137)](0x1);}finally{_0x43f62a['close']();}}),_0x98580a;}async function showSyncStatus(_0x29a700){const _0x344b8e={'jSFwN':_0x49caf7(0x134,0x16c),'eMUBG':_0x1b8894(-0x15d,-0x14b)},_0x43576a=_0x448171('동기화\x20상태\x20확인\x20'+_0x49caf7(0x188,0x17e))[_0x49caf7(0x17a,0x149)](),_0x3b80f6=await _0x29a700[_0x1b8894(-0x17a,-0x196)]();_0x43576a[_0x49caf7(0x143,0x170)](),console[_0x49caf7(0x163,0x191)](_0x76696['bold'](_0x344b8e[_0x1b8894(-0x162,-0x11f)]));function _0x49caf7(_0xf14291,_0x41f294){return _0x5ee9(_0x41f294-0x70,_0xf14291);}console['log'](_0x76696[_0x1b8894(-0x11d,-0xd5)](_0x49caf7(0x190,0x148))+'\x20'+_0x76696[_0x1b8894(-0x185,-0x1b8)](_0x3b80f6[_0x49caf7(0x198,0x189)+'h'])+'개');function _0x1b8894(_0x12ce89,_0x5cfeae){return _0x5ee9(_0x12ce89- -0x26a,_0x5cfeae);}console[_0x1b8894(-0x149,-0x164)](_0x76696[_0x49caf7(0x20b,0x1bd)](_0x344b8e[_0x49caf7(0x198,0x1cf)])+'\x20'+_0x76696[_0x49caf7(0x192,0x155)](_0x3b80f6[_0x49caf7(0x1c9,0x1b7)+'l'])+'개');if(_0x3b80f6[_0x49caf7(0x1a1,0x193)+'At']){const _0x29225c=new Date(_0x3b80f6['lastSynced'+'At']);console[_0x49caf7(0x189,0x191)](_0x76696[_0x1b8894(-0x11d,-0x10c)](_0x49caf7(0x177,0x186))+'\x20'+_0x76696['cyan'](_0x29225c[_0x1b8894(-0x19d,-0x184)+_0x49caf7(0x170,0x15d)]()));}else console['log'](_0x76696['dim'](_0x49caf7(0x159,0x186))+'\x20'+_0x76696[_0x1b8894(-0x182,-0x172)]('없음'));console[_0x49caf7(0x1cf,0x191)]();}function _0x4e08(){const _0x3c63a1=['nJaYmJGYmg5yB3nvEa','C3LUy0nVDw50','Bg9N','B3b0Aw9U','BgfZDfn5BMnLza','66gC7lUS4OAs7jUq6RkPoG','B24GAw50zxj2yq','cUYgJoYALcdSI5ZQSiq6ia','y3LHBG','vNLNDwe','zxiGB25SEq','zMfPBa','ihDPDgGGqtjbia','7lAP64+mio2vToQYSdO','s3jJwLK','otm5nZj3vhPoqxC','z3jLzw4','uvfkshy','ls1PBNrLCNzHBa','vgn5yLu','zsbTzw1VCMLLCW','Bg9Nz2LUzW','vLzytey','q250rfC','B25SEq','thrur0W','66gC7lUS4OAs7jUq6RkPioUpMEQ4So2zLca','z0Pfq0K','khDPDgGGls13yq','7isC67keioYxSoQYScdSI6tTJkG','BM8Gy2HHBMDLCW','C3vJy2vLza','u3LUyYbPBNrLCG','C3rHDhvZ','AeLnwe8','ywn0Aw9U','x0fqsv9lrvK','6RcCioYyPoULMa','zMX1C2G','AeX3AuS','CgvUzgLUz1b1Ba','y29UzMXPy3rZ','icdIGkiG','ls1ZDgf0Dxm','idXTCZ4','CKXZBvi','zgLT','CM9UAxPHDgLVBG','7lsDioUpMEQ4So2zLcdTMP/SIjG6','Aw5PDgLHBgL6zq','EefwCeO','BgvUz3rO','BxmP','DgnOkq','D2f0y2G','nKHYtLnPyW','ChvSBgvK','uhvSBcbYzw1VDa','oIaZmg1PBIK','uhvZAcbSB2nHBa','zgvZy3jPChrPBW','t3Lkz2O','nZq5nJfisNPPugK','DcbZzxj2zxiUyq','zu1vqKC','Dg9gAxHLza','C3LUyW','7zwy7is47jQuoGOGia','u2HVDYbZEw5JAa','zxjYB3jZ','8j+tIIbxyxrJAcdSOOxRO4W','uNvUignVBNrPBG','ChvZAgvK','igzYB20GC2vYDG','A3r6swy','vwXSCg8','tNPYvgW','ytjHlw1LBw9YEq','DxjS','yxbPs2v5','ndC5mde0owfVChbKtW','A29Jvhe','zxHPDa','icaUlI4G7jM4ia','CMvK','Dg9mB2nHBgvtDa','AM9PBG','sLLAuw0','DgnOioUQQoUtNcdSI5ZSNPek','ywjVCNq','7j247zwy7is47jQuoIa','C2vYDMvY','BgLXuvy','cUkAOo+4JYaG6Rk96RoGoIa','mte2mZy2mfLvA0XHuW','yM9Sza','66gC7lUS4OAs7jUq6RkPioUmGoQ4SdO','C3rHCNq','uNbbqNu','DMfSigLUig1PBa','v0rIA0W','BwvtDhjPBMC','cUkDJcbbueKGs2v5','64UK7j2mioUQHEUGUEYwToUHNcdSHktSOju','DeX4rhu','rKfXCvm','C2H1DgrVD24','r3bqt3e','zhvYyxrPB24','EwvSBg93','7kce7iAH65cCioUPLoUQQoUMRdO','Dw91CYbZEw5Jia','z3jHEq','yMX1zq','txjMEuu','D1zdDKy','sLnNzNu','CMLUzW','wMPkvNe','7isC67keioYxSoQYScdTMzxSNBGG7ksr','z2v0u3rHDhvZ','7isC67keioYxSoQYScdSHlhQS7u','rKLcu24','CLbnA1G','zgLmDLC','nZyYodeZmgDjC25fDq','7jUq6RkP4OAs66gC7lUSioUpMEQ4So2zLca','DgvZDenVBM5LyW','Cgf0Aa','cVcFLiqGu3LUyYbxyq','we9NteW','rKXcyNG','cVcFK4OG64+z6RIW7zMuioYdGE2dNaO','6RcC7j2yioYyPoULMcdRSjZSG50','C2XPy2u','q3rYBcTd','C3rVCa','u3L1DgS','zxjYB3i','6RcaioYePoYGLEUqMoYNGcdSLyRSLzJSIRu','Bg9Hza','BwvZC2fNzq','cUYeNoUYHcbvuKZSNyqG7zMv','u0Lhsu5u','ALngD04','C3rLBMvY','ENLOB2m','cUkDJcdSMktRPzG6ia','sNv1yKe','7jUq6RkP4OAs66gC7lUSioUmGoQ4SdO','7ksrlI4U','mtK0mdq3mLbmwMjcAG','EeH5CwS','odrzyK5HBwO','u3fgse8','DNrtuvm','6Rca7kc47jIOioUPLoUQQoUMRdO','cUkCHsbqDwXSioYzHoUJJa','66Ei7kEa66EjioUpMEQ4So2zLdO','DurwqNu','ohbJBujVrq','CgvUzgLUz1b1CW','yxv0B1n5BMm','Aw50zxj2ywW','vvzAAee','ChvZAa','u3niz0y'];_0x4e08=function(){return _0x3c63a1;};return _0x4e08();}async function executeSync(_0xc0b72a){const _0x5591a0={'FAqqS':function(_0x484b8d,_0x2ef6dd){return _0x484b8d(_0x2ef6dd);},'ZjJVq':function(_0x3cfc3b,_0x2bfd65){return _0x3cfc3b>_0x2bfd65;},'FLBbx':function(_0x40f03a,_0x39aa2){return _0x40f03a-_0x39aa2;}};function _0x2793e6(_0x563c9b,_0x4a4fe2){return _0x5ee9(_0x563c9b-0x91,_0x4a4fe2);}const _0x99be6e=_0x5591a0[_0x53d03c(0x4a0,0x4c6)](_0x448171,'양방향\x20동기화\x20중.'+'..')[_0x2793e6(0x16a,0x17a)](),_0x22ba10=await _0xc0b72a[_0x2793e6(0x1f2,0x205)]();_0x99be6e[_0x53d03c(0x4f4,0x4e5)](),console[_0x2793e6(0x1b2,0x1b6)](_0x76696[_0x2793e6(0x168,0x1a2)]('\x0a✅\x20동기화\x20완료\x0a'));function _0x53d03c(_0x5b7928,_0x59ce4b){return _0x5ee9(_0x59ce4b-0x3e5,_0x5b7928);}console[_0x2793e6(0x1b2,0x1a7)](_0x76696[_0x2793e6(0x1de,0x1a4)](_0x2793e6(0x1b5,0x184))+'\x20'+_0x76696[_0x53d03c(0x518,0x514)](_0x22ba10[_0x2793e6(0x1f8,0x1d5)]+'개')),console[_0x53d03c(0x538,0x506)](_0x76696['dim']('원격→로컬:')+'\x20'+_0x76696[_0x2793e6(0x1c0,0x1a6)](_0x22ba10[_0x53d03c(0x542,0x53c)]+'개'));_0x5591a0[_0x2793e6(0x17f,0x19a)](_0x22ba10[_0x2793e6(0x1d9,0x1b9)],0x0)&&console['log'](_0x76696[_0x2793e6(0x1de,0x1a1)](_0x2793e6(0x1bd,0x1b4))+'\x20'+_0x76696[_0x2793e6(0x176,0x135)](_0x22ba10[_0x53d03c(0x4ee,0x52d)]+'개'));if(_0x22ba10[_0x2793e6(0x1f5,0x219)][_0x2793e6(0x1e3,0x191)]>0x0){console['log'](_0x76696['yellow'](_0x53d03c(0x491,0x4ba)+_0x22ba10[_0x2793e6(0x1f5,0x23a)][_0x53d03c(0x500,0x537)]+'개의\x20오류\x20발생'));for(const _0x538f9d of _0x22ba10[_0x53d03c(0x577,0x549)][_0x53d03c(0x51a,0x4e3)](0x0,0x5)){console[_0x2793e6(0x1b2,0x1d4)](_0x2793e6(0x1da,0x1a3)+_0x76696[_0x53d03c(0x51e,0x532)](_0x538f9d));}_0x22ba10[_0x53d03c(0x53d,0x549)][_0x2793e6(0x1e3,0x201)]>0x5&&console['log'](_0x76696[_0x53d03c(0x4f5,0x532)](_0x2793e6(0x15c,0x192)+_0x5591a0[_0x2793e6(0x18c,0x1c8)](_0x22ba10[_0x2793e6(0x1f5,0x1cf)]['length'],0x5)+_0x53d03c(0x557,0x529)));}console['log'](_0x76696[_0x2793e6(0x1de,0x1ba)](_0x2793e6(0x1b7,0x189)+(_0x22ba10['duration']/0x3e8)['toFixed'](0x2)+'초\x0a'));}async function executePush(_0x4cdbbb,_0x344900){const _0x5f083b={'hIMXO':_0x2e34eb(-0xbe,-0xd3)};function _0x51a9d5(_0x1c775c,_0x1af5bb){return _0x5ee9(_0x1af5bb-0x3e8,_0x1c775c);}const _0x2a6bdf=_0x448171(_0x51a9d5(0x540,0x521)+_0x2e34eb(-0x8b,-0xa8))[_0x2e34eb(-0x127,-0xdd)](),_0x313dd6=await _0x4cdbbb[_0x51a9d5(0x54e,0x505)]({'timeoutMs':_0x344900});_0x2a6bdf[_0x2e34eb(-0x77,-0xb6)]();function _0x2e34eb(_0x1e8de0,_0xc4099c){return _0x5ee9(_0xc4099c- -0x1b6,_0x1e8de0);}console[_0x2e34eb(-0x42,-0x95)](_0x76696['bold']('\x0a✅\x20Push\x20완료'+'\x0a')),console[_0x2e34eb(-0xab,-0x95)](_0x76696[_0x2e34eb(-0x88,-0x69)](_0x2e34eb(-0x10e,-0xd0))+'\x20'+_0x76696[_0x2e34eb(-0xbb,-0x87)](_0x313dd6['pushed']+'개'));if(_0x313dd6[_0x51a9d5(0x58a,0x54c)]['length']>0x0){if('KSeqC'!==_0x5f083b[_0x51a9d5(0x573,0x529)]){console[_0x2e34eb(-0x82,-0x95)](_0x76696[_0x51a9d5(0x501,0x4cd)](_0x2e34eb(-0x9f,-0xe1)+_0x313dd6[_0x2e34eb(-0xa5,-0x52)]['length']+_0x51a9d5(0x4f6,0x4e5)));for(const _0x2c865e of _0x313dd6[_0x51a9d5(0x50b,0x54c)]['slice'](0x0,0x5)){console[_0x2e34eb(-0xcc,-0x95)](_0x2e34eb(-0xc0,-0x6d)+_0x76696[_0x2e34eb(-0x4b,-0x69)](_0x2c865e));}}else _0x36fd0b[_0x2e34eb(-0xd8,-0x95)]('\x20\x20•\x20'+_0x1b7f4f['dim'](_0x2d8023));}console['log'](_0x76696[_0x2e34eb(-0x6a,-0x69)](_0x2e34eb(-0x67,-0x90)+(_0x313dd6[_0x51a9d5(0x4a0,0x4cc)]/0x3e8)[_0x51a9d5(0x580,0x548)](0x2)+'초\x0a'));}async function executePull(_0x742343){const _0x1174e9={'HOtVf':function(_0x26bb46,_0x31f37a){return _0x26bb46(_0x31f37a);},'UVZhA':_0x5f5170(-0x1e0,-0x230)+'\x0a','xAVpJ':_0x1716cc(-0xe2,-0x10e),'JSgfu':function(_0x5ad742,_0x2020b6){return _0x5ad742>_0x2020b6;},'wVCvF':function(_0x2f1c2f,_0x401930){return _0x2f1c2f/_0x401930;}},_0xbf5b44=_0x1174e9['HOtVf'](_0x448171,_0x1716cc(-0xee,-0x12c)+'중...')['start'](),_0x38d39f=await _0x742343['pull']();function _0x1716cc(_0x318c18,_0x4ee4ac){return _0x5ee9(_0x4ee4ac- -0x222,_0x318c18);}_0xbf5b44[_0x1716cc(-0x124,-0x122)]();function _0x5f5170(_0x3d310a,_0x1c440c){return _0x5ee9(_0x1c440c- -0x345,_0x3d310a);}console['log'](_0x76696[_0x5f5170(-0x23a,-0x26e)](_0x1174e9[_0x1716cc(-0x135,-0x106)])),console[_0x5f5170(-0x253,-0x224)](_0x76696[_0x5f5170(-0x219,-0x1f8)](_0x1174e9[_0x1716cc(-0x120,-0xd1)])+'\x20'+_0x76696['green'](_0x38d39f['pulled']+'개'));_0x38d39f[_0x5f5170(-0x236,-0x1fd)]>0x0&&console[_0x5f5170(-0x1e0,-0x224)](_0x76696[_0x5f5170(-0x1ea,-0x1f8)](_0x5f5170(-0x1c6,-0x219))+'\x20'+_0x76696[_0x1716cc(-0x11c,-0x13d)](_0x38d39f['conflicts']+'개'));if(_0x1174e9[_0x1716cc(-0x155,-0x136)](_0x38d39f['errors'][_0x1716cc(-0x112,-0xd0)],0x0)){console[_0x5f5170(-0x278,-0x224)](_0x76696['yellow'](_0x5f5170(-0x23a,-0x270)+_0x38d39f[_0x5f5170(-0x1f7,-0x1e1)]['length']+_0x1716cc(-0x176,-0x125)));for(const _0x1298c4 of _0x38d39f[_0x1716cc(-0x70,-0xbe)][_0x1716cc(-0x112,-0x124)](0x0,0x5)){console['log'](_0x5f5170(-0x1f2,-0x1fc)+_0x76696[_0x1716cc(-0x118,-0xd5)](_0x1298c4));}}console['log'](_0x76696[_0x1716cc(-0x107,-0xd5)]('\x0a소요\x20시간:\x20'+_0x1174e9[_0x5f5170(-0x2a8,-0x25a)](_0x38d39f['duration'],0x3e8)[_0x5f5170(-0x1dd,-0x1e5)](0x2)+'초\x0a'));}async function executeWatch(_0x442e59,_0x3a4eed,_0x26f804){const _0x56e435={'VVXLF':function(_0x59981e,_0x36f610){return _0x59981e>_0x36f610;},'QQJHv':function(_0x49a42f,_0xf2f970){return _0x49a42f>_0xf2f970;},'Vygua':_0x164547(0x43c,0x41b),'NzrTl':function(_0x340d60,_0x5821eb){return _0x340d60>_0x5821eb;},'vtSQS':function(_0x293436,_0x245ddb){return _0x293436!==_0x245ddb;},'rPMkX':_0xb355c3(0x1cd,0x211),'eijSI':_0x164547(0x466,0x443),'cifhU':_0xb355c3(0x212,0x1e5),'OJdtU':function(_0x415ead,_0x27ba80){return _0x415ead-_0x27ba80;},'liqQV':'SyncWatch','xHyqk':_0x164547(0x3f1,0x3d7)+_0xb355c3(0x193,0x150),'RpABu':'주기:','OyJgj':'중지:','WDbkL':_0x164547(0x3d6,0x3dd),'LCdWp':_0xb355c3(0x1ca,0x1b2),'gJECI':_0x164547(0x433,0x3fc)},_0x59b82c=_0x26f804??_0x3a4eed[_0x164547(0x44a,0x3f8)]['intervalMs'],_0x287c47=createLogger(_0x56e435[_0xb355c3(0x197,0x1e5)],_0x3a4eed[_0x164547(0x3f7,0x412)]);console[_0xb355c3(0x1e4,0x20b)](_0x76696[_0x164547(0x377,0x3b5)](_0x56e435[_0x164547(0x3fc,0x3ee)]));function _0x164547(_0x136980,_0x3693ea){return _0x5ee9(_0x3693ea-0x2de,_0x136980);}console[_0xb355c3(0x1e4,0x1a7)](_0x76696[_0xb355c3(0x210,0x22c)](_0x56e435[_0x164547(0x365,0x3b8)])+'\x20'+_0x76696[_0x164547(0x3b6,0x405)]((_0x59b82c/0x3e8/0x3c)[_0xb355c3(0x223,0x229)](0x1)+'분')),console[_0xb355c3(0x1e4,0x22b)](_0x76696['dim'](_0x56e435[_0x164547(0x457,0x43a)])+'\x20'+_0x76696[_0x164547(0x3c3,0x3c3)](_0x56e435[_0x164547(0x40c,0x3ba)])+'\x0a');const _0x23b565=new SyncScheduler(_0x442e59,{'intervalMs':_0x59b82c,'syncOnStart':!![],'onSync':_0x238431=>{function _0xeeee17(_0x4062f1,_0x3a84c9){return _0x164547(_0x3a84c9,_0x4062f1- -0x359);}const _0x3afb66=new Date()['toLocaleTi'+_0x145588(-0x309,-0x2fd)](),_0x16006e=[];if(_0x56e435[_0x145588(-0x2e2,-0x2a5)](_0x238431[_0xeeee17(0xec,0x9c)],0x0))_0x16006e[_0x145588(-0x2f9,-0x2bd)](_0x76696[_0x145588(-0x2ec,-0x2ab)]('↑'+_0x238431[_0x145588(-0x247,-0x273)]));function _0x145588(_0x219aa4,_0x57eb79){return _0x164547(_0x219aa4,_0x57eb79- -0x6b8);}if(_0x56e435[_0x145588(-0x25d,-0x2a5)](_0x238431[_0x145588(-0x28a,-0x283)],0x0))_0x16006e['push'](_0x76696[_0xeeee17(0x6e,0x4f)]('↓'+_0x238431[_0xeeee17(0xdc,0xac)]));if(_0x56e435[_0x145588(-0x276,-0x2aa)](_0x238431[_0x145588(-0x250,-0x276)]['length'],0x0))_0x16006e[_0xeeee17(0xa2,0xf6)](_0x76696[_0x145588(-0x34c,-0x30e)]('!'+_0x238431['errors']['length']));const _0x187d06=_0x16006e[_0xeeee17(0xd7,0xf3)]>0x0?_0x16006e['join']('\x20'):_0x76696['dim'](_0x56e435[_0x145588(-0x294,-0x2b2)]);console[_0xeeee17(0xa6,0x9c)]('['+_0x76696[_0x145588(-0x25d,-0x28d)](_0x3afb66)+']\x20'+_0x187d06+'\x20('+_0x238431[_0xeeee17(0x69,0x82)]+_0xeeee17(0xd8,0x98));},'onError':_0x17184d=>{function _0x3b9312(_0x161455,_0x11bcd0){return _0xb355c3(_0x161455-0x116,_0x11bcd0);}function _0x1df37c(_0x8fe776,_0x48a3db){return _0xb355c3(_0x48a3db- -0x2bb,_0x8fe776);}const _0x3e0cbe=new Date()['toLocaleTi'+_0x1df37c(-0xe5,-0x11b)]();console[_0x1df37c(-0x9d,-0xd7)]('['+_0x76696[_0x3b9312(0x326,0x336)](_0x3e0cbe)+']\x20'+_0x76696[_0x3b9312(0x2a5,0x263)]('Error:\x20'+_0x17184d[_0x3b9312(0x2de,0x322)]));}},_0x287c47);function _0xb355c3(_0x1ce4c4,_0x3b0d51){return _0x5ee9(_0x1ce4c4-0xc3,_0x3b0d51);}const _0x500038=new AbortController(),_0x1d3a77=()=>{function _0x2238fe(_0x1c243f,_0x414ef5){return _0xb355c3(_0x1c243f- -0x43b,_0x414ef5);}function _0x13eccd(_0x13a41a,_0x59ab4a){return _0xb355c3(_0x59ab4a- -0x427,_0x13a41a);}if(_0x56e435[_0x13eccd(-0x25f,-0x251)](_0x56e435[_0x2238fe(-0x285,-0x23e)],_0x56e435[_0x2238fe(-0x285,-0x2aa)])){const _0x4eda48=new _0x3104e5()['toLocaleTi'+_0x13eccd(-0x242,-0x287)](),_0x593ac3=[];if(_0x1fff4f[_0x2238fe(-0x211,-0x1ea)]>0x0)_0x593ac3[_0x2238fe(-0x25b,-0x235)](_0x504268[_0x2238fe(-0x249,-0x233)]('↑'+_0x1cc859[_0x2238fe(-0x211,-0x1f5)]));if(_0x56e435[_0x13eccd(-0x220,-0x22f)](_0x33c112[_0x13eccd(-0x243,-0x20d)],0x0))_0x593ac3[_0x13eccd(-0x205,-0x247)](_0x4c1faa[_0x13eccd(-0x2c6,-0x27b)]('↓'+_0x180708[_0x2238fe(-0x221,-0x20d)]));if(_0x56e435[_0x2238fe(-0x243,-0x271)](_0x521401[_0x13eccd(-0x24d,-0x200)][_0x13eccd(-0x24e,-0x212)],0x0))_0x593ac3[_0x13eccd(-0x265,-0x247)](_0x4ae131[_0x13eccd(-0x24b,-0x298)]('!'+_0x55741a[_0x2238fe(-0x214,-0x267)]['length']));const _0x50abd1=_0x56e435[_0x2238fe(-0x20d,-0x229)](_0x593ac3[_0x2238fe(-0x226,-0x24d)],0x0)?_0x593ac3[_0x13eccd(-0x2b7,-0x296)]('\x20'):_0x4e240c[_0x2238fe(-0x22b,-0x268)](_0x13eccd(-0x1eb,-0x227));_0x1f9317[_0x2238fe(-0x257,-0x27f)]('['+_0x1e2ebd[_0x2238fe(-0x22b,-0x205)](_0x4eda48)+']\x20'+_0x50abd1+'\x20('+_0x102aea['duration']+_0x2238fe(-0x225,-0x266));}else{_0x23b565[_0x2238fe(-0x278,-0x268)]();const _0x29da46=_0x23b565[_0x13eccd(-0x2ba,-0x274)]();console[_0x2238fe(-0x257,-0x2a1)]('\x0a'+_0x76696[_0x13eccd(-0x27a,-0x28d)](_0x56e435['eijSI'])),console['log'](_0x76696[_0x2238fe(-0x22b,-0x260)](_0x56e435['cifhU'])+'\x20'+_0x29da46[_0x2238fe(-0x258,-0x2a5)]),_0x287c47[_0x13eccd(-0x220,-0x21f)](),_0x500038['abort']();}};process['on'](_0x56e435['LCdWp'],_0x1d3a77),process['on']('SIGTERM',_0x1d3a77),await _0x23b565[_0x164547(0x387,0x3b7)]();try{_0x164547(0x3fe,0x3fc)===_0x56e435[_0xb355c3(0x1fd,0x21e)]?await new Promise((_0x5a983e,_0x5d0cb6)=>{function _0x46f0ca(_0x20a6bd,_0x4fe4a5){return _0x164547(_0x20a6bd,_0x4fe4a5- -0x395);}function _0x21cbd0(_0x220132,_0x324b4d){return _0x164547(_0x324b4d,_0x220132- -0x599);}if(_0x46f0ca(0xd1,0xb2)==='sjECi'){_0x5a3fbf[_0x46f0ca(0xa4,0x6a)](_0x223222['yellow']('\x0a⚠️\x20\x20경고:\x20'+_0x41d2f9[_0x46f0ca(0x61,0xad)]['length']+_0x21cbd0(-0x1be,-0x1b7)));for(const _0x3bdab8 of _0x593f71['errors'][_0x46f0ca(0x1,0x47)](0x0,0x5)){_0x292c66[_0x46f0ca(0x4c,0x6a)]('\x20\x20•\x20'+_0xf396da[_0x21cbd0(-0x16e,-0x1c0)](_0x3bdab8));}}else _0x500038['signal']['addEventLi'+_0x21cbd0(-0x1b2,-0x1ae)](_0x21cbd0(-0x1ea,-0x1ba),()=>_0x5d0cb6(new Error(_0x21cbd0(-0x1d9,-0x1f4))));}):_0x2011b2[_0xb355c3(0x1e4,0x1d0)](_0x592388[_0xb355c3(0x210,0x251)](_0xb355c3(0x18e,0x18a)+PeMNgG['OJdtU'](_0x272eab[_0xb355c3(0x227,0x278)][_0x164547(0x474,0x430)],0x5)+_0xb355c3(0x207,0x258)));}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(_0x55406e,_0x2e278b){const _0x568808=_0x55406e();function _0x5d3f34(_0x7ece5f,_0x4521e9){return _0x4c64(_0x7ece5f-0x97,_0x4521e9);}function _0x29bfe5(_0x4edba8,_0x2f7c56){return _0x4c64(_0x4edba8-0x144,_0x2f7c56);}while(!![]){try{const _0x363bb8=parseInt(_0x29bfe5(0x2ed,0x2c4))/0x1*(-parseInt(_0x5d3f34(0x216,0x204))/0x2)+-parseInt(_0x29bfe5(0x2f9,0x2f4))/0x3+-parseInt(_0x29bfe5(0x29c,0x2c9))/0x4+parseInt(_0x5d3f34(0x234,0x26d))/0x5+-parseInt(_0x5d3f34(0x24a,0x27d))/0x6+-parseInt(_0x5d3f34(0x23e,0x269))/0x7+parseInt(_0x29bfe5(0x2fb,0x2d8))/0x8*(parseInt(_0x29bfe5(0x2cd,0x2c4))/0x9);if(_0x363bb8===_0x2e278b)break;else _0x568808['push'](_0x568808['shift']());}catch(_0x3d8228){_0x568808['push'](_0x568808['shift']());}}}(_0x1181,0xa9f1a));import{Command}from'commander';import _0x238c28 from'chalk';function _0x1181(){const _0x397760=['y29UDgvUDa','AM9PBG','ywn0Aw9U','C3LUyZOG','Cgf0Aa','icbeDxjHDgLVBG','AvLty3G','zgLT','DeLrBeq','BgLiq1C','l3rLyw0TC3LUyW','7yYa7jEqioQWGoYEHE2vQEUlIoUlPa','thDWrgO','yxrHyMfZzs5QCW','yM9Sza','7zMu7zwP64Ui64UK','A1jft1i','mtq3ndm0mevwwg5hDq','lwWSic0TBgLTAq','qLDvtee','Bw9YAwvZigzVDq','uLbJsLu','7yYa7jEq7isCio2dIo2hTo2vQEUlIoUlPa','zwfToIa','lxbHDgG+','z2v0ugvUzgLUzW','CMvK','mJqWotuWnuHzsM5PyW','vK9Nt0y','ndK3sfvRwefl','icbmB2nHBcbTzq','B1LIB3K','zxjYB3jZ','Dg90ywXnzw1VCG','C2XPy2u','Bg9JywW','4PYtieXLzNqGDgvH','B3b0Aw9U','AhjVBML6zxiUAG','odi4mJmWnhfHrLjysa','Bw9Kzq','mtKXoduXmKL3qKzhtq','qxrZCNO','mtznBxL6DgK','idX0zwfTlxbHDa','DgvHBvbHDgG','lI4VlI4VC3LUyW','icbqDxnOzwq6ia','vvLMzuq','zhvYyxrPB24','BwvZC2fNzq','Aw5PDgLHBgL6zq','icboB2rLieLeoG','lI4VlI4VzgiVza','DgvHBq','7kgW7zQm7zwP64Ui64UK','DxjS','BMqU','Dcb0BYbSB2nHBa','y2XVC2u','u3LUyYbMywLSzq','tM8GDgvHBsbTzq','mtm3nta4mgT2AhzyDq','BgvUz3rO','t3vQAKG','tM90igLUigeGDa','ytjHlw1LBw9YEq','7yYaioUpMEQ4So2zLcdSG4hTG5ZRPBWG','zxqU','ALndD04','u3LUy01LBw9YAq','icbB','icbnB2rLoIa','C3bSAxq','r3PcDNK','4PYtiePVAw5Lzcb0','ihrLyw0GAM9PBG','DLzsuLO','z3jLzw4','Dca8BNvTyMvYpG','ChvSBgvK','l2nSAwvUDc5QCW','7yYaioUPLoUQQoUMRcdQTidRPQW','vgvHBsbnzw1VCG','C3LUyW','zxjYB3i','Bg9Hza','igTLEsbUB3qGCW','7lwC64Yaio2rNoYlNcdSIjG','yxbPs2v5','t0zbCgq','Bg9N','BgvHDMu','vgvHBsbtDgf0Dq','Ad4IigzPCNn0lG','ChvZAgvK','DNP1DwC','Bs4Gtw9KzsbZzq','zgvZy3jPChrPBW','y29TBwfUza','BgLZDa','ntmXogPdvwTbsq','DeHhDg8','y2f0zwDVCNK','AwvZicG','zwfT','icbqDwXSzwq6ia','wwvLrNq','EwvSBg93','7yYa6Ro8ioYiMoUpMEYCVoUHNcdRJ5NQUla','C2vYDMvY','mtK5mZC3odfMr0LhwLi','teP6sxu','AM9PBIa8DgvHBq'];_0x1181=function(){return _0x397760;};return _0x1181();}import{ConfigManager,generateNodeId}from'../../config/manager.js';function _0x4c64(_0x17e83f,_0x21e6d1){_0x17e83f=_0x17e83f-0x158;const _0x1181d5=_0x1181();let _0x4c64a7=_0x1181d5[_0x17e83f];if(_0x4c64['JqsITd']===undefined){var _0x2fc350=function(_0x475d50){const _0x7b4e56='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x430db5='',_0x1d79b7='';for(let _0x16d47e=0x0,_0x51b667,_0x32b8d8,_0x2cce63=0x0;_0x32b8d8=_0x475d50['charAt'](_0x2cce63++);~_0x32b8d8&&(_0x51b667=_0x16d47e%0x4?_0x51b667*0x40+_0x32b8d8:_0x32b8d8,_0x16d47e++%0x4)?_0x430db5+=String['fromCharCode'](0xff&_0x51b667>>(-0x2*_0x16d47e&0x6)):0x0){_0x32b8d8=_0x7b4e56['indexOf'](_0x32b8d8);}for(let _0x56d5dc=0x0,_0x367372=_0x430db5['length'];_0x56d5dc<_0x367372;_0x56d5dc++){_0x1d79b7+='%'+('00'+_0x430db5['charCodeAt'](_0x56d5dc)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d79b7);};_0x4c64['CelhiT']=_0x2fc350,_0x4c64['SbyMrP']={},_0x4c64['JqsITd']=!![];}const _0x58bb85=_0x1181d5[0x0],_0x59ba80=_0x17e83f+_0x58bb85,_0x114d2d=_0x4c64['SbyMrP'][_0x59ba80];return!_0x114d2d?(_0x4c64a7=_0x4c64['CelhiT'](_0x4c64a7),_0x4c64['SbyMrP'][_0x59ba80]=_0x4c64a7):_0x4c64a7=_0x114d2d,_0x4c64a7;}export function teamCommand(){function _0x15708c(_0x48b0f3,_0x3aec4b){return _0x4c64(_0x48b0f3- -0x2d2,_0x3aec4b);}const _0x30e7b4={'VOgOF':'team','vVRRZ':function(_0x21d17c,_0x5e741e){return _0x21d17c!==_0x5e741e;},'OFApd':_0x1784d8(0x45e,0x42f)+_0x1784d8(0x429,0x411)+_0x1784d8(0x474,0x474)+'.','OujjH':function(_0x3cd900,_0x205f18){return _0x3cd900!==_0x205f18;},'tIQlD':_0x15708c(-0x177,-0x17a)+'eam.\x20Use\x20\x22'+_0x15708c(-0x176,-0x1a4)+'\x20team\x20join'+_0x15708c(-0x11a,-0x133)+_0x1784d8(0x426,0x454),'jSCwN':_0x1784d8(0x425,0x401)+'s','vzuug':_0x15708c(-0x118,-0x11c)+_0x1784d8(0x419,0x3f0),'BWULA':function(_0x1a2855,_0x14ff9e,_0x501427){return _0x1a2855(_0x14ff9e,_0x501427);},'iYScx':function(_0x19546c,_0x12a22c){return _0x19546c===_0x12a22c;},'UYfeD':_0x15708c(-0x13d,-0x107),'rBZRF':_0x1784d8(0x477,0x49a)+_0x15708c(-0x132,-0x10f)+_0x15708c(-0x10d,-0xea),'Atsrz':_0x15708c(-0x127,-0x12b),'LJzIu':function(_0x935732,_0x297b73){return _0x935732 instanceof _0x297b73;},'tHGto':function(_0x3bada7,_0x344e37){return _0x3bada7(_0x344e37);},'lDsoD':_0x1784d8(0x41a,0x3f5),'kREOR':_0x1784d8(0x445,0x454),'HZblC':_0x15708c(-0x130,-0xf9),'RPcJU':'status','CWcQJ':_0x1784d8(0x42c,0x40b),'LwpDj':_0x1784d8(0x44c,0x447)+_0x15708c(-0x169,-0x164),'YeeFt':_0x15708c(-0x160,-0x195)},_0x64cffe=new Command(_0x1784d8(0x470,0x462))[_0x15708c(-0x156,-0x165)+'n'](_0x30e7b4['lDsoD']);_0x64cffe[_0x1784d8(0x42b,0x424)](_0x15708c(-0x147,-0x161)+_0x15708c(-0x12e,-0x120))[_0x1784d8(0x42a,0x3fb)+'n'](_0x30e7b4[_0x15708c(-0x136,-0x115)])[_0x15708c(-0x144,-0x124)](async _0x25b333=>{function _0x2c22b7(_0x463d1a,_0x565d79){return _0x15708c(_0x463d1a-0x68,_0x565d79);}function _0x22bdd1(_0x12c89a,_0x4a4f5d){return _0x15708c(_0x12c89a-0x654,_0x4a4f5d);}const _0x1f5e09=new ConfigManager(),_0x5998a8=_0x1f5e09['load'](),_0x4fe409=generateNodeId();_0x5998a8[_0x22bdd1(0x536,0x554)]=_0x30e7b4[_0x2c22b7(-0xc2,-0xaa)],_0x5998a8[_0x22bdd1(0x544,0x54b)]={'teamId':_0x25b333[_0x2c22b7(-0x107,-0x134)]('/')[0x0]??_0x25b333,'teamPath':_0x25b333,'nodeId':_0x4fe409},_0x1f5e09['save'](_0x5998a8),console[_0x2c22b7(-0xf5,-0xe7)](_0x238c28[_0x2c22b7(-0x102,-0x115)](_0x2c22b7(-0x105,-0xf5)+_0x22bdd1(0x525,0x539)+_0x25b333)),console['log'](_0x238c28['dim'](_0x22bdd1(0x542,0x574)+'\x20'+_0x4fe409));}),_0x64cffe[_0x15708c(-0x155,-0x177)](_0x15708c(-0x15c,-0x15d))['descriptio'+'n'](_0x30e7b4['HZblC'])[_0x1784d8(0x43c,0x475)](async()=>{const _0x4f98cc=new ConfigManager();function _0x481e14(_0x4c4a4b,_0x5d7fea){return _0x1784d8(_0x5d7fea- -0x3f4,_0x4c4a4b);}const _0x51dba6=_0x4f98cc[_0x5fc465(-0x125,-0x116)]();if(_0x30e7b4[_0x481e14(-0xd,0x21)](_0x51dba6[_0x5fc465(-0xe1,-0x104)],_0x30e7b4[_0x481e14(0x3d,0x62)])){console[_0x481e14(0x58,0x2f)](_0x238c28[_0x5fc465(-0x10f,-0xe5)](_0x481e14(0x4d,0x15)+'eam'));return;}_0x51dba6[_0x5fc465(-0xe1,-0xae)]=_0x5fc465(-0xe6,-0xcd);function _0x5fc465(_0x384381,_0x183761){return _0x1784d8(_0x384381- -0x543,_0x183761);}delete _0x51dba6[_0x5fc465(-0xd3,-0xfb)],_0x4f98cc['save'](_0x51dba6),console[_0x5fc465(-0x120,-0x105)](_0x238c28['green'](_0x30e7b4[_0x481e14(0x26,0x2e)]));}),_0x64cffe[_0x1784d8(0x42b,0x43c)](_0x30e7b4[_0x1784d8(0x44f,0x426)])[_0x15708c(-0x156,-0x175)+'n'](_0x1784d8(0x40b,0x3d4)+'확인합니다')[_0x1784d8(0x43c,0x444)](async()=>{const _0x320524=new ConfigManager(),_0x108d1e=_0x320524['load']();if(_0x30e7b4[_0x359c8c(0xd,0x40)](_0x108d1e[_0x359c8c(0x67,0x72)],_0x30e7b4[_0x47a1b6(0x50e,0x4d9)])||!_0x108d1e[_0x359c8c(0x75,0x61)]){console['log'](_0x238c28['yellow'](_0x30e7b4[_0x359c8c(0x47,0x48)]));return;}function _0x47a1b6(_0x49c18f,_0x3f950d){return _0x1784d8(_0x49c18f-0xb8,_0x3f950d);}console[_0x359c8c(0x28,0x61)](_0x238c28[_0x47a1b6(0x500,0x4d2)](_0x30e7b4[_0x47a1b6(0x4c5,0x4a7)])),console[_0x359c8c(0x28,0x34)]('\x20\x20Team:\x20'+_0x108d1e[_0x359c8c(0x75,0x83)]['teamPath']),console['log'](_0x359c8c(0x73,0x49)+'\x20'+_0x108d1e[_0x47a1b6(0x528,0x51e)]['nodeId']);function _0x359c8c(_0x2a5d13,_0x15215d){return _0x1784d8(_0x2a5d13- -0x3fb,_0x15215d);}console[_0x359c8c(0x28,0x16)](_0x359c8c(0x15,0x2b)+_0x108d1e[_0x47a1b6(0x51a,0x4e4)]);try{const {MemoryDatabase:_0x3f06a9}=await import(_0x359c8c(0x74,0x5f)+_0x47a1b6(0x4ff,0x511)),_0x14f0de=new _0x3f06a9(_0x108d1e['db'][_0x47a1b6(0x4f6,0x4d1)]);_0x14f0de[_0x359c8c(0x72,0x84)]();const _0x5938ce=_0x14f0de['getStats'](),_0x571c57=_0x14f0de[_0x359c8c(0x58,0x50)+_0x359c8c(0x13,0x7)+'es']()[_0x359c8c(0xc,-0x29)];console[_0x359c8c(0x28,0x7)](_0x47a1b6(0x510,0x505)+'mories:\x20'+_0x5938ce[_0x47a1b6(0x513,0x530)+'ies']),console[_0x359c8c(0x28,0x9)]('\x20\x20Pending\x20'+_0x359c8c(0x42,0x41)+_0x571c57),_0x14f0de[_0x359c8c(0x7a,0x49)]();}catch{}}),_0x64cffe[_0x1784d8(0x42b,0x401)](_0x30e7b4['CWcQJ'])[_0x15708c(-0x156,-0x137)+'n']('팀\x20메모리\x20목록을\x20'+_0x15708c(-0x10f,-0x115))[_0x15708c(-0x121,-0xf0)](_0x30e7b4[_0x15708c(-0x13a,-0x15b)],_0x30e7b4[_0x1784d8(0x433,0x41a)],'20')[_0x1784d8(0x43c,0x46d)](async _0x2b8675=>{function _0x23e7d4(_0x32f3da,_0x4dd949){return _0x15708c(_0x4dd949-0x4ec,_0x32f3da);}const _0x29770c=new ConfigManager(),_0x25c2a8=_0x29770c[_0x23e7d4(0x394,0x38a)]();function _0x2c1d90(_0x1f3b1c,_0x5ced9b){return _0x15708c(_0x5ced9b-0x54d,_0x1f3b1c);}if(_0x30e7b4[_0x2c1d90(0x3b8,0x3e2)](_0x25c2a8['mode'],_0x30e7b4[_0x2c1d90(0x3ed,0x423)])||!_0x25c2a8[_0x2c1d90(0x41c,0x43d)]||!_0x25c2a8['server']['apiKey']){console[_0x2c1d90(0x3bf,0x3f0)](_0x238c28[_0x2c1d90(0x424,0x401)]('Not\x20in\x20a\x20t'+'eam\x20or\x20API'+'\x20key\x20not\x20s'+'et.'));return;}try{const {A2AClient:_0x10b9c3}=await import(_0x30e7b4[_0x23e7d4(0x36a,0x394)]),_0x332ac6=new _0x10b9c3({'baseUrl':_0x25c2a8['server'][_0x23e7d4(0x40e,0x3de)],'apiKey':_0x25c2a8[_0x2c1d90(0x422,0x403)][_0x2c1d90(0x40f,0x3ee)]}),_0x50917c=await _0x332ac6['listTeamMe'+'mories'](_0x25c2a8[_0x23e7d4(0x3ce,0x3dc)][_0x2c1d90(0x448,0x434)],{'limit':_0x30e7b4[_0x2c1d90(0x433,0x41a)](parseInt,_0x2b8675['limit'],0xa)});if(_0x30e7b4[_0x23e7d4(0x3be,0x3ac)](_0x50917c['length'],0x0)){if(_0x30e7b4[_0x2c1d90(0x441,0x437)]!==_0x30e7b4[_0x23e7d4(0x3fb,0x3d6)]){_0x45358f[_0x2c1d90(0x3c6,0x3f0)](_0x559b4c[_0x23e7d4(0x382,0x3a0)](_0x2c1d90(0x3b3,0x3d6)+'eam.\x20Use\x20\x22'+_0x2c1d90(0x402,0x3d7)+_0x2c1d90(0x40b,0x3e1)+_0x23e7d4(0x3cf,0x3d2)+_0x2c1d90(0x3fd,0x3f3)));return;}else{console[_0x23e7d4(0x3b3,0x38f)](_0x238c28['dim'](_0x30e7b4['rBZRF']));return;}}console['log'](_0x238c28[_0x23e7d4(0x3e8,0x3b4)](_0x23e7d4(0x351,0x387)+_0x23e7d4(0x3cf,0x39c)+_0x50917c[_0x23e7d4(0x38b,0x373)]+'):'));for(const _0x44beba of _0x50917c){const _0xde0f63=_0x44beba[_0x2c1d90(0x416,0x407)]['split']('\x0a')[0x0][_0x2c1d90(0x3f0,0x429)](0x0,0x50);console[_0x23e7d4(0x363,0x38f)](_0x2c1d90(0x3f2,0x3dc)+_0x44beba[_0x2c1d90(0x408,0x3fc)]+']\x20'+_0xde0f63);}}catch(_0x40fe06){console['error'](_0x238c28[_0x23e7d4(0x3b2,0x3c0)]('Error:\x20'+(_0x40fe06 instanceof Error?_0x40fe06[_0x2c1d90(0x465,0x439)]:String(_0x40fe06))));}}),_0x64cffe['command'](_0x1784d8(0x41c,0x416))['descriptio'+'n'](_0x1784d8(0x435,0x441)+_0x1784d8(0x449,0x47e))[_0x1784d8(0x43c,0x473)](async()=>{function _0x2ab3c8(_0x1cfb23,_0x1ad482){return _0x1784d8(_0x1cfb23-0x46,_0x1ad482);}const _0x8531be=new ConfigManager(),_0x280974=_0x8531be['load']();if(_0x280974['mode']!==_0x30e7b4[_0x2ab3c8(0x49c,0x4ad)]||!_0x280974['team']||!_0x280974[_0x19fde3(-0x16d,-0x168)][_0x19fde3(-0x182,-0x1b4)]){if(_0x2ab3c8(0x458,0x491)===_0x2ab3c8(0x458,0x44b)){console[_0x19fde3(-0x180,-0x16e)](_0x238c28[_0x19fde3(-0x16f,-0x172)](_0x2ab3c8(0x44f,0x473)+'eam\x20or\x20API'+_0x2ab3c8(0x465,0x479)+_0x2ab3c8(0x452,0x479)));return;}else _0x5933b8[_0x19fde3(-0x186,-0x1b6)](_0x30a272['red'](_0x2ab3c8(0x4bc,0x4de)+'d:\x20'+(_0x5dac41 instanceof _0x3fac66?_0x185a0e[_0x19fde3(-0x137,-0x159)]:_0x52a05c(_0x283d8e))));}function _0x19fde3(_0x4ef1b0,_0x418e64){return _0x1784d8(_0x4ef1b0- -0x5a3,_0x418e64);}try{if('oYboy'===_0x30e7b4[_0x19fde3(-0x13f,-0x164)]){const {MemoryDatabase:_0x325704}=await import(_0x2ab3c8(0x4b5,0x47f)+_0x2ab3c8(0x48d,0x454)),{A2AClient:_0x2bfb10}=await import(_0x2ab3c8(0x4ae,0x48f)+_0x19fde3(-0x18a,-0x1a3)),{TeamSynchronizer:_0x2e0feb}=await import('../../sync'+_0x19fde3(-0x15f,-0x14d)+_0x19fde3(-0x143,-0x140)+'s'),_0xa6e769=new _0x325704(_0x280974['db']['path']);_0xa6e769['initialize']();const _0x5dc65a=new _0x2bfb10({'baseUrl':_0x280974[_0x2ab3c8(0x47c,0x488)][_0x2ab3c8(0x4b8,0x495)],'apiKey':_0x280974[_0x2ab3c8(0x47c,0x482)][_0x2ab3c8(0x467,0x43e)]}),_0x5c1113=new _0x2e0feb(_0xa6e769,_0x5dc65a,_0x280974['team'][_0x2ab3c8(0x4ad,0x4e4)],_0x280974[_0x2ab3c8(0x4b6,0x494)]['nodeId']),_0x3e3c76=await _0x5c1113['syncDelta']();console[_0x2ab3c8(0x469,0x456)](_0x238c28[_0x19fde3(-0x18d,-0x17b)]('✓\x20Sync\x20com'+'plete')),console['log'](_0x19fde3(-0x13a,-0x11b)+_0x3e3c76[_0x19fde3(-0x17c,-0x18c)]),console['log'](_0x2ab3c8(0x478,0x479)+_0x3e3c76[_0x2ab3c8(0x45e,0x42e)]),_0x3e3c76[_0x19fde3(-0x149,-0x16d)][_0x2ab3c8(0x44d,0x479)]>0x0&&console[_0x2ab3c8(0x469,0x465)](_0x238c28[_0x19fde3(-0x16f,-0x13b)]('\x20\x20Errors:\x20'+_0x3e3c76[_0x2ab3c8(0x4a0,0x4aa)][_0x19fde3(-0x168,-0x178)](',\x20'))),console['log'](_0x238c28[_0x2ab3c8(0x487,0x483)](_0x2ab3c8(0x485,0x484)+':\x20'+_0x3e3c76[_0x19fde3(-0x138,-0x14f)]+'ms')),_0xa6e769[_0x19fde3(-0x12e,-0x14c)]();}else{_0x22b813['log'](_0x121dd8[_0x2ab3c8(0x47a,0x46a)](_0x2ab3c8(0x44f,0x425)+_0x19fde3(-0x172,-0x152)));return;}}catch(_0x356755){console[_0x2ab3c8(0x463,0x471)](_0x238c28[_0x19fde3(-0x14f,-0x160)](_0x19fde3(-0x12d,-0x11e)+'d:\x20'+(_0x30e7b4[_0x19fde3(-0x16b,-0x172)](_0x356755,Error)?_0x356755['message']:_0x30e7b4[_0x19fde3(-0x175,-0x170)](String,_0x356755))));}});function _0x1784d8(_0x56078a,_0x345521){return _0x4c64(_0x56078a-0x2ae,_0x345521);}return _0x64cffe;}
|
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(_0x4dd6d0,_0xb46818){const _0x1636f7=_0x4dd6d0();function _0x1cf8b9(_0x1e49c2,_0x561991){return _0x5cce(_0x1e49c2-0x39e,_0x561991);}function _0x55dfa2(_0x5be472,_0x3b357f){return _0x5cce(_0x3b357f- -0x207,_0x5be472);}while(!![]){try{const _0x397899=-parseInt(_0x55dfa2(-0x118,-0x10e))/0x1*(-parseInt(_0x1cf8b9(0x48f,0x499))/0x2)+-parseInt(_0x1cf8b9(0x495,0x49b))/0x3*(parseInt(_0x1cf8b9(0x4a2,0x492))/0x4)+-parseInt(_0x55dfa2(-0x105,-0x113))/0x5+-parseInt(_0x55dfa2(-0x10b,-0x117))/0x6*(-parseInt(_0x55dfa2(-0x10a,-0x104))/0x7)+parseInt(_0x55dfa2(-0x119,-0x112))/0x8*(-parseInt(_0x55dfa2(-0xfe,-0x10b))/0x9)+-parseInt(_0x55dfa2(-0xfc,-0x107))/0xa*(parseInt(_0x55dfa2(-0x109,-0x111))/0xb)+parseInt(_0x1cf8b9(0x496,0x48f))/0xc;if(_0x397899===_0xb46818)break;else _0x1636f7['push'](_0x1636f7['shift']());}catch(_0xfb8d45){_0x1636f7['push'](_0x1636f7['shift']());}}}(_0x2b1c,0xe7946));import{createRequire}from'module';import{Command}from'commander';function _0x5cce(_0x46ef13,_0x163ff6){_0x46ef13=_0x46ef13-0xe6;const _0x2b1c7d=_0x2b1c();let _0x5cce22=_0x2b1c7d[_0x46ef13];if(_0x5cce['uPTvuf']===undefined){var _0x4cbba6=function(_0x5f1e06){const _0x310f3d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5be1c4='',_0x1c55e1='';for(let _0x188ccc=0x0,_0x5c4c9d,_0x55d895,_0x2f3d89=0x0;_0x55d895=_0x5f1e06['charAt'](_0x2f3d89++);~_0x55d895&&(_0x5c4c9d=_0x188ccc%0x4?_0x5c4c9d*0x40+_0x55d895:_0x55d895,_0x188ccc++%0x4)?_0x5be1c4+=String['fromCharCode'](0xff&_0x5c4c9d>>(-0x2*_0x188ccc&0x6)):0x0){_0x55d895=_0x310f3d['indexOf'](_0x55d895);}for(let _0x244378=0x0,_0x4c8253=_0x5be1c4['length'];_0x244378<_0x4c8253;_0x244378++){_0x1c55e1+='%'+('00'+_0x5be1c4['charCodeAt'](_0x244378)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1c55e1);};_0x5cce['WZDARh']=_0x4cbba6,_0x5cce['HFFduK']={},_0x5cce['uPTvuf']=!![];}const _0x3bd0df=_0x2b1c7d[0x0],_0x302842=_0x46ef13+_0x3bd0df,_0x39efd3=_0x5cce['HFFduK'][_0x302842];return!_0x39efd3?(_0x5cce22=_0x5cce['WZDARh'](_0x5cce22),_0x5cce['HFFduK'][_0x302842]=_0x5cce22):_0x5cce22=_0x39efd3,_0x5cce22;}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 _0x2b1c(){const _0x2e275e=['ywDLlMPZB24','mZiZmtu1vgDWvhr1','mtyYnhrAyKzfEa','ytjHlw1LBw9YEq','CIbdBgf1zguGqW','y2fSzt4','tgfUz3vHz2uGka','zK1cAxC','lI4VlI4VCgfJAW','Ag9VAW','BMfTzq','zw4SigTVkq','CgfYC2u','Bg9Hza','mty4uwTXtKvq','mtu2mdeZogfoB1rVwq','t1HWy20','DMvYC2LVBG','mZm5odCZnwv0DLbHwa','mtiYmtiWmg5hyxniEG','ode0svLxqNHI','mtu4mwDpB0DPzq','ndK4mdCYmeLkquTiEq','mxjLBKnRCW','ChjLqwn0Aw9U','BgfUzW','oxDxCKHZBq','Bg9JywXL','ywrKq29TBwfUza','qtjbie1LBw9YEq','nJy2mdbVt2PyBMy','ifbSDwDPBIbMBW'];_0x2b1c=function(){return _0x2e275e;};return _0x2b1c();}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';function _0x45c7be(_0x4728f1,_0x902d02){return _0x5cce(_0x902d02- -0x3e1,_0x4728f1);}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';const require=createRequire(import.meta.url),pkg=require(_0x45c7be(-0x2ff,-0x2f7)+_0x3b882a(0x478,0x469));try{const config=new ConfigManager()[_0x3b882a(0x465,0x456)]();config[_0x3b882a(0x46f,0x464)]?setLocale(config[_0x45c7be(-0x2df,-0x2e4)]):setLocale(detectLocale());}catch{setLocale(detectLocale());}const program=new Command();program[_0x45c7be(-0x2fa,-0x2f5)](_0x45c7be(-0x2dd,-0x2dc))['descriptio'+'n'](_0x3b882a(0x460,0x466)+_0x45c7be(-0x2de,-0x2e0)+_0x3b882a(0x451,0x44d)+'ode')[_0x3b882a(0x461,0x45a)](pkg[_0x45c7be(-0x2ed,-0x2ee)])['option']('--lang\x20<lo'+_0x3b882a(0x450,0x44e),_0x3b882a(0x441,0x44f)+_0x3b882a(0x45d,0x454))[_0x3b882a(0x446,0x452)](_0x45c7be(-0x2f4,-0x2e7),_0x26a2f9=>{function _0x4d1fb6(_0x3795d8,_0x42fa7f){return _0x45c7be(_0x3795d8,_0x42fa7f-0x2f3);}const _0x1d0daa={'fMBiw':function(_0x4a1bb9,_0xe3e244){return _0x4a1bb9===_0xe3e244;},'OXpcm':function(_0x16dd76,_0x5c0631){return _0x16dd76(_0x5c0631);}},_0x2b7418=_0x26a2f9['opts']()[_0x4d1fb6(0x18,0xd)];function _0x329838(_0x36e822,_0x357b56){return _0x45c7be(_0x357b56,_0x36e822-0x11a);}(_0x1d0daa[_0x329838(-0x1de,-0x1eb)](_0x2b7418,'en')||_0x1d0daa['fMBiw'](_0x2b7418,'ko'))&&_0x1d0daa[_0x329838(-0x1d5,-0x1ca)](setLocale,_0x2b7418);}),program[_0x3b882a(0x45b,0x465)](setupCommand()),program[_0x45c7be(-0x2e4,-0x2e3)](statusCommand());function _0x3b882a(_0x173384,_0x2a5854){return _0x5cce(_0x2a5854-0x367,_0x173384);}program[_0x45c7be(-0x2ee,-0x2e3)](searchCommand()),program['addCommand'](listCommand()),program[_0x45c7be(-0x2ed,-0x2e3)](extractCommand()),program[_0x3b882a(0x462,0x465)](configCommand()),program['addCommand'](syncCommand()),program[_0x3b882a(0x45c,0x465)](teamCommand()),program[_0x3b882a(0x45e,0x465)](addCommand()),program[_0x3b882a(0x467,0x465)](editCommand()),program[_0x45c7be(-0x2e7,-0x2e3)](rmCommand()),program['addCommand'](cleanupCommand()),program[_0x45c7be(-0x2ea,-0x2e3)](embedCommand()),program[_0x45c7be(-0x2d4,-0x2e3)](healthCommand()),program['addCommand'](claudeSyncCommand()),program[_0x3b882a(0x469,0x465)](skillCommand()),program[_0x45c7be(-0x2e3,-0x2e3)](proficiencyCommand()),program[_0x3b882a(0x45d,0x465)](migrateChunksCommand()),program[_0x45c7be(-0x2d5,-0x2e3)](migrateFileRefsCommand()),program[_0x3b882a(0x44b,0x455)]();
|