@qlucent/fishi 0.14.2 → 0.14.4

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/dist/index.js +133 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/index.ts
4
4
  import { Command } from "commander";
5
- import chalk14 from "chalk";
5
+ import chalk15 from "chalk";
6
6
 
7
7
  // src/commands/init.ts
8
8
  import chalk from "chalk";
@@ -1193,8 +1193,8 @@ sandbox:
1193
1193
  fs3.appendFileSync(fishiYamlPath2, getDomainConfigYaml(selectedDomain), "utf-8");
1194
1194
  }
1195
1195
  }
1196
- const { getSandboxPolicyTemplate, getDockerfileTemplate } = await import("@qlucent/fishi-core");
1197
- fs3.writeFileSync(path3.join(targetDir, ".fishi", "sandbox-policy.yaml"), getSandboxPolicyTemplate(), "utf-8");
1196
+ const { getSandboxPolicyTemplate: getSandboxPolicyTemplate2, getDockerfileTemplate } = await import("@qlucent/fishi-core");
1197
+ fs3.writeFileSync(path3.join(targetDir, ".fishi", "sandbox-policy.yaml"), getSandboxPolicyTemplate2(), "utf-8");
1198
1198
  if (sandboxMode === "docker") {
1199
1199
  fs3.mkdirSync(path3.join(targetDir, ".fishi", "docker"), { recursive: true });
1200
1200
  fs3.writeFileSync(path3.join(targetDir, ".fishi", "docker", "Dockerfile"), getDockerfileTemplate(), "utf-8");
@@ -2462,11 +2462,138 @@ async function patternsCommand(action, options) {
2462
2462
  }
2463
2463
  }
2464
2464
 
2465
+ // src/commands/upgrade.ts
2466
+ import chalk14 from "chalk";
2467
+ import ora4 from "ora";
2468
+ import path16 from "path";
2469
+ import fs16 from "fs";
2470
+ import {
2471
+ getSettingsJsonTemplate,
2472
+ getSoulMdTemplate,
2473
+ getAgentsMdTemplate,
2474
+ getSandboxPolicyTemplate,
2475
+ getMonitorEmitterScript,
2476
+ getFileLockHookScript
2477
+ } from "@qlucent/fishi-core";
2478
+ var CURRENT_VERSION = "0.14.3";
2479
+ async function upgradeCommand() {
2480
+ const targetDir = process.cwd();
2481
+ console.log("");
2482
+ console.log(chalk14.cyan.bold(" FISHI Upgrade"));
2483
+ console.log(chalk14.gray(` Upgrading project to v${CURRENT_VERSION}`));
2484
+ console.log("");
2485
+ if (!fs16.existsSync(path16.join(targetDir, ".fishi"))) {
2486
+ console.log(chalk14.yellow(" No FISHI project found. Run `fishi init` first."));
2487
+ return;
2488
+ }
2489
+ const spinner = ora4("Upgrading...").start();
2490
+ const updated = [];
2491
+ const created = [];
2492
+ const settingsPath = path16.join(targetDir, ".claude", "settings.json");
2493
+ if (fs16.existsSync(settingsPath)) {
2494
+ try {
2495
+ const existing = JSON.parse(fs16.readFileSync(settingsPath, "utf-8"));
2496
+ let needsFix = false;
2497
+ if (existing.hooks) {
2498
+ for (const [event, entries] of Object.entries(existing.hooks)) {
2499
+ if (Array.isArray(entries)) {
2500
+ for (const entry of entries) {
2501
+ if (entry.command && !entry.hooks) {
2502
+ needsFix = true;
2503
+ break;
2504
+ }
2505
+ }
2506
+ }
2507
+ if (needsFix) break;
2508
+ }
2509
+ }
2510
+ if (needsFix) {
2511
+ const backupDir = path16.join(targetDir, ".fishi", "backup", "upgrade-" + (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").replace(/\.\d+Z$/, ""));
2512
+ fs16.mkdirSync(backupDir, { recursive: true });
2513
+ fs16.copyFileSync(settingsPath, path16.join(backupDir, "settings.json"));
2514
+ fs16.writeFileSync(settingsPath, getSettingsJsonTemplate(), "utf-8");
2515
+ updated.push(".claude/settings.json (hooks format fixed)");
2516
+ }
2517
+ } catch {
2518
+ fs16.writeFileSync(settingsPath, getSettingsJsonTemplate(), "utf-8");
2519
+ updated.push(".claude/settings.json (replaced \u2014 was corrupted)");
2520
+ }
2521
+ }
2522
+ const soulPath = path16.join(targetDir, "SOUL.md");
2523
+ if (!fs16.existsSync(soulPath)) {
2524
+ fs16.writeFileSync(soulPath, getSoulMdTemplate(), "utf-8");
2525
+ created.push("SOUL.md");
2526
+ }
2527
+ const agentsPath = path16.join(targetDir, "AGENTS.md");
2528
+ if (!fs16.existsSync(agentsPath)) {
2529
+ fs16.writeFileSync(agentsPath, getAgentsMdTemplate(), "utf-8");
2530
+ created.push("AGENTS.md");
2531
+ }
2532
+ const policyPath = path16.join(targetDir, ".fishi", "sandbox-policy.yaml");
2533
+ if (!fs16.existsSync(policyPath)) {
2534
+ fs16.writeFileSync(policyPath, getSandboxPolicyTemplate(), "utf-8");
2535
+ created.push(".fishi/sandbox-policy.yaml");
2536
+ }
2537
+ const monitorPath = path16.join(targetDir, ".fishi", "scripts", "monitor-emitter.mjs");
2538
+ if (!fs16.existsSync(monitorPath)) {
2539
+ fs16.writeFileSync(monitorPath, getMonitorEmitterScript(), "utf-8");
2540
+ created.push(".fishi/scripts/monitor-emitter.mjs");
2541
+ }
2542
+ const lockPath = path16.join(targetDir, ".fishi", "scripts", "file-lock-hook.mjs");
2543
+ if (!fs16.existsSync(lockPath)) {
2544
+ fs16.writeFileSync(lockPath, getFileLockHookScript(), "utf-8");
2545
+ created.push(".fishi/scripts/file-lock-hook.mjs");
2546
+ }
2547
+ const monitorJsonPath = path16.join(targetDir, ".fishi", "state", "monitor.json");
2548
+ if (!fs16.existsSync(monitorJsonPath)) {
2549
+ fs16.writeFileSync(monitorJsonPath, JSON.stringify({
2550
+ events: [],
2551
+ summary: { totalAgentCompletions: 0, totalFilesChanged: 0, totalTokens: 0, tokensByModel: {}, tokensByAgent: {}, toolsUsed: {}, dynamicAgentsCreated: 0 },
2552
+ dynamicAgents: [],
2553
+ lastUpdated: (/* @__PURE__ */ new Date()).toISOString()
2554
+ }, null, 2) + "\n", "utf-8");
2555
+ created.push(".fishi/state/monitor.json");
2556
+ }
2557
+ const locksPath = path16.join(targetDir, ".fishi", "state", "file-locks.yaml");
2558
+ if (!fs16.existsSync(locksPath)) {
2559
+ fs16.writeFileSync(locksPath, "locks: []\n", "utf-8");
2560
+ created.push(".fishi/state/file-locks.yaml");
2561
+ }
2562
+ const archivePath = path16.join(targetDir, ".fishi", "archive");
2563
+ if (!fs16.existsSync(archivePath)) {
2564
+ fs16.mkdirSync(archivePath, { recursive: true });
2565
+ created.push(".fishi/archive/");
2566
+ }
2567
+ const researchPath = path16.join(targetDir, ".fishi", "research");
2568
+ if (!fs16.existsSync(researchPath)) {
2569
+ fs16.mkdirSync(researchPath, { recursive: true });
2570
+ created.push(".fishi/research/");
2571
+ }
2572
+ spinner.succeed("Upgrade complete");
2573
+ console.log("");
2574
+ if (updated.length > 0) {
2575
+ console.log(chalk14.white.bold(" Updated:"));
2576
+ for (const u of updated) console.log(chalk14.green(` ${u}`));
2577
+ console.log("");
2578
+ }
2579
+ if (created.length > 0) {
2580
+ console.log(chalk14.white.bold(" Created (new in v0.14):"));
2581
+ for (const c of created) console.log(chalk14.cyan(` ${c}`));
2582
+ console.log("");
2583
+ }
2584
+ if (updated.length === 0 && created.length === 0) {
2585
+ console.log(chalk14.green(" Already up to date!"));
2586
+ console.log("");
2587
+ }
2588
+ console.log(chalk14.gray(` Project upgraded to FISHI v${CURRENT_VERSION}`));
2589
+ console.log("");
2590
+ }
2591
+
2465
2592
  // src/index.ts
2466
2593
  var program = new Command();
2467
2594
  program.name("fishi").description(
2468
- chalk14.cyan("\u{1F41F} FISHI") + " \u2014 AI-Powered Software Delivery Pipeline\n Autonomous AI development with human governance"
2469
- ).version("0.14.2");
2595
+ chalk15.cyan("\u{1F41F} FISHI") + " \u2014 AI-Powered Software Delivery Pipeline\n Autonomous AI development with human governance"
2596
+ ).version("0.14.3");
2470
2597
  program.command("init").description("Initialize FISHI in the current directory").argument("[description]", "Project description (skip wizard with zero-config)").option("-l, --language <lang>", "Primary language (e.g., typescript, python)").option("-f, --framework <framework>", "Framework (e.g., nextjs, express, django)").option(
2471
2598
  "-c, --cost-mode <mode>",
2472
2599
  "Cost mode: performance | balanced | economy",
@@ -2484,4 +2611,5 @@ program.command("preview").description("Start live preview dev server").option("
2484
2611
  program.command("design").description("Design system \u2014 detect tokens, init design system, validate with Brand Guardian").argument("<action>", "Action: detect | init | validate").option("-o, --output <path>", "Output path for design config").action(designCommand);
2485
2612
  program.command("security").description("Security scanner \u2014 native SAST + OWASP vulnerability detection").argument("<action>", "Action: scan | rules").option("-o, --output <path>", "Save report to file").option("--json", "Output as JSON").action(securityCommand);
2486
2613
  program.command("patterns").description("Pattern marketplace \u2014 browse, search, select integration blueprints").argument("<action>", "Action: list | search | info | select | selected").option("-q, --query <query>", "Search query or pattern ID(s)").option("-c, --category <category>", "Filter by category").option("-o, --output <path>", "Save guide to file").action(patternsCommand);
2614
+ program.command("upgrade").description("Upgrade existing FISHI project to the latest version").action(upgradeCommand);
2487
2615
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qlucent/fishi",
3
- "version": "0.14.2",
3
+ "version": "0.14.4",
4
4
  "description": "FISHI — Your AI Dev Team That Actually Ships. Autonomous agent framework for Claude Code.",
5
5
  "license": "MIT",
6
6
  "type": "module",