hissuno 0.2.0 → 0.2.2
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/dist/index.js +73 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { Command as
|
|
2
|
+
import { Command as Command14 } from "commander";
|
|
3
3
|
|
|
4
4
|
// src/commands/types.ts
|
|
5
5
|
import { Command } from "commander";
|
|
@@ -2109,13 +2109,13 @@ async function setupDatabase(appDir, opts) {
|
|
|
2109
2109
|
);
|
|
2110
2110
|
}
|
|
2111
2111
|
log.success("pgvector enabled");
|
|
2112
|
-
log.info("
|
|
2112
|
+
log.info("Applying database migrations...");
|
|
2113
2113
|
const drizzleKit = path3.join(appDir, "node_modules", ".bin", "drizzle-kit");
|
|
2114
|
-
await execStream(drizzleKit, ["
|
|
2114
|
+
await execStream(drizzleKit, ["migrate"], {
|
|
2115
2115
|
cwd: appDir,
|
|
2116
2116
|
env: { DATABASE_URL: databaseUrl }
|
|
2117
2117
|
});
|
|
2118
|
-
log.success("Database
|
|
2118
|
+
log.success("Database migrations applied");
|
|
2119
2119
|
}
|
|
2120
2120
|
function extractDbName(url) {
|
|
2121
2121
|
const parsed = new URL(url);
|
|
@@ -2718,10 +2718,19 @@ function getJson2(cmd) {
|
|
|
2718
2718
|
}
|
|
2719
2719
|
function getBundledSkillsPath() {
|
|
2720
2720
|
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
2721
|
-
const
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2721
|
+
const candidates = [
|
|
2722
|
+
join2(thisDir, "skills"),
|
|
2723
|
+
// tsup bundle: packageRoot/skills
|
|
2724
|
+
join2(thisDir, "..", "skills"),
|
|
2725
|
+
// if thisDir is dist/
|
|
2726
|
+
join2(thisDir, "..", "..", "skills"),
|
|
2727
|
+
// legacy nested structure
|
|
2728
|
+
join2(thisDir, "..", "..", "..", "skills", "hissuno")
|
|
2729
|
+
// dev: src/commands/
|
|
2730
|
+
];
|
|
2731
|
+
for (const candidate of candidates) {
|
|
2732
|
+
if (existsSync2(join2(candidate, "SKILL.md"))) return candidate;
|
|
2733
|
+
}
|
|
2725
2734
|
throw new Error("Bundled skills not found. Package may be corrupted.");
|
|
2726
2735
|
}
|
|
2727
2736
|
function countFiles(dir) {
|
|
@@ -2904,8 +2913,62 @@ var statusCommand = new Command12("status").description("Check connection health
|
|
|
2904
2913
|
}
|
|
2905
2914
|
});
|
|
2906
2915
|
|
|
2916
|
+
// src/commands/members.ts
|
|
2917
|
+
import { Command as Command13 } from "commander";
|
|
2918
|
+
function roleBadge(role) {
|
|
2919
|
+
return role === "owner" ? `${CYAN}${role}${RESET}` : `${DIM}${role}${RESET}`;
|
|
2920
|
+
}
|
|
2921
|
+
function statusBadge(status) {
|
|
2922
|
+
return status === "active" ? `${GREEN}${status}${RESET}` : `${YELLOW}${status}${RESET}`;
|
|
2923
|
+
}
|
|
2924
|
+
var membersCommand = new Command13("members").description("List project members").action(async (_, cmd) => {
|
|
2925
|
+
const config = requireConfig();
|
|
2926
|
+
const jsonMode = cmd.parent?.opts().json;
|
|
2927
|
+
const projectId = await resolveProjectId(config);
|
|
2928
|
+
const path7 = buildPath("/api/members", { projectId });
|
|
2929
|
+
const result = await apiCall(config, "GET", path7);
|
|
2930
|
+
if (!result.ok) {
|
|
2931
|
+
if (jsonMode) {
|
|
2932
|
+
console.log(renderJson({ error: `HTTP ${result.status}` }));
|
|
2933
|
+
} else {
|
|
2934
|
+
error(`Failed to list members (HTTP ${result.status}).`);
|
|
2935
|
+
}
|
|
2936
|
+
process.exit(1);
|
|
2937
|
+
}
|
|
2938
|
+
const members = result.data?.members ?? [];
|
|
2939
|
+
if (jsonMode) {
|
|
2940
|
+
console.log(renderJson(members));
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
console.log(`
|
|
2944
|
+
${BOLD}${CYAN}Project Members (${members.length})${RESET}
|
|
2945
|
+
`);
|
|
2946
|
+
if (members.length === 0) {
|
|
2947
|
+
console.log(` ${DIM}No members found.${RESET}
|
|
2948
|
+
`);
|
|
2949
|
+
return;
|
|
2950
|
+
}
|
|
2951
|
+
const nameWidth = 24;
|
|
2952
|
+
const emailWidth = 28;
|
|
2953
|
+
const roleWidth = 10;
|
|
2954
|
+
const statusWidth = 10;
|
|
2955
|
+
console.log(
|
|
2956
|
+
` ${DIM}${"NAME".padEnd(nameWidth)}${"EMAIL".padEnd(emailWidth)}${"ROLE".padEnd(roleWidth)}${"STATUS".padEnd(statusWidth)}ADDED${RESET}`
|
|
2957
|
+
);
|
|
2958
|
+
console.log(` ${DIM}${"-".repeat(nameWidth + emailWidth + roleWidth + statusWidth + 12)}${RESET}`);
|
|
2959
|
+
for (const m of members) {
|
|
2960
|
+
const name = (m.user_profile?.full_name || m.invited_email || "Unknown").slice(0, nameWidth - 2);
|
|
2961
|
+
const email = (m.user_profile?.email || m.invited_email || "").slice(0, emailWidth - 2);
|
|
2962
|
+
const date = new Date(m.created_at).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
2963
|
+
console.log(
|
|
2964
|
+
` ${BOLD}${name.padEnd(nameWidth)}${RESET}${email.padEnd(emailWidth)}${roleBadge(m.role.padEnd(roleWidth))}${statusBadge(m.status.padEnd(statusWidth))}${DIM}${date}${RESET}`
|
|
2965
|
+
);
|
|
2966
|
+
}
|
|
2967
|
+
console.log();
|
|
2968
|
+
});
|
|
2969
|
+
|
|
2907
2970
|
// src/index.ts
|
|
2908
|
-
var program = new
|
|
2971
|
+
var program = new Command14().name("hissuno").description("Hissuno CLI - set up, configure, and query your product intelligence data").version("0.2.0").option("--json", "Output as JSON");
|
|
2909
2972
|
program.addCommand(setupCommand);
|
|
2910
2973
|
program.addCommand(configCommand);
|
|
2911
2974
|
program.addCommand(profileCommand);
|
|
@@ -2918,4 +2981,5 @@ program.addCommand(searchCommand);
|
|
|
2918
2981
|
program.addCommand(addCommand);
|
|
2919
2982
|
program.addCommand(updateCommand);
|
|
2920
2983
|
program.addCommand(integrateCommand);
|
|
2984
|
+
program.addCommand(membersCommand);
|
|
2921
2985
|
program.parseAsync(process.argv);
|