@aman_asmuei/aman 0.3.1 → 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/README.md +10 -0
- package/dist/index.js +196 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,16 @@ Identity + Memory + Tools + Workflows + Guardrails + Skills + Evaluation — set
|
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
+
<div align="center">
|
|
24
|
+
|
|
25
|
+
<img src="assets/aman-ecosystem-overview.jpeg" alt="Aman Ecosystem Overview — from v0.7.7 to Full AI Companion Platform" width="100%">
|
|
26
|
+
|
|
27
|
+
*18+ releases across 5 packages. From a CLI tool to a deployable, browser-accessible, multi-agent AI companion ecosystem.*
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
23
33
|
## One Command
|
|
24
34
|
|
|
25
35
|
```bash
|
package/dist/index.js
CHANGED
|
@@ -32,8 +32,8 @@ function detectPlatform(cwd) {
|
|
|
32
32
|
const raw = fs.readFileSync(configPath, "utf-8");
|
|
33
33
|
const parsed = JSON.parse(raw);
|
|
34
34
|
if (typeof parsed.platform === "string") {
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
35
|
+
const p6 = parsed.platform;
|
|
36
|
+
if (p6 === "claude-code" || p6 === "cursor" || p6 === "windsurf") return p6;
|
|
37
37
|
}
|
|
38
38
|
} catch {
|
|
39
39
|
}
|
|
@@ -836,9 +836,198 @@ function copyDeployFile(pkgDir, destDir, filename) {
|
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
|
|
839
|
+
// src/commands/showcase.ts
|
|
840
|
+
import * as p4 from "@clack/prompts";
|
|
841
|
+
import pc4 from "picocolors";
|
|
842
|
+
import { spawnSync } from "child_process";
|
|
843
|
+
var SHOWCASE_PACKAGE = "@aman_asmuei/aman-showcase";
|
|
844
|
+
var CATEGORIES = {
|
|
845
|
+
health: "Health",
|
|
846
|
+
business: "Business",
|
|
847
|
+
learning: "Learning",
|
|
848
|
+
lifestyle: "Lifestyle",
|
|
849
|
+
monitoring: "Monitoring"
|
|
850
|
+
};
|
|
851
|
+
var EMBEDDED_MANIFEST = [
|
|
852
|
+
{ name: "rutin", title: "Rutin \u2014 Medication Reminder", description: "Daily medication reminders for elderly parents and family.", category: "health", language: "ms", channels: ["telegram"] },
|
|
853
|
+
{ name: "kedai", title: "Kedai \u2014 Small Business Assistant", description: "Transaction tracking for restaurants, salons, and laundries.", category: "business", language: "en+ms", channels: ["telegram"] },
|
|
854
|
+
{ name: "monitor", title: "Monitor \u2014 AI Watchdog", description: "Price and website monitoring with real-time alerts.", category: "monitoring", language: "en", channels: ["telegram", "discord"] },
|
|
855
|
+
{ name: "bahasa", title: "Bahasa \u2014 Language Tutor", description: "Malay/English language learning with structured curriculum.", category: "learning", language: "en+ms", channels: ["telegram"] },
|
|
856
|
+
{ name: "quran", title: "Quran \u2014 Arabic Vocabulary", description: "Quranic Arabic lessons with 12 structured vocabulary units.", category: "learning", language: "en+ms", channels: ["telegram"] },
|
|
857
|
+
{ name: "fitness", title: "Fitness \u2014 Personal Trainer", description: "Workout tracking with progressive overload and form guidance.", category: "health", language: "en", channels: ["telegram"] },
|
|
858
|
+
{ name: "freelancer", title: "Freelancer \u2014 Business Tracker", description: "Invoice and client tracking for independent workers.", category: "business", language: "en", channels: ["telegram"] },
|
|
859
|
+
{ name: "team", title: "Team \u2014 Collaboration Assistant", description: "Standups, task tracking, and team memory.", category: "business", language: "en", channels: ["telegram", "discord"] },
|
|
860
|
+
{ name: "money", title: "Money \u2014 Finance Tracker", description: "Personal finance and budget monitoring.", category: "lifestyle", language: "en", channels: ["telegram"] },
|
|
861
|
+
{ name: "feed", title: "Feed \u2014 News Companion", description: "Personalized news aggregation and daily digests.", category: "lifestyle", language: "en", channels: ["telegram"] },
|
|
862
|
+
{ name: "support", title: "Support \u2014 Customer Assistant", description: "Customer support with context memory and escalation.", category: "business", language: "en", channels: ["telegram", "webhook"] },
|
|
863
|
+
{ name: "iot", title: "IoT \u2014 Smart Monitor", description: "Sensor monitoring with anomaly detection and threshold alerts.", category: "monitoring", language: "en", channels: ["telegram"] },
|
|
864
|
+
{ name: "muslim", title: "Muslim \u2014 Daily Companion", description: "Islamic companion with prayer times, hadith, and du'a.", category: "lifestyle", language: "en+ms", channels: ["telegram"] }
|
|
865
|
+
];
|
|
866
|
+
function fetchManifest() {
|
|
867
|
+
const result = spawnSync(
|
|
868
|
+
"npx",
|
|
869
|
+
["-y", SHOWCASE_PACKAGE, "list-json"],
|
|
870
|
+
{ encoding: "utf8", timeout: 3e4 }
|
|
871
|
+
);
|
|
872
|
+
if (result.status !== 0 || !result.stdout.trim()) {
|
|
873
|
+
return EMBEDDED_MANIFEST;
|
|
874
|
+
}
|
|
875
|
+
try {
|
|
876
|
+
return JSON.parse(result.stdout);
|
|
877
|
+
} catch {
|
|
878
|
+
return EMBEDDED_MANIFEST;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
async function showcaseCommand(nameArg, opts = {}) {
|
|
882
|
+
p4.intro(pc4.bold("aman showcase") + " \u2014 try any AI companion in one command");
|
|
883
|
+
const manifest = fetchManifest();
|
|
884
|
+
if (opts.list) {
|
|
885
|
+
console.log("\nAvailable showcases:\n");
|
|
886
|
+
const byCategory = manifest.reduce((acc, s) => {
|
|
887
|
+
(acc[s.category] ??= []).push(s);
|
|
888
|
+
return acc;
|
|
889
|
+
}, {});
|
|
890
|
+
for (const [cat, entries] of Object.entries(byCategory)) {
|
|
891
|
+
console.log(pc4.bold(CATEGORIES[cat] ?? cat));
|
|
892
|
+
for (const e of entries) {
|
|
893
|
+
console.log(` ${pc4.cyan(e.name.padEnd(14))} ${e.title}`);
|
|
894
|
+
}
|
|
895
|
+
console.log();
|
|
896
|
+
}
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
let name = nameArg;
|
|
900
|
+
if (!name) {
|
|
901
|
+
const choice = await p4.select({
|
|
902
|
+
message: "Which showcase do you want to try?",
|
|
903
|
+
options: manifest.map((s) => ({
|
|
904
|
+
value: s.name,
|
|
905
|
+
label: s.title,
|
|
906
|
+
hint: s.description
|
|
907
|
+
}))
|
|
908
|
+
});
|
|
909
|
+
if (p4.isCancel(choice)) {
|
|
910
|
+
p4.cancel("Cancelled.");
|
|
911
|
+
process.exit(0);
|
|
912
|
+
}
|
|
913
|
+
name = choice;
|
|
914
|
+
}
|
|
915
|
+
const entry = manifest.find((s) => s.name === name);
|
|
916
|
+
if (!entry) {
|
|
917
|
+
p4.log.error(
|
|
918
|
+
`Unknown showcase: "${name}". Run ${pc4.cyan("aman showcase --list")} to see available options.`
|
|
919
|
+
);
|
|
920
|
+
process.exit(1);
|
|
921
|
+
}
|
|
922
|
+
if (opts.dryRun) {
|
|
923
|
+
p4.log.info(`Dry run for ${pc4.bold(entry.title)}`);
|
|
924
|
+
spawnSync("npx", ["-y", SHOWCASE_PACKAGE, "install", name, "--dry-run"], {
|
|
925
|
+
encoding: "utf8",
|
|
926
|
+
stdio: "inherit",
|
|
927
|
+
timeout: 3e4
|
|
928
|
+
});
|
|
929
|
+
return;
|
|
930
|
+
}
|
|
931
|
+
const confirmed = await p4.confirm({
|
|
932
|
+
message: `Install ${pc4.bold(entry.title)}? Existing ~/.acore, ~/.aflow, ~/.arules, ~/.askill files will be backed up.`,
|
|
933
|
+
initialValue: true
|
|
934
|
+
});
|
|
935
|
+
if (p4.isCancel(confirmed) || !confirmed) {
|
|
936
|
+
p4.cancel("Cancelled.");
|
|
937
|
+
process.exit(0);
|
|
938
|
+
}
|
|
939
|
+
const spinner2 = p4.spinner();
|
|
940
|
+
spinner2.start("Installing showcase files...");
|
|
941
|
+
const result = spawnSync("npx", ["-y", SHOWCASE_PACKAGE, "install", name], {
|
|
942
|
+
encoding: "utf8",
|
|
943
|
+
timeout: 6e4
|
|
944
|
+
});
|
|
945
|
+
if (result.status !== 0) {
|
|
946
|
+
spinner2.stop("Installation failed.");
|
|
947
|
+
p4.log.error(result.stderr || "Unknown error");
|
|
948
|
+
process.exit(1);
|
|
949
|
+
}
|
|
950
|
+
spinner2.stop("Showcase installed!");
|
|
951
|
+
p4.note(
|
|
952
|
+
[
|
|
953
|
+
`1. Copy ${pc4.cyan(".env.example")} to ${pc4.cyan(".env")}`,
|
|
954
|
+
`2. Fill in your ${pc4.yellow("ANTHROPIC_API_KEY")} and ${pc4.yellow("TELEGRAM_BOT_TOKEN")}`,
|
|
955
|
+
`3. Run: ${pc4.green("npx @aman_asmuei/achannel serve")}`
|
|
956
|
+
].join("\n"),
|
|
957
|
+
"Next steps"
|
|
958
|
+
);
|
|
959
|
+
p4.outro(`${pc4.green("\u2713")} ${entry.title} is ready!`);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
// src/commands/here.ts
|
|
963
|
+
import * as p5 from "@clack/prompts";
|
|
964
|
+
import pc5 from "picocolors";
|
|
965
|
+
import fs7 from "fs";
|
|
966
|
+
import path5 from "path";
|
|
967
|
+
async function hereCommand(opts = {}) {
|
|
968
|
+
const cwd = process.cwd();
|
|
969
|
+
const acoreDir = path5.join(cwd, ".acore");
|
|
970
|
+
const contextPath = path5.join(acoreDir, "context.md");
|
|
971
|
+
const configPath = path5.join(acoreDir, "config.json");
|
|
972
|
+
if (fs7.existsSync(contextPath) && !opts.force) {
|
|
973
|
+
p5.intro(pc5.bold("aman here") + " \u2014 project context card");
|
|
974
|
+
const overwrite = await p5.confirm({
|
|
975
|
+
message: `${pc5.dim(".acore/context.md")} already exists. Overwrite?`,
|
|
976
|
+
initialValue: false
|
|
977
|
+
});
|
|
978
|
+
if (p5.isCancel(overwrite) || overwrite === false) {
|
|
979
|
+
p5.outro(pc5.yellow("Skipped. Use --force to overwrite without prompt."));
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
const stack = detectStack() || "unknown";
|
|
984
|
+
const platform = detectPlatform();
|
|
985
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
986
|
+
fs7.mkdirSync(acoreDir, { recursive: true });
|
|
987
|
+
const contextContent = `## Work
|
|
988
|
+
- Stack: ${stack}
|
|
989
|
+
- Domain:
|
|
990
|
+
- Focus:
|
|
991
|
+
|
|
992
|
+
## Session
|
|
993
|
+
- Last updated: ${today}
|
|
994
|
+
- Resume: [starting fresh]
|
|
995
|
+
- Active topics: []
|
|
996
|
+
- Recent decisions: []
|
|
997
|
+
- Temp notes: []
|
|
998
|
+
|
|
999
|
+
## Project Patterns
|
|
1000
|
+
- [observations specific to this project \u2014 built over time]
|
|
1001
|
+
`;
|
|
1002
|
+
fs7.writeFileSync(contextPath, contextContent, "utf-8");
|
|
1003
|
+
if (fs7.existsSync(configPath)) {
|
|
1004
|
+
try {
|
|
1005
|
+
const existing = JSON.parse(fs7.readFileSync(configPath, "utf-8"));
|
|
1006
|
+
if (typeof existing.platform !== "string" || existing.platform === "") {
|
|
1007
|
+
existing.platform = platform || "other";
|
|
1008
|
+
fs7.writeFileSync(configPath, JSON.stringify(existing, null, 2) + "\n", "utf-8");
|
|
1009
|
+
}
|
|
1010
|
+
} catch {
|
|
1011
|
+
const fresh = { platform: platform || "other" };
|
|
1012
|
+
fs7.writeFileSync(configPath, JSON.stringify(fresh, null, 2) + "\n", "utf-8");
|
|
1013
|
+
}
|
|
1014
|
+
} else {
|
|
1015
|
+
const fresh = { platform: platform || "other" };
|
|
1016
|
+
fs7.writeFileSync(configPath, JSON.stringify(fresh, null, 2) + "\n", "utf-8");
|
|
1017
|
+
}
|
|
1018
|
+
if (opts.force) {
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
p5.intro(pc5.bold("aman here") + " \u2014 project context card");
|
|
1022
|
+
p5.log.success(`Wrote ${pc5.dim(".acore/context.md")} (stack: ${stack})`);
|
|
1023
|
+
p5.log.info("Edit it as you work. It is read by aman-claude-code on every session start,");
|
|
1024
|
+
p5.log.info(`and embedded into copilot-instructions.md when you run ${pc5.bold("aman-copilot init")}.`);
|
|
1025
|
+
p5.outro(pc5.green("Done."));
|
|
1026
|
+
}
|
|
1027
|
+
|
|
839
1028
|
// src/index.ts
|
|
840
1029
|
var program = new Command();
|
|
841
|
-
program.name("aman").description("Your complete AI companion \u2014 identity, memory, and tools in one command").version("0.
|
|
1030
|
+
program.name("aman").description("Your complete AI companion \u2014 identity, memory, and tools in one command").version("0.5.0").action(() => {
|
|
842
1031
|
const ecosystem = detectEcosystem();
|
|
843
1032
|
if (ecosystem.acore.installed) {
|
|
844
1033
|
statusCommand();
|
|
@@ -849,4 +1038,8 @@ program.name("aman").description("Your complete AI companion \u2014 identity, me
|
|
|
849
1038
|
program.command("setup").description("Set up your AI companion (identity + memory + tools)").action(() => setupCommand());
|
|
850
1039
|
program.command("status").description("View your full ecosystem status").action(() => statusCommand());
|
|
851
1040
|
program.command("deploy").description("Deploy your AI companion (Docker, systemd, or cloud)").action(() => deployCommand());
|
|
1041
|
+
program.command("showcase [name]").description("Set up a showcase AI companion (rutin, kedai, monitor, ...)").option("--dry-run", "preview files without installing").option("--list", "list all available showcases").action(
|
|
1042
|
+
(name, opts) => showcaseCommand(name, opts)
|
|
1043
|
+
);
|
|
1044
|
+
program.command("here").description("Write a project context card (.acore/context.md) for the current directory").option("--force", "overwrite existing card without prompt").action((opts) => hereCommand(opts));
|
|
852
1045
|
program.parse();
|