@hasna/hooks 0.7.8 → 0.7.9

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.
Files changed (2) hide show
  1. package/bin/index.js +23 -0
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -13164,6 +13164,29 @@ Cloudflare provisioning complete:
13164
13164
  console.log(chalk2.dim(" wrangler.toml, fill in the D1 database id, then run the commands above."));
13165
13165
  console.log();
13166
13166
  });
13167
+ program2.command("migrate").description("Apply PostgreSQL migrations to the storage database (HASNA_HOOKS_DATABASE_URL)").option("-j, --json", "Output as JSON", false).action(async (options) => {
13168
+ try {
13169
+ const { getStoragePg: getStoragePg2, runStorageMigrations: runStorageMigrations2 } = await Promise.resolve().then(() => (init_storage(), exports_storage));
13170
+ const remote = await getStoragePg2();
13171
+ try {
13172
+ await runStorageMigrations2(remote);
13173
+ } finally {
13174
+ await remote.close();
13175
+ }
13176
+ if (options.json) {
13177
+ console.log(JSON.stringify({ ok: true }));
13178
+ return;
13179
+ }
13180
+ console.log(chalk2.green("\u2713 PostgreSQL migrations applied"));
13181
+ } catch (error) {
13182
+ const message = error instanceof Error ? error.message : String(error);
13183
+ if (options.json)
13184
+ console.log(JSON.stringify({ error: message }));
13185
+ else
13186
+ console.error(chalk2.red(`\u2717 ${message}`));
13187
+ process.exitCode = 1;
13188
+ }
13189
+ });
13167
13190
  program2.command("mcp").option("-s, --stdio", "Use stdio transport (one process per agent)", false).option("--sse", "Use legacy SSE transport (port 39427)", false).option("--http", "Use Streamable HTTP transport (explicit; this is also the default)", false).option("-p, --port <port>", "Port for HTTP/SSE transport (defaults to 8847 for HTTP, 39427 for SSE)").description("Start MCP server for AI agent integration (default: shared Streamable HTTP)").action(async (options) => {
13168
13191
  if (options.stdio) {
13169
13192
  const { startStdioServer: startStdioServer2 } = await Promise.resolve().then(() => (init_server(), exports_server));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/hooks",
3
- "version": "0.7.8",
3
+ "version": "0.7.9",
4
4
  "description": "Open source hooks library for AI coding agents - Install safety, quality, and automation hooks with a single command",
5
5
  "type": "module",
6
6
  "bin": {