@ectplsm/relic 0.3.2 → 0.5.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/LICENCE.md +1 -1
- package/README.md +20 -13
- package/dist/adapters/mikoshi/client.d.ts +21 -0
- package/dist/adapters/mikoshi/client.js +84 -0
- package/dist/core/ports/index.d.ts +1 -0
- package/dist/core/ports/mikoshi.d.ts +937 -0
- package/dist/core/ports/mikoshi.js +209 -0
- package/dist/core/sync/crypto.d.ts +55 -0
- package/dist/core/sync/crypto.js +189 -0
- package/dist/core/sync/memory-hash.d.ts +35 -0
- package/dist/core/sync/memory-hash.js +61 -0
- package/dist/core/sync/memory-merge.d.ts +13 -0
- package/dist/core/sync/memory-merge.js +84 -0
- package/dist/core/sync/normalize.d.ts +10 -0
- package/dist/core/sync/normalize.js +21 -0
- package/dist/core/sync/persona-hash.d.ts +15 -0
- package/dist/core/sync/persona-hash.js +36 -0
- package/dist/core/usecases/archive-cursor-update.d.ts +6 -0
- package/dist/core/usecases/archive-cursor-update.js +18 -0
- package/dist/core/usecases/archive-pending.d.ts +18 -1
- package/dist/core/usecases/archive-pending.js +37 -2
- package/dist/core/usecases/claw-pull.d.ts +44 -0
- package/dist/core/usecases/claw-pull.js +117 -0
- package/dist/core/usecases/extract.d.ts +0 -1
- package/dist/core/usecases/extract.js +13 -27
- package/dist/core/usecases/index.d.ts +11 -3
- package/dist/core/usecases/index.js +10 -2
- package/dist/core/usecases/inject.d.ts +1 -0
- package/dist/core/usecases/inject.js +2 -0
- package/dist/core/usecases/memory-write.d.ts +5 -0
- package/dist/core/usecases/memory-write.js +26 -16
- package/dist/core/usecases/mikoshi-clone.d.ts +29 -0
- package/dist/core/usecases/mikoshi-clone.js +94 -0
- package/dist/core/usecases/mikoshi-download.d.ts +29 -0
- package/dist/core/usecases/mikoshi-download.js +94 -0
- package/dist/core/usecases/mikoshi-memory-pull.d.ts +38 -0
- package/dist/core/usecases/mikoshi-memory-pull.js +142 -0
- package/dist/core/usecases/mikoshi-memory-push.d.ts +34 -0
- package/dist/core/usecases/mikoshi-memory-push.js +105 -0
- package/dist/core/usecases/mikoshi-memory-sync.d.ts +36 -0
- package/dist/core/usecases/mikoshi-memory-sync.js +175 -0
- package/dist/core/usecases/mikoshi-pull.d.ts +44 -0
- package/dist/core/usecases/mikoshi-pull.js +124 -0
- package/dist/core/usecases/mikoshi-push.d.ts +39 -0
- package/dist/core/usecases/mikoshi-push.js +127 -0
- package/dist/core/usecases/mikoshi-status.d.ts +37 -0
- package/dist/core/usecases/mikoshi-status.js +92 -0
- package/dist/core/usecases/sync.d.ts +0 -5
- package/dist/core/usecases/sync.js +23 -61
- package/dist/interfaces/cli/commands/claw.js +134 -85
- package/dist/interfaces/cli/commands/config.js +60 -1
- package/dist/interfaces/cli/commands/create.js +17 -16
- package/dist/interfaces/cli/commands/init.js +11 -10
- package/dist/interfaces/cli/commands/list.js +9 -7
- package/dist/interfaces/cli/commands/migrate.js +8 -7
- package/dist/interfaces/cli/commands/mikoshi.d.ts +2 -0
- package/dist/interfaces/cli/commands/mikoshi.js +565 -0
- package/dist/interfaces/cli/commands/refresh-samples.js +10 -9
- package/dist/interfaces/cli/index.js +2 -0
- package/dist/interfaces/cli/output.d.ts +5 -0
- package/dist/interfaces/cli/output.js +16 -0
- package/dist/interfaces/cli/spinner.d.ts +13 -0
- package/dist/interfaces/cli/spinner.js +47 -0
- package/dist/interfaces/mcp/index.js +109 -38
- package/dist/shared/config.d.ts +25 -5
- package/dist/shared/config.js +33 -5
- package/dist/shared/engram-composer.d.ts +1 -1
- package/dist/shared/engram-composer.js +9 -5
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { Init } from "../../../core/usecases/init.js";
|
|
|
3
3
|
import { setDefaultEngram, loadConfig } from "../../../shared/config.js";
|
|
4
4
|
import { LocalEngramRepository } from "../../../adapters/local/index.js";
|
|
5
5
|
import { printRelicBanner } from "../banner.js";
|
|
6
|
+
import { printBlank, printDetail, printLine } from "../output.js";
|
|
6
7
|
function ask(question) {
|
|
7
8
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
8
9
|
return new Promise((resolve) => {
|
|
@@ -21,21 +22,21 @@ export function registerInitCommand(program) {
|
|
|
21
22
|
const result = await init.execute();
|
|
22
23
|
if (result.created) {
|
|
23
24
|
printRelicBanner();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
printLine("Initialized RELIC:");
|
|
26
|
+
printDetail(`Config: ${result.configPath}`);
|
|
27
|
+
printDetail(`Engrams: ${result.engramsPath}`);
|
|
28
|
+
printBlank();
|
|
28
29
|
// 利用可能なEngramを表示してデフォルト選択を促す
|
|
29
30
|
const cfg = await loadConfig();
|
|
30
31
|
const repo = new LocalEngramRepository(cfg.engramsPath);
|
|
31
32
|
const engrams = await repo.list();
|
|
32
33
|
if (engrams.length > 0) {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
printLine("Available Engrams:");
|
|
35
|
+
printDetail(`${"ID".padEnd(12)} Name`);
|
|
35
36
|
for (const e of engrams) {
|
|
36
|
-
|
|
37
|
+
printDetail(`${e.id.padEnd(12)} ${e.name}`);
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
printBlank();
|
|
39
40
|
const rebel = engrams.find((e) => e.id === "rebel");
|
|
40
41
|
const prompt = rebel
|
|
41
42
|
? `Set a default Engram? (press Enter for "${rebel.id}", or enter ID, or "n" to skip): `
|
|
@@ -61,8 +62,8 @@ export function registerInitCommand(program) {
|
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
else {
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
printLine("Already initialized.");
|
|
66
|
+
printDetail(`Config: ${result.configPath}`);
|
|
66
67
|
}
|
|
67
68
|
});
|
|
68
69
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LocalEngramRepository } from "../../../adapters/local/index.js";
|
|
2
2
|
import { ListEngrams } from "../../../core/usecases/index.js";
|
|
3
|
+
import { printBlank, printDetail, printLine } from "../output.js";
|
|
3
4
|
import { resolveEngramsPath } from "../../../shared/config.js";
|
|
4
5
|
export function registerListCommand(program) {
|
|
5
6
|
program
|
|
@@ -12,19 +13,20 @@ export function registerListCommand(program) {
|
|
|
12
13
|
const listEngrams = new ListEngrams(repo);
|
|
13
14
|
const engrams = await listEngrams.execute();
|
|
14
15
|
if (engrams.length === 0) {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
printLine("No Engrams found.");
|
|
17
|
+
printDetail(`Path: ${engramsPath}`);
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
+
printLine(`Engrams (${engrams.length}):`);
|
|
21
|
+
printBlank();
|
|
20
22
|
for (const e of engrams) {
|
|
21
23
|
const tags = e.tags?.length ? ` [${e.tags.join(", ")}]` : "";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
printLine(e.id);
|
|
25
|
+
printDetail(`${e.name}${tags}`);
|
|
24
26
|
if (e.description) {
|
|
25
|
-
|
|
27
|
+
printDetail(e.description);
|
|
26
28
|
}
|
|
27
|
-
|
|
29
|
+
printBlank();
|
|
28
30
|
}
|
|
29
31
|
});
|
|
30
32
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LocalEngramRepository } from "../../../adapters/local/index.js";
|
|
2
2
|
import { MigrateEngrams } from "../../../core/usecases/index.js";
|
|
3
|
+
import { printDetail, printLine } from "../output.js";
|
|
3
4
|
import { resolveEngramsPath } from "../../../shared/config.js";
|
|
4
5
|
export function registerMigrateCommand(program) {
|
|
5
6
|
const migrate = program
|
|
@@ -14,18 +15,18 @@ export function registerMigrateCommand(program) {
|
|
|
14
15
|
const repo = new LocalEngramRepository(engramsPath);
|
|
15
16
|
const migrateEngrams = new MigrateEngrams(repo, engramsPath);
|
|
16
17
|
const result = await migrateEngrams.execute();
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
printLine(`Scanned Engrams: ${result.migrated.length + result.alreadyUpToDate.length + result.skipped.length}`);
|
|
19
|
+
printDetail(`Migrated: ${result.migrated.length}`);
|
|
20
|
+
printDetail(`Already up to date: ${result.alreadyUpToDate.length}`);
|
|
21
|
+
printDetail(`Skipped: ${result.skipped.length}`);
|
|
21
22
|
if (result.migrated.length > 0) {
|
|
22
|
-
|
|
23
|
+
printDetail(`Migrated IDs: ${result.migrated.join(", ")}`);
|
|
23
24
|
}
|
|
24
25
|
if (result.alreadyUpToDate.length > 0) {
|
|
25
|
-
|
|
26
|
+
printDetail(`Up-to-date IDs: ${result.alreadyUpToDate.join(", ")}`);
|
|
26
27
|
}
|
|
27
28
|
for (const skipped of result.skipped) {
|
|
28
|
-
|
|
29
|
+
printDetail(`Skipped ${skipped.id}: ${skipped.reason}`);
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
}
|