prjct-cli 1.6.6 → 1.6.8

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 (62) hide show
  1. package/CHANGELOG.md +85 -5
  2. package/assets/statusline/default-config.json +1 -1
  3. package/core/agentic/chain-of-thought.ts +3 -1
  4. package/core/agentic/ground-truth.ts +12 -5
  5. package/core/agentic/index.ts +14 -2
  6. package/core/agentic/memory-system.ts +86 -23
  7. package/core/agentic/services.ts +1 -1
  8. package/core/agentic/template-executor.ts +4 -4
  9. package/core/agentic/template-loader.ts +2 -8
  10. package/core/bus/bus.ts +0 -1
  11. package/core/bus/index.ts +1 -1
  12. package/core/cli/start.ts +0 -2
  13. package/core/commands/base.ts +2 -2
  14. package/core/commands/planning.ts +1 -1
  15. package/core/constants/index.ts +19 -0
  16. package/core/context/generator.ts +0 -2
  17. package/core/context-tools/files-tool.ts +0 -6
  18. package/core/context-tools/imports-tool.ts +0 -6
  19. package/core/context-tools/recent-tool.ts +0 -6
  20. package/core/context-tools/signatures-tool.ts +0 -6
  21. package/core/context-tools/summary-tool.ts +0 -6
  22. package/core/context-tools/token-counter.ts +0 -13
  23. package/core/infrastructure/agent-detector.ts +0 -13
  24. package/core/infrastructure/ai-provider.ts +0 -29
  25. package/core/infrastructure/author-detector.ts +0 -14
  26. package/core/infrastructure/config-manager.ts +1 -1
  27. package/core/infrastructure/setup.ts +0 -3
  28. package/core/plugin/hooks.ts +0 -2
  29. package/core/plugin/index.ts +0 -13
  30. package/core/plugin/loader.ts +0 -2
  31. package/core/plugin/registry.ts +0 -2
  32. package/core/server/routes-extended.ts +63 -44
  33. package/core/services/agent-service.ts +1 -1
  34. package/core/services/context-generator.ts +1 -1
  35. package/core/services/diff-generator.ts +0 -12
  36. package/core/services/hooks-service.ts +0 -1
  37. package/core/services/memory-service.ts +1 -1
  38. package/core/services/project-service.ts +1 -1
  39. package/core/services/sync-service.ts +44 -30
  40. package/core/services/watch-service.ts +1 -1
  41. package/core/storage/index.ts +1 -1
  42. package/core/storage/storage.ts +0 -2
  43. package/core/types/server.ts +2 -3
  44. package/core/types/storage.ts +121 -0
  45. package/core/utils/animations.ts +0 -18
  46. package/core/utils/cache.ts +0 -6
  47. package/core/utils/collection-filters.ts +0 -24
  48. package/core/utils/date-helper.ts +0 -20
  49. package/core/utils/file-helper.ts +0 -26
  50. package/core/utils/help.ts +0 -9
  51. package/core/utils/jsonl-helper.ts +0 -21
  52. package/core/utils/markdown-builder.ts +0 -3
  53. package/core/utils/next-steps.ts +0 -2
  54. package/core/utils/runtime.ts +0 -11
  55. package/core/utils/session-helper.ts +0 -12
  56. package/core/utils/version.ts +0 -12
  57. package/core/workflow/workflow-preferences.ts +4 -13
  58. package/dist/bin/prjct.mjs +256 -320
  59. package/dist/core/infrastructure/command-installer.js +1 -26
  60. package/dist/core/infrastructure/setup.js +1 -28
  61. package/dist/core/utils/version.js +0 -11
  62. package/package.json +1 -1
@@ -75,7 +75,6 @@ __export(ai_provider_exports, {
75
75
  GeminiProvider: () => GeminiProvider,
76
76
  Providers: () => Providers,
77
77
  WindsurfProvider: () => WindsurfProvider,
78
- default: () => ai_provider_default,
79
78
  detectAllProviders: () => detectAllProviders,
80
79
  detectAntigravity: () => detectAntigravity,
81
80
  detectCursorProject: () => detectCursorProject,
@@ -276,7 +275,7 @@ async function selectProvider() {
276
275
  detection
277
276
  };
278
277
  }
279
- var execAsync, ClaudeProvider, GeminiProvider, AntigravityProvider, CursorProvider, WindsurfProvider, Providers, ai_provider_default;
278
+ var execAsync, ClaudeProvider, GeminiProvider, AntigravityProvider, CursorProvider, WindsurfProvider, Providers;
280
279
  var init_ai_provider = __esm({
281
280
  "core/infrastructure/ai-provider.ts"() {
282
281
  "use strict";
@@ -403,30 +402,6 @@ var init_ai_provider = __esm({
403
402
  __name(getCommandsDir, "getCommandsDir");
404
403
  __name(getProjectCommandsPath, "getProjectCommandsPath");
405
404
  __name(selectProvider, "selectProvider");
406
- ai_provider_default = {
407
- Providers,
408
- ClaudeProvider,
409
- GeminiProvider,
410
- CursorProvider,
411
- AntigravityProvider,
412
- WindsurfProvider,
413
- detectProvider,
414
- detectAllProviders,
415
- detectAntigravity,
416
- getActiveProvider,
417
- hasProviderConfig,
418
- getProviderBranding,
419
- getGlobalContextPath,
420
- getGlobalSettingsPath,
421
- getSkillsPath,
422
- getCommandsDir,
423
- getProjectCommandsPath,
424
- selectProvider,
425
- detectCursorProject,
426
- needsCursorRouterRegeneration,
427
- detectWindsurfProject,
428
- needsWindsurfRouterRegeneration
429
- };
430
405
  }
431
406
  });
432
407
 
@@ -623,6 +598,25 @@ var init_fs = __esm({
623
598
  });
624
599
 
625
600
  // core/utils/date-helper.ts
601
+ var date_helper_exports = {};
602
+ __export(date_helper_exports, {
603
+ calculateDuration: () => calculateDuration,
604
+ formatDate: () => formatDate,
605
+ formatDuration: () => formatDuration,
606
+ formatMonth: () => formatMonth,
607
+ getDateKey: () => getDateKey,
608
+ getDateRange: () => getDateRange,
609
+ getDaysAgo: () => getDaysAgo,
610
+ getDaysFromNow: () => getDaysFromNow,
611
+ getEndOfDay: () => getEndOfDay,
612
+ getStartOfDay: () => getStartOfDay,
613
+ getTimestamp: () => getTimestamp,
614
+ getTodayKey: () => getTodayKey,
615
+ getYearMonthDay: () => getYearMonthDay,
616
+ isToday: () => isToday,
617
+ isWithinLastDays: () => isWithinLastDays,
618
+ parseDate: () => parseDate
619
+ });
626
620
  function formatDate(date) {
627
621
  const year = date.getFullYear();
628
622
  const month = (date.getMonth() + 1).toString().padStart(2, "0");
@@ -709,7 +703,6 @@ function getEndOfDay(date) {
709
703
  result.setHours(23, 59, 59, 999);
710
704
  return result;
711
705
  }
712
- var date_helper_default;
713
706
  var init_date_helper = __esm({
714
707
  "core/utils/date-helper.ts"() {
715
708
  "use strict";
@@ -729,24 +722,6 @@ var init_date_helper = __esm({
729
722
  __name(calculateDuration, "calculateDuration");
730
723
  __name(getStartOfDay, "getStartOfDay");
731
724
  __name(getEndOfDay, "getEndOfDay");
732
- date_helper_default = {
733
- formatDate,
734
- formatMonth,
735
- getTodayKey,
736
- getDateKey,
737
- getYearMonthDay,
738
- parseDate,
739
- getTimestamp,
740
- getDaysAgo,
741
- getDaysFromNow,
742
- getDateRange,
743
- isToday,
744
- isWithinLastDays,
745
- formatDuration,
746
- calculateDuration,
747
- getStartOfDay,
748
- getEndOfDay
749
- };
750
725
  }
751
726
  });
752
727
 
@@ -756,7 +731,6 @@ __export(version_exports, {
756
731
  PACKAGE_ROOT: () => PACKAGE_ROOT,
757
732
  VERSION: () => VERSION,
758
733
  compareVersions: () => compareVersions,
759
- default: () => version_default,
760
734
  getPackageInfo: () => getPackageInfo,
761
735
  getPackageRoot: () => getPackageRoot,
762
736
  getVersion: () => getVersion,
@@ -829,7 +803,7 @@ function needsMigration(fromVersion, toVersion = null) {
829
803
  const target = toVersion || getVersion();
830
804
  return compareVersions(fromVersion, target) < 0;
831
805
  }
832
- var cachedVersion, cachedPackageJson, cachedPackageRoot, VERSION, PACKAGE_ROOT, version_default;
806
+ var cachedVersion, cachedPackageJson, cachedPackageRoot, VERSION, PACKAGE_ROOT;
833
807
  var init_version = __esm({
834
808
  "core/utils/version.ts"() {
835
809
  "use strict";
@@ -845,16 +819,6 @@ var init_version = __esm({
845
819
  __name(needsMigration, "needsMigration");
846
820
  VERSION = getVersion();
847
821
  PACKAGE_ROOT = getPackageRoot();
848
- version_default = {
849
- getVersion,
850
- getPackageRoot,
851
- getPackageInfo,
852
- compareVersions,
853
- isCompatible,
854
- needsMigration,
855
- VERSION,
856
- PACKAGE_ROOT
857
- };
858
822
  }
859
823
  });
860
824
 
@@ -896,56 +860,7 @@ async function detect() {
896
860
  name: name || github || "Unknown"
897
861
  };
898
862
  }
899
- async function detectAuthorForLogs() {
900
- const author = await detect();
901
- return author.github || (author.name !== "Unknown" ? author.name : "unknown");
902
- }
903
- async function isGitHubCLIAvailable() {
904
- const result = await execCommand("gh --version");
905
- return result.success;
906
- }
907
- async function isGitConfigured() {
908
- const [name, email] = await Promise.all([detectGitName(), detectGitEmail()]);
909
- return !!(name && email);
910
- }
911
- async function getConfigStatus() {
912
- const [hasGitHub, hasGit, author] = await Promise.all([
913
- isGitHubCLIAvailable(),
914
- isGitConfigured(),
915
- detect()
916
- ]);
917
- return {
918
- hasGitHub,
919
- hasGit,
920
- author,
921
- isComplete: !!(author.github || author.name !== "Unknown" && author.email),
922
- recommendations: getRecommendations(hasGitHub, hasGit, author)
923
- };
924
- }
925
- function getRecommendations(hasGitHub, hasGit, author) {
926
- const recommendations = [];
927
- if (!hasGitHub && !author.github) {
928
- recommendations.push(
929
- "Install GitHub CLI (gh) for better collaboration support: https://cli.github.com/"
930
- );
931
- }
932
- if (!hasGit) {
933
- recommendations.push('Configure git user: git config --global user.name "Your Name"');
934
- recommendations.push('Configure git email: git config --global user.email "your@email.com"');
935
- }
936
- if (author.github && !author.email) {
937
- recommendations.push("Consider setting your git email for better tracking");
938
- }
939
- return recommendations;
940
- }
941
- function formatAuthor(author) {
942
- const parts = [];
943
- if (author.name && author.name !== "Unknown") parts.push(author.name);
944
- if (author.github) parts.push(`@${author.github}`);
945
- if (author.email) parts.push(`<${author.email}>`);
946
- return parts.join(" ") || "Unknown";
947
- }
948
- var exec2, author_detector_default;
863
+ var exec2;
949
864
  var init_author_detector = __esm({
950
865
  "core/infrastructure/author-detector.ts"() {
951
866
  "use strict";
@@ -955,23 +870,6 @@ var init_author_detector = __esm({
955
870
  __name(detectGitName, "detectGitName");
956
871
  __name(detectGitEmail, "detectGitEmail");
957
872
  __name(detect, "detect");
958
- __name(detectAuthorForLogs, "detectAuthorForLogs");
959
- __name(isGitHubCLIAvailable, "isGitHubCLIAvailable");
960
- __name(isGitConfigured, "isGitConfigured");
961
- __name(getConfigStatus, "getConfigStatus");
962
- __name(getRecommendations, "getRecommendations");
963
- __name(formatAuthor, "formatAuthor");
964
- author_detector_default = {
965
- detect,
966
- detectAuthorForLogs,
967
- detectGitHubUsername,
968
- detectGitName,
969
- detectGitEmail,
970
- isGitHubCLIAvailable,
971
- isGitConfigured,
972
- getConfigStatus,
973
- formatAuthor
974
- };
975
873
  }
976
874
  });
977
875
 
@@ -982,7 +880,6 @@ __export(file_helper_exports, {
982
880
  appendToFile: () => appendToFile,
983
881
  atomicWrite: () => atomicWrite,
984
882
  copyFile: () => copyFile,
985
- default: () => file_helper_default,
986
883
  deleteDir: () => deleteDir,
987
884
  deleteFile: () => deleteFile,
988
885
  dirExists: () => dirExists,
@@ -1158,7 +1055,6 @@ function getFileExtension(filePath) {
1158
1055
  function getFileNameWithoutExtension(filePath) {
1159
1056
  return path3.basename(filePath, path3.extname(filePath));
1160
1057
  }
1161
- var file_helper_default;
1162
1058
  var init_file_helper = __esm({
1163
1059
  "core/utils/file-helper.ts"() {
1164
1060
  "use strict";
@@ -1185,30 +1081,6 @@ var init_file_helper = __esm({
1185
1081
  __name(writeLines, "writeLines");
1186
1082
  __name(getFileExtension, "getFileExtension");
1187
1083
  __name(getFileNameWithoutExtension, "getFileNameWithoutExtension");
1188
- file_helper_default = {
1189
- readJson,
1190
- writeJson,
1191
- readFile,
1192
- writeFile,
1193
- atomicWrite,
1194
- appendToFile,
1195
- appendLine,
1196
- prependToFile,
1197
- fileExists: fileExists2,
1198
- dirExists,
1199
- ensureDir,
1200
- deleteFile,
1201
- deleteDir,
1202
- listFiles,
1203
- getFileSize,
1204
- getFileModifiedTime,
1205
- copyFile,
1206
- moveFile,
1207
- readLines,
1208
- writeLines,
1209
- getFileExtension,
1210
- getFileNameWithoutExtension
1211
- };
1212
1084
  }
1213
1085
  });
1214
1086
 
@@ -1912,7 +1784,7 @@ var init_config_manager = __esm({
1912
1784
  * Get current author for session (detect or get from global config)
1913
1785
  */
1914
1786
  async getCurrentAuthor(projectPath) {
1915
- const author = await author_detector_default.detect();
1787
+ const author = await detect();
1916
1788
  const projectId = await this.getProjectId(projectPath);
1917
1789
  await this.addAuthor(projectId, {
1918
1790
  name: author.name ?? void 0,
@@ -2160,7 +2032,7 @@ function getTimeout(key) {
2160
2032
  }
2161
2033
  return TIMEOUTS[key];
2162
2034
  }
2163
- var PLAN_STATUS, PLAN_REQUIRED_COMMANDS, DESTRUCTIVE_COMMANDS, PLANNING_TOOLS, TIMEOUTS, OUTPUT_LIMITS, STORAGE_LIMITS;
2035
+ var PLAN_STATUS, PLAN_REQUIRED_COMMANDS, DESTRUCTIVE_COMMANDS, PLANNING_TOOLS, TIMEOUTS, OUTPUT_LIMITS, STORAGE_LIMITS, WORKFLOW_HELP;
2164
2036
  var init_constants = __esm({
2165
2037
  "core/constants/index.ts"() {
2166
2038
  "use strict";
@@ -2248,6 +2120,16 @@ var init_constants = __esm({
2248
2120
  /** Warning threshold for large files in MB */
2249
2121
  LARGE_FILE_WARN_MB: 50
2250
2122
  };
2123
+ WORKFLOW_HELP = {
2124
+ /** Message when no workflow preferences are configured */
2125
+ NO_PREFERENCES: "No workflow preferences configured.",
2126
+ /** Example: set a before-ship hook to run tests */
2127
+ SET_EXAMPLE: "p. workflow before ship run the tests",
2128
+ /** Example: modify workflow to run npm test */
2129
+ MODIFY_EXAMPLE: "p. workflow before ship run npm test",
2130
+ /** Example: remove the ship hook */
2131
+ REMOVE_EXAMPLE: "p. workflow remove the ship hook"
2132
+ };
2251
2133
  }
2252
2134
  });
2253
2135
 
@@ -2962,7 +2844,6 @@ var init_session_tracker = __esm({
2962
2844
  // core/cli/start.ts
2963
2845
  var start_exports = {};
2964
2846
  __export(start_exports, {
2965
- default: () => start_default,
2966
2847
  runStart: () => runStart
2967
2848
  });
2968
2849
  import fs10 from "node:fs/promises";
@@ -3206,7 +3087,7 @@ async function runStart() {
3206
3087
  await saveSetupConfig(selectedProviders);
3207
3088
  showCompletion(selectedProviders);
3208
3089
  }
3209
- var G1, G2, G3, G4, G5, BANNER, WELCOME_BOX, start_default;
3090
+ var G1, G2, G3, G4, G5, BANNER, WELCOME_BOX;
3210
3091
  var init_start = __esm({
3211
3092
  "core/cli/start.ts"() {
3212
3093
  "use strict";
@@ -3243,7 +3124,6 @@ ${G1(" \u255A\u2550\u255D ")}${G2(" \u255A\u2550\u255D \u255A\u2550\u255D")
3243
3124
  __name(saveSetupConfig, "saveSetupConfig");
3244
3125
  __name(showCompletion, "showCompletion");
3245
3126
  __name(runStart, "runStart");
3246
- start_default = { runStart };
3247
3127
  }
3248
3128
  });
3249
3129
 
@@ -5862,7 +5742,6 @@ var init_context_tools = __esm({
5862
5742
  // core/services/hooks-service.ts
5863
5743
  var hooks_service_exports = {};
5864
5744
  __export(hooks_service_exports, {
5865
- default: () => hooks_service_default,
5866
5745
  hooksService: () => hooksService
5867
5746
  });
5868
5747
  import fs16 from "node:fs/promises";
@@ -6065,7 +5944,7 @@ async function uninstallDirect(projectPath) {
6065
5944
  }
6066
5945
  return true;
6067
5946
  }
6068
- var HooksService, hooksService, hooks_service_default;
5947
+ var HooksService, hooksService;
6069
5948
  var init_hooks_service = __esm({
6070
5949
  "core/services/hooks-service.ts"() {
6071
5950
  "use strict";
@@ -6345,7 +6224,6 @@ var init_hooks_service = __esm({
6345
6224
  }
6346
6225
  };
6347
6226
  hooksService = new HooksService();
6348
- hooks_service_default = { hooksService };
6349
6227
  }
6350
6228
  });
6351
6229
 
@@ -7539,7 +7417,7 @@ function formatPlan(result) {
7539
7417
  lines.push(`Confidence: ${Math.round(result.confidence * 100)}%`);
7540
7418
  return lines.join("\n");
7541
7419
  }
7542
- var REASONING_REQUIRED_COMMANDS, chain_of_thought_default;
7420
+ var REASONING_REQUIRED_COMMANDS, chainOfThought, chain_of_thought_default;
7543
7421
  var init_chain_of_thought = __esm({
7544
7422
  "core/agentic/chain-of-thought.ts"() {
7545
7423
  "use strict";
@@ -7547,7 +7425,8 @@ var init_chain_of_thought = __esm({
7547
7425
  __name(requiresReasoning, "requiresReasoning");
7548
7426
  __name(reason, "reason");
7549
7427
  __name(formatPlan, "formatPlan");
7550
- chain_of_thought_default = { requiresReasoning, reason, formatPlan };
7428
+ chainOfThought = { requiresReasoning, reason, formatPlan, REASONING_REQUIRED_COMMANDS };
7429
+ chain_of_thought_default = chainOfThought;
7551
7430
  }
7552
7431
  });
7553
7432
 
@@ -8281,7 +8160,7 @@ async function prepareCommand(commandName, context2, state) {
8281
8160
  function requiresVerification(commandName) {
8282
8161
  return ["done", "ship", "feature", "spec", "now", "init", "sync", "analyze"].includes(commandName);
8283
8162
  }
8284
- var execAsync2, verifiers, ground_truth_default;
8163
+ var execAsync2, verifiers, groundTruth, ground_truth_default;
8285
8164
  var init_ground_truth = __esm({
8286
8165
  "core/agentic/ground-truth.ts"() {
8287
8166
  "use strict";
@@ -8311,13 +8190,24 @@ var init_ground_truth = __esm({
8311
8190
  __name(verify, "verify");
8312
8191
  __name(prepareCommand, "prepareCommand");
8313
8192
  __name(requiresVerification, "requiresVerification");
8314
- ground_truth_default = {
8193
+ groundTruth = {
8315
8194
  verify,
8316
8195
  prepareCommand,
8317
8196
  requiresVerification,
8318
8197
  verifiers,
8319
- formatWarnings
8198
+ formatWarnings,
8199
+ formatDuration: formatDuration2,
8200
+ escapeRegex,
8201
+ verifyDone,
8202
+ verifyShip,
8203
+ verifyFeature,
8204
+ verifyNow,
8205
+ verifyInit,
8206
+ verifySync,
8207
+ verifyAnalyze,
8208
+ verifySpec
8320
8209
  };
8210
+ ground_truth_default = groundTruth;
8321
8211
  }
8322
8212
  });
8323
8213
 
@@ -9620,6 +9510,26 @@ var init_schemas2 = __esm({
9620
9510
  });
9621
9511
 
9622
9512
  // core/utils/jsonl-helper.ts
9513
+ var jsonl_helper_exports = {};
9514
+ __export(jsonl_helper_exports, {
9515
+ appendJsonLine: () => appendJsonLine,
9516
+ appendJsonLineWithRotation: () => appendJsonLineWithRotation,
9517
+ appendJsonLines: () => appendJsonLines,
9518
+ checkFileSizeWarning: () => checkFileSizeWarning,
9519
+ countJsonLines: () => countJsonLines,
9520
+ filterJsonLines: () => filterJsonLines,
9521
+ getFileSizeMB: () => getFileSizeMB,
9522
+ getFirstJsonLines: () => getFirstJsonLines,
9523
+ getLastJsonLines: () => getLastJsonLines,
9524
+ isJsonLinesEmpty: () => isJsonLinesEmpty,
9525
+ mergeJsonLines: () => mergeJsonLines,
9526
+ parseJsonLines: () => parseJsonLines,
9527
+ readJsonLines: () => readJsonLines,
9528
+ readJsonLinesStreaming: () => readJsonLinesStreaming,
9529
+ rotateJsonLinesIfNeeded: () => rotateJsonLinesIfNeeded,
9530
+ stringifyJsonLines: () => stringifyJsonLines,
9531
+ writeJsonLines: () => writeJsonLines
9532
+ });
9623
9533
  import fsSync from "node:fs";
9624
9534
  import fs21 from "node:fs/promises";
9625
9535
  import path20 from "node:path";
@@ -9767,7 +9677,6 @@ async function checkFileSizeWarning(filePath, warnThresholdMB = STORAGE_LIMITS.L
9767
9677
  }
9768
9678
  return { sizeMB, isLarge };
9769
9679
  }
9770
- var jsonl_helper_default;
9771
9680
  var init_jsonl_helper = __esm({
9772
9681
  "core/utils/jsonl-helper.ts"() {
9773
9682
  "use strict";
@@ -9790,25 +9699,6 @@ var init_jsonl_helper = __esm({
9790
9699
  __name(rotateJsonLinesIfNeeded, "rotateJsonLinesIfNeeded");
9791
9700
  __name(appendJsonLineWithRotation, "appendJsonLineWithRotation");
9792
9701
  __name(checkFileSizeWarning, "checkFileSizeWarning");
9793
- jsonl_helper_default = {
9794
- parseJsonLines,
9795
- stringifyJsonLines,
9796
- readJsonLines,
9797
- writeJsonLines,
9798
- appendJsonLine,
9799
- appendJsonLines,
9800
- filterJsonLines,
9801
- countJsonLines,
9802
- getLastJsonLines,
9803
- getFirstJsonLines,
9804
- mergeJsonLines,
9805
- isJsonLinesEmpty,
9806
- readJsonLinesStreaming,
9807
- getFileSizeMB,
9808
- rotateJsonLinesIfNeeded,
9809
- appendJsonLineWithRotation,
9810
- checkFileSizeWarning
9811
- };
9812
9702
  }
9813
9703
  });
9814
9704
 
@@ -9869,13 +9759,20 @@ var init_memory_system = __esm({
9869
9759
  _loaded = false;
9870
9760
  _projectId = null;
9871
9761
  /**
9872
- * Optional: subdirectory within memory folder
9762
+ * Optional subdirectory within the project's `memory/` folder.
9763
+ * Override to nest the store file under a subfolder.
9764
+ *
9765
+ * @returns Subdirectory name, or `null` to store directly in `memory/`
9873
9766
  */
9874
9767
  getSubdirectory() {
9875
9768
  return null;
9876
9769
  }
9877
9770
  /**
9878
- * Get full path for the store file
9771
+ * Build the full filesystem path for this store's JSON file.
9772
+ *
9773
+ * @param projectId - The project identifier used for path resolution
9774
+ * @returns Absolute path to the store file
9775
+ * (e.g., `~/.prjct-cli/projects/{id}/memory/patterns.json`)
9879
9776
  */
9880
9777
  getPath(projectId) {
9881
9778
  const basePath = path21.join(path_manager_default.getGlobalProjectPath(projectId), "memory");
@@ -9886,8 +9783,20 @@ var init_memory_system = __esm({
9886
9783
  return path21.join(basePath, this.getFilename());
9887
9784
  }
9888
9785
  /**
9889
- * Load data from disk (with caching)
9890
- * Returns cached data if same project and already loaded
9786
+ * Load data from disk with project-scoped caching.
9787
+ *
9788
+ * Returns cached data immediately if already loaded for the same project.
9789
+ * Otherwise reads from disk, falling back to {@link getDefault} when the
9790
+ * file does not exist. Calls {@link afterLoad} after a successful disk read.
9791
+ *
9792
+ * @param projectId - The project identifier
9793
+ * @returns The loaded (or cached) data
9794
+ * @throws {Error} If the file read fails for reasons other than ENOENT
9795
+ *
9796
+ * @example
9797
+ * ```ts
9798
+ * const patterns = await patternStore.load('my-project-id')
9799
+ * ```
9891
9800
  */
9892
9801
  async load(projectId) {
9893
9802
  if (this._loaded && this._data && this._projectId === projectId) {
@@ -9910,13 +9819,23 @@ var init_memory_system = __esm({
9910
9819
  return this._data;
9911
9820
  }
9912
9821
  /**
9913
- * Hook for subclasses to normalize data after loading
9914
- * E.g., ensuring all index keys exist
9822
+ * Hook for subclasses to normalize or migrate data after loading from disk.
9823
+ *
9824
+ * Called once per disk read (not on cache hits). Override to ensure
9825
+ * structural invariants — e.g., adding missing index keys.
9826
+ *
9827
+ * @param _data - The freshly loaded data to normalize (mutate in place)
9915
9828
  */
9916
9829
  afterLoad(_data) {
9917
9830
  }
9918
9831
  /**
9919
- * Save data to disk
9832
+ * Persist the current in-memory data to disk.
9833
+ *
9834
+ * Creates parent directories automatically if they don't exist.
9835
+ * No-op if no data has been loaded yet.
9836
+ *
9837
+ * @param projectId - The project identifier for path resolution
9838
+ * @throws {Error} If the file write fails
9920
9839
  */
9921
9840
  async save(projectId) {
9922
9841
  if (!this._data) return;
@@ -9925,19 +9844,37 @@ var init_memory_system = __esm({
9925
9844
  await fs22.writeFile(filePath, JSON.stringify(this._data, null, 2), "utf-8");
9926
9845
  }
9927
9846
  /**
9928
- * Get cached data without loading (may be null)
9847
+ * Access the cached data without triggering a disk read.
9848
+ *
9849
+ * @returns The cached data, or `null` if nothing has been loaded
9929
9850
  */
9930
9851
  getData() {
9931
9852
  return this._data;
9932
9853
  }
9933
9854
  /**
9934
- * Set data directly (for subclass modifications)
9855
+ * Replace the in-memory data directly. Does not persist to disk —
9856
+ * call {@link save} afterwards if persistence is needed.
9857
+ *
9858
+ * @param data - The new data to cache
9935
9859
  */
9936
9860
  setData(data) {
9937
9861
  this._data = data;
9938
9862
  }
9939
9863
  /**
9940
- * Update data with a transform function, then save
9864
+ * Atomically load, transform, and save data in one operation.
9865
+ *
9866
+ * @param projectId - The project identifier
9867
+ * @param updater - Pure function that receives current data and returns updated data
9868
+ * @returns The updated data after saving
9869
+ * @throws {Error} If load or save fails
9870
+ *
9871
+ * @example
9872
+ * ```ts
9873
+ * await store.update('my-project', (data) => ({
9874
+ * ...data,
9875
+ * count: data.count + 1,
9876
+ * }))
9877
+ * ```
9941
9878
  */
9942
9879
  async update(projectId, updater) {
9943
9880
  const data = await this.load(projectId);
@@ -9947,7 +9884,11 @@ var init_memory_system = __esm({
9947
9884
  return updated;
9948
9885
  }
9949
9886
  /**
9950
- * Check if data has been loaded for a project
9887
+ * Check whether data has been loaded into the cache.
9888
+ *
9889
+ * @param projectId - If provided, checks that data is loaded for this specific project.
9890
+ * If omitted, returns `true` if any project's data is cached.
9891
+ * @returns `true` if data is loaded (and matches the project, when specified)
9951
9892
  */
9952
9893
  isLoaded(projectId) {
9953
9894
  if (projectId) {
@@ -9956,7 +9897,8 @@ var init_memory_system = __esm({
9956
9897
  return this._loaded;
9957
9898
  }
9958
9899
  /**
9959
- * Reset cache (forces reload on next access)
9900
+ * Clear the in-memory cache, forcing a fresh disk read on the next {@link load} call.
9901
+ * Does not delete or modify the file on disk.
9960
9902
  */
9961
9903
  reset() {
9962
9904
  this._data = null;
@@ -12410,7 +12352,7 @@ function clearCache() {
12410
12352
  cache.clear();
12411
12353
  cacheOrder.length = 0;
12412
12354
  }
12413
- var TEMPLATES_DIR, MAX_CACHE_SIZE, cache, cacheOrder, template_loader_default;
12355
+ var TEMPLATES_DIR, MAX_CACHE_SIZE, cache, cacheOrder, templateLoader, template_loader_default;
12414
12356
  var init_template_loader = __esm({
12415
12357
  "core/agentic/template-loader.ts"() {
12416
12358
  "use strict";
@@ -12425,12 +12367,8 @@ var init_template_loader = __esm({
12425
12367
  __name(load, "load");
12426
12368
  __name(getAllowedTools, "getAllowedTools");
12427
12369
  __name(clearCache, "clearCache");
12428
- template_loader_default = {
12429
- load,
12430
- parseFrontmatter,
12431
- getAllowedTools,
12432
- clearCache
12433
- };
12370
+ templateLoader = { load, parseFrontmatter, getAllowedTools, clearCache };
12371
+ template_loader_default = templateLoader;
12434
12372
  }
12435
12373
  });
12436
12374
 
@@ -14587,11 +14525,11 @@ You are executing a prjct command as ${context2.agentName}. Follow the template-
14587
14525
  b) What technologies exist in this project
14588
14526
  c) What agents are available in ${context2.paths.agentsDir}
14589
14527
 
14590
- - **IMPORTANTE**: Los agentes en ${context2.paths.agentsDir} YA son espec\xEDficos del proyecto
14591
- (fueron generados durante p. sync con las tecnolog\xEDas reales)
14528
+ - **IMPORTANT**: The agents in ${context2.paths.agentsDir} are already project-specific
14529
+ (they were generated during p. sync with the actual project technologies)
14592
14530
 
14593
- - SIEMPRE usar el especialista si existe para el dominio
14594
- - Solo usar generalista si NO existe agente para ese dominio
14531
+ - ALWAYS use the specialist if one exists for the domain
14532
+ - Only use the generalist if there is NO agent for that domain
14595
14533
 
14596
14534
  - Check if task should be fragmented (read: ${context2.paths.taskFragmentation})
14597
14535
  - If agents loaded, check their skills and load from ${context2.paths.skillsDir}
@@ -15494,21 +15432,7 @@ async function detect2() {
15494
15432
  cachedAgent = await isClaudeEnvironment() ? getClaudeAgent() : getTerminalAgent();
15495
15433
  return cachedAgent;
15496
15434
  }
15497
- function setAgent(type) {
15498
- cachedAgent = type === "claude" ? getClaudeAgent() : getTerminalAgent();
15499
- return cachedAgent;
15500
- }
15501
- function reset() {
15502
- cachedAgent = null;
15503
- }
15504
- async function isClaude() {
15505
- if (cachedAgent) return cachedAgent.type === "claude";
15506
- return isClaudeEnvironment();
15507
- }
15508
- async function isTerminal() {
15509
- return !await isClaude();
15510
- }
15511
- var cachedAgent, CLAUDE_AGENT, TERMINAL_AGENT, agent_detector_default;
15435
+ var cachedAgent, CLAUDE_AGENT, TERMINAL_AGENT;
15512
15436
  var init_agent_detector = __esm({
15513
15437
  "core/infrastructure/agent-detector.ts"() {
15514
15438
  "use strict";
@@ -15574,20 +15498,6 @@ var init_agent_detector = __esm({
15574
15498
  __name(getClaudeAgent, "getClaudeAgent");
15575
15499
  __name(getTerminalAgent, "getTerminalAgent");
15576
15500
  __name(detect2, "detect");
15577
- __name(setAgent, "setAgent");
15578
- __name(reset, "reset");
15579
- __name(isClaude, "isClaude");
15580
- __name(isTerminal, "isTerminal");
15581
- agent_detector_default = {
15582
- detect: detect2,
15583
- isClaudeEnvironment,
15584
- getClaudeAgent,
15585
- getTerminalAgent,
15586
- setAgent,
15587
- reset,
15588
- isClaude,
15589
- isTerminal
15590
- };
15591
15501
  }
15592
15502
  });
15593
15503
 
@@ -15624,7 +15534,7 @@ var init_agent_service = __esm({
15624
15534
  */
15625
15535
  async initialize() {
15626
15536
  if (this.agent) return this.agent;
15627
- this.agentInfo = await agent_detector_default.detect();
15537
+ this.agentInfo = await detect2();
15628
15538
  if (!this.agentInfo?.isSupported) {
15629
15539
  throw AgentError.notSupported(this.agentInfo?.type ?? "unknown");
15630
15540
  }
@@ -16885,7 +16795,7 @@ var init_memory_service = __esm({
16885
16795
  data,
16886
16796
  author
16887
16797
  };
16888
- await jsonl_helper_default.appendJsonLine(memoryPath, entry);
16798
+ await appendJsonLine(memoryPath, entry);
16889
16799
  } catch (error) {
16890
16800
  if (!isNotFoundError(error)) {
16891
16801
  console.error(`Memory log error: ${getErrorMessage2(error)}`);
@@ -16900,7 +16810,7 @@ var init_memory_service = __esm({
16900
16810
  const projectId = await config_manager_default.getProjectId(projectPath);
16901
16811
  if (!projectId) return [];
16902
16812
  const memoryPath = path_manager_default.getFilePath(projectId, "memory", "context.jsonl");
16903
- const entries = await jsonl_helper_default.readJsonLines(memoryPath);
16813
+ const entries = await readJsonLines(memoryPath);
16904
16814
  return entries.slice(-limit);
16905
16815
  } catch (error) {
16906
16816
  if (!isNotFoundError(error) && !(error instanceof SyntaxError)) {
@@ -16936,7 +16846,7 @@ var init_memory_service = __esm({
16936
16846
  const projectId = await config_manager_default.getProjectId(projectPath);
16937
16847
  if (!projectId) return;
16938
16848
  const memoryPath = path_manager_default.getFilePath(projectId, "memory", "context.jsonl");
16939
- await jsonl_helper_default.writeJsonLines(memoryPath, []);
16849
+ await writeJsonLines(memoryPath, []);
16940
16850
  } catch (error) {
16941
16851
  if (!isNotFoundError(error)) {
16942
16852
  console.error(`Memory clear error: ${getErrorMessage2(error)}`);
@@ -16950,7 +16860,7 @@ var init_memory_service = __esm({
16950
16860
  async getRecentEvents(projectId, limit = 100) {
16951
16861
  try {
16952
16862
  const memoryPath = path_manager_default.getFilePath(projectId, "memory", "context.jsonl");
16953
- const entries = await jsonl_helper_default.readJsonLines(memoryPath);
16863
+ const entries = await readJsonLines(memoryPath);
16954
16864
  return entries.slice(-limit);
16955
16865
  } catch (error) {
16956
16866
  if (!isNotFoundError(error) && !(error instanceof SyntaxError)) {
@@ -19038,7 +18948,7 @@ var init_analysis2 = __esm({
19038
18948
  const summaryPath = context2.paths.analysis || path_manager_default.getFilePath(projectId, "analysis", "repo-summary.md");
19039
18949
  await tool_registry_default.get("Write")(summaryPath, summary);
19040
18950
  await this.logToMemory(projectPath, "repository_analyzed", {
19041
- timestamp: date_helper_default.getTimestamp(),
18951
+ timestamp: date_helper_exports.getTimestamp(),
19042
18952
  fileCount: analysisData.fileCount,
19043
18953
  gitCommits: analysisData.gitStats.totalCommits
19044
18954
  });
@@ -19642,7 +19552,7 @@ ${formatFullDiff(diff)}`);
19642
19552
  const timestamps = todayEvents.map((e) => new Date(e.timestamp || e.ts).getTime()).filter((t) => !Number.isNaN(t)).sort((a, b) => a - b);
19643
19553
  if (timestamps.length >= 2) {
19644
19554
  const durationMs = timestamps[timestamps.length - 1] - timestamps[0];
19645
- sessionDuration = date_helper_default.formatDuration(durationMs);
19555
+ sessionDuration = date_helper_exports.formatDuration(durationMs);
19646
19556
  }
19647
19557
  }
19648
19558
  const tasksCompleted = todayEvents.filter((e) => e.action === "task_completed").length;
@@ -19841,7 +19751,7 @@ var init_planning = __esm({
19841
19751
  wizardResult = await wizard.runNonInteractive();
19842
19752
  }
19843
19753
  output_default.step(1, 4, "Detecting author...");
19844
- const detectedAuthor = await author_detector_default.detect();
19754
+ const detectedAuthor = await detect();
19845
19755
  const author = {
19846
19756
  name: detectedAuthor.name || void 0,
19847
19757
  email: detectedAuthor.email || void 0,
@@ -20018,7 +19928,7 @@ Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
20018
19928
  featureId,
20019
19929
  tasks: tasksWithAgents.length,
20020
19930
  assignments: tasksWithAgents.map((t) => ({ task: t.task, agent: t.agent })),
20021
- timestamp: date_helper_default.getTimestamp()
19931
+ timestamp: date_helper_exports.getTimestamp()
20022
19932
  });
20023
19933
  const agentCounts = tasksWithAgents.reduce((acc, t) => {
20024
19934
  acc[t.agent] = (acc[t.agent] || 0) + 1;
@@ -20076,7 +19986,7 @@ Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
20076
19986
  severity,
20077
19987
  priority,
20078
19988
  agent,
20079
- timestamp: date_helper_default.getTimestamp()
19989
+ timestamp: date_helper_exports.getTimestamp()
20080
19990
  });
20081
19991
  output_default.done(`bug [${severity}] \u2192 ${agent}`);
20082
19992
  showNextSteps("bug");
@@ -20142,7 +20052,7 @@ ${"=".repeat(60)}`);
20142
20052
  console.log(" For code generation, Claude Code will read this plan");
20143
20053
  console.log(" and generate the structure automatically.\n");
20144
20054
  await this.logToMemory(projectPath, "architect_executed", {
20145
- timestamp: date_helper_default.getTimestamp(),
20055
+ timestamp: date_helper_exports.getTimestamp(),
20146
20056
  idea
20147
20057
  });
20148
20058
  return {
@@ -20196,7 +20106,7 @@ Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
20196
20106
  await tool_registry_default.get("Write")(sessionPath, sessionContent);
20197
20107
  await this.logToMemory(projectPath, "idea_architecture_started", {
20198
20108
  idea: description,
20199
- timestamp: date_helper_default.getTimestamp()
20109
+ timestamp: date_helper_exports.getTimestamp()
20200
20110
  });
20201
20111
  output_default.done("architecture session created");
20202
20112
  console.log("\n\u{1F4A1} Use /p:architect execute to continue planning\n");
@@ -20206,7 +20116,7 @@ Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
20206
20116
  await ideasStorage.addIdea(projectId, description);
20207
20117
  await this.logToMemory(projectPath, "idea_captured", {
20208
20118
  idea: description,
20209
- timestamp: date_helper_default.getTimestamp()
20119
+ timestamp: date_helper_exports.getTimestamp()
20210
20120
  });
20211
20121
  output_default.done(`idea captured: ${description.slice(0, 40)}`);
20212
20122
  showNextSteps("idea");
@@ -20296,7 +20206,7 @@ Status: Draft
20296
20206
  await tool_registry_default.get("Write")(specFile, specContent);
20297
20207
  await this.logToMemory(projectPath, "spec_created", {
20298
20208
  feature: featureName,
20299
- timestamp: date_helper_default.getTimestamp()
20209
+ timestamp: date_helper_exports.getTimestamp()
20300
20210
  });
20301
20211
  output_default.done(`spec created: ${slug}.md`);
20302
20212
  console.log(`
@@ -20368,7 +20278,7 @@ var init_project_service = __esm({
20368
20278
  */
20369
20279
  async ensureAuthor() {
20370
20280
  if (this.currentAuthor) return this.currentAuthor;
20371
- const authorObj = await author_detector_default.detect();
20281
+ const authorObj = await detect();
20372
20282
  this.currentAuthor = {
20373
20283
  name: authorObj.name ?? void 0,
20374
20284
  email: authorObj.email ?? void 0,
@@ -21235,7 +21145,7 @@ var init_context_generator = __esm({
21235
21145
  const s = sources || defaultSources();
21236
21146
  const content = `# ${stats.name} - Project Rules
21237
21147
  <!-- projectId: ${this.config.projectId} -->
21238
- <!-- Generated: ${date_helper_default.getTimestamp()} -->
21148
+ <!-- Generated: ${getTimestamp()} -->
21239
21149
  <!-- Ecosystem: ${stats.ecosystem} | Type: ${stats.projectType} -->
21240
21150
 
21241
21151
  ## THIS PROJECT (${stats.ecosystem})
@@ -21438,7 +21348,7 @@ ${shipped.shipped.length > 0 ? shipped.shipped.slice(-10).map((s) => `- **${s.na
21438
21348
  return `# ${pkgName} - Package Rules
21439
21349
  <!-- package: ${pkg.relativePath} -->
21440
21350
  <!-- monorepo: ${stats.name} -->
21441
- <!-- Generated: ${date_helper_default.getTimestamp()} -->
21351
+ <!-- Generated: ${getTimestamp()} -->
21442
21352
  <!-- Sources: ${resolvedCtx.sources.join(" \u2192 ")} -->
21443
21353
 
21444
21354
  ## THIS PACKAGE
@@ -22478,7 +22388,8 @@ var init_sync_service = __esm({
22478
22388
  this.globalPath,
22479
22389
  localConfig?.verification
22480
22390
  );
22481
- } catch {
22391
+ } catch (error) {
22392
+ logger_default.debug("Verification failed (non-critical)", { error: getErrorMessage(error) });
22482
22393
  }
22483
22394
  return {
22484
22395
  success: true,
@@ -22583,7 +22494,8 @@ var init_sync_service = __esm({
22583
22494
  cwd: this.projectPath
22584
22495
  });
22585
22496
  data.weeklyCommits = parseInt(weekly.trim(), 10) || 0;
22586
- } catch {
22497
+ } catch (error) {
22498
+ logger_default.debug("Git analysis failed (not a git repo?)", { error: getErrorMessage(error) });
22587
22499
  }
22588
22500
  return data;
22589
22501
  }
@@ -22606,7 +22518,8 @@ var init_sync_service = __esm({
22606
22518
  { cwd: this.projectPath }
22607
22519
  );
22608
22520
  stats.fileCount = parseInt(stdout.trim(), 10) || 0;
22609
- } catch {
22521
+ } catch (error) {
22522
+ logger_default.debug("File count failed", { path: this.projectPath, error: getErrorMessage(error) });
22610
22523
  stats.fileCount = 0;
22611
22524
  }
22612
22525
  try {
@@ -22628,7 +22541,8 @@ var init_sync_service = __esm({
22628
22541
  } else {
22629
22542
  stats.languages.push("JavaScript");
22630
22543
  }
22631
- } catch {
22544
+ } catch (error) {
22545
+ logger_default.debug("No package.json found", { path: this.projectPath, error: getErrorMessage(error) });
22632
22546
  }
22633
22547
  if (await this.fileExists("Cargo.toml")) {
22634
22548
  stats.ecosystem = "Rust";
@@ -22763,7 +22677,8 @@ var init_sync_service = __esm({
22763
22677
  await fs45.unlink(path49.join(agentsPath, file));
22764
22678
  }
22765
22679
  }
22766
- } catch {
22680
+ } catch (error) {
22681
+ logger_default.debug("Failed to purge old agents", { path: agentsPath, error: getErrorMessage(error) });
22767
22682
  }
22768
22683
  const workflowAgents = ["prjct-workflow", "prjct-planner", "prjct-shipper"];
22769
22684
  await Promise.all(workflowAgents.map((name) => this.generateWorkflowAgent(name, agentsPath)));
@@ -22839,7 +22754,11 @@ var init_sync_service = __esm({
22839
22754
  );
22840
22755
  content = await fs45.readFile(templatePath, "utf-8");
22841
22756
  content = await this.resolveTemplateIncludes(content);
22842
- } catch {
22757
+ } catch (error) {
22758
+ logger_default.debug("Workflow agent template not found, generating minimal", {
22759
+ name,
22760
+ error: getErrorMessage(error)
22761
+ });
22843
22762
  content = this.generateMinimalWorkflowAgent(name);
22844
22763
  }
22845
22764
  await fs45.writeFile(path49.join(agentsPath, `${name}.md`), content, "utf-8");
@@ -22861,7 +22780,11 @@ var init_sync_service = __esm({
22861
22780
  content = content.replace("{projectName}", stats.name);
22862
22781
  content = content.replace("{frameworks}", stack.frameworks.join(", ") || "None detected");
22863
22782
  content = content.replace("{ecosystem}", stats.ecosystem);
22864
- } catch {
22783
+ } catch (error) {
22784
+ logger_default.debug("Domain agent template not found, generating minimal", {
22785
+ name,
22786
+ error: getErrorMessage(error)
22787
+ });
22865
22788
  content = this.generateMinimalDomainAgent(name, stats, stack);
22866
22789
  }
22867
22790
  await fs45.writeFile(path49.join(agentsPath, `${name}.md`), content, "utf-8");
@@ -22925,7 +22848,7 @@ You are the ${name} expert for this project. Apply best practices for the detect
22925
22848
  }
22926
22849
  const skillsConfig = {
22927
22850
  projectId: this.projectId,
22928
- syncedAt: date_helper_default.getTimestamp(),
22851
+ syncedAt: getTimestamp(),
22929
22852
  skills: skills.map((s) => ({
22930
22853
  name: s.skill,
22931
22854
  linkedAgents: [s.agent]
@@ -22936,7 +22859,8 @@ You are the ${name} expert for this project. Apply best practices for the detect
22936
22859
  path49.join(this.globalPath, "config", "skills.json"),
22937
22860
  JSON.stringify(skillsConfig, null, 2),
22938
22861
  "utf-8"
22939
- ).catch(() => {
22862
+ ).catch((error) => {
22863
+ logger_default.debug("Failed to write skills.json", { error: getErrorMessage(error) });
22940
22864
  });
22941
22865
  return skills;
22942
22866
  }
@@ -23044,7 +22968,11 @@ You are the ${name} expert for this project. Apply best practices for the detect
23044
22968
  let existing = {};
23045
22969
  try {
23046
22970
  existing = JSON.parse(await fs45.readFile(projectJsonPath, "utf-8"));
23047
- } catch {
22971
+ } catch (error) {
22972
+ logger_default.debug("No existing project.json", {
22973
+ path: projectJsonPath,
22974
+ error: getErrorMessage(error)
22975
+ });
23048
22976
  }
23049
22977
  const updated = {
23050
22978
  ...existing,
@@ -23059,8 +22987,8 @@ You are the ${name} expert for this project. Apply best practices for the detect
23059
22987
  stack: stats.ecosystem,
23060
22988
  currentBranch: git.branch,
23061
22989
  hasUncommittedChanges: git.hasChanges,
23062
- createdAt: existing.createdAt || date_helper_default.getTimestamp(),
23063
- lastSync: date_helper_default.getTimestamp(),
22990
+ createdAt: existing.createdAt || getTimestamp(),
22991
+ lastSync: getTimestamp(),
23064
22992
  // Staleness tracking (PRJ-120)
23065
22993
  lastSyncCommit: git.recentCommits[0]?.hash || null,
23066
22994
  lastSyncBranch: git.branch
@@ -23075,7 +23003,8 @@ You are the ${name} expert for this project. Apply best practices for the detect
23075
23003
  let state = {};
23076
23004
  try {
23077
23005
  state = JSON.parse(await fs45.readFile(statePath, "utf-8"));
23078
- } catch {
23006
+ } catch (error) {
23007
+ logger_default.debug("No existing state.json", { path: statePath, error: getErrorMessage(error) });
23079
23008
  }
23080
23009
  state.projectId = this.projectId;
23081
23010
  state.stack = {
@@ -23093,11 +23022,11 @@ You are the ${name} expert for this project. Apply best practices for the detect
23093
23022
  state.metrics = {
23094
23023
  totalFiles: stats.fileCount
23095
23024
  };
23096
- state.lastSync = date_helper_default.getTimestamp();
23097
- state.lastUpdated = date_helper_default.getTimestamp();
23025
+ state.lastSync = getTimestamp();
23026
+ state.lastUpdated = getTimestamp();
23098
23027
  state.context = {
23099
23028
  ...state.context || {},
23100
- lastSession: date_helper_default.getTimestamp(),
23029
+ lastSession: getTimestamp(),
23101
23030
  lastAction: "Synced project",
23102
23031
  nextAction: 'Run `p. task "description"` to start working'
23103
23032
  };
@@ -23107,7 +23036,8 @@ You are the ${name} expert for this project. Apply best practices for the detect
23107
23036
  this.projectPath,
23108
23037
  state
23109
23038
  );
23110
- } catch {
23039
+ } catch (error) {
23040
+ logger_default.debug("Local state generation failed (optional)", { error: getErrorMessage(error) });
23111
23041
  }
23112
23042
  }
23113
23043
  // ==========================================================================
@@ -23116,7 +23046,7 @@ You are the ${name} expert for this project. Apply best practices for the detect
23116
23046
  async logToMemory(git, stats) {
23117
23047
  const memoryPath = path49.join(this.globalPath, "memory", "events.jsonl");
23118
23048
  const event = {
23119
- ts: date_helper_default.getTimestamp(),
23049
+ ts: getTimestamp(),
23120
23050
  action: "sync",
23121
23051
  branch: git.branch,
23122
23052
  uncommitted: git.hasChanges,
@@ -23146,7 +23076,8 @@ You are the ${name} expert for this project. Apply best practices for the detect
23146
23076
  const filePath = path49.join(this.globalPath, file);
23147
23077
  const content = await fs45.readFile(filePath, "utf-8");
23148
23078
  filteredChars += content.length;
23149
- } catch {
23079
+ } catch (error) {
23080
+ logger_default.debug("Context file not found for metrics", { file, error: getErrorMessage(error) });
23150
23081
  }
23151
23082
  }
23152
23083
  for (const agent of agents) {
@@ -23154,7 +23085,11 @@ You are the ${name} expert for this project. Apply best practices for the detect
23154
23085
  const agentPath = path49.join(this.globalPath, "agents", `${agent.name}.md`);
23155
23086
  const content = await fs45.readFile(agentPath, "utf-8");
23156
23087
  filteredChars += content.length;
23157
- } catch {
23088
+ } catch (error) {
23089
+ logger_default.debug("Agent file not found for metrics", {
23090
+ agent: agent.name,
23091
+ error: getErrorMessage(error)
23092
+ });
23158
23093
  }
23159
23094
  }
23160
23095
  const filteredSize = Math.floor(filteredChars / CHARS_PER_TOKEN3);
@@ -23170,7 +23105,7 @@ You are the ${name} expert for this project. Apply best practices for the detect
23170
23105
  agents: agents.filter((a) => a.type === "domain").map((a) => a.name)
23171
23106
  });
23172
23107
  } catch (error) {
23173
- console.error("Warning: Failed to record metrics:", getErrorMessage(error));
23108
+ logger_default.debug("Failed to record sync metrics", { error: getErrorMessage(error) });
23174
23109
  }
23175
23110
  return {
23176
23111
  duration,
@@ -23186,7 +23121,8 @@ You are the ${name} expert for this project. Apply best practices for the detect
23186
23121
  try {
23187
23122
  await fs45.access(path49.join(this.projectPath, filename));
23188
23123
  return true;
23189
- } catch {
23124
+ } catch (error) {
23125
+ logger_default.debug("File not found", { filename, error: getErrorMessage(error) });
23190
23126
  return false;
23191
23127
  }
23192
23128
  }
@@ -23195,7 +23131,8 @@ You are the ${name} expert for this project. Apply best practices for the detect
23195
23131
  const pkgPath = path49.join(__dirname, "..", "..", "package.json");
23196
23132
  const pkg = JSON.parse(await fs45.readFile(pkgPath, "utf-8"));
23197
23133
  return pkg.version || "0.0.0";
23198
- } catch {
23134
+ } catch (error) {
23135
+ logger_default.debug("Failed to read CLI version", { error: getErrorMessage(error) });
23199
23136
  return "0.0.0";
23200
23137
  }
23201
23138
  }
@@ -23906,7 +23843,7 @@ var init_watch_service = __esm({
23906
23843
  const changedFiles = Array.from(this.pendingChanges);
23907
23844
  this.pendingChanges.clear();
23908
23845
  if (changedFiles.length === 0) return;
23909
- const timestamp = date_helper_default.getTimestamp().split("T")[1].split(".")[0];
23846
+ const timestamp = getTimestamp().split("T")[1].split(".")[0];
23910
23847
  if (!this.options.quiet) {
23911
23848
  const filesSummary = changedFiles.length === 1 ? changedFiles[0] : `${changedFiles.length} files`;
23912
23849
  console.log(
@@ -24354,7 +24291,6 @@ var init_command_data = __esm({
24354
24291
  // core/utils/help.ts
24355
24292
  var help_exports = {};
24356
24293
  __export(help_exports, {
24357
- default: () => help_default,
24358
24294
  formatAgentCommandHelp: () => formatAgentCommandHelp,
24359
24295
  formatCommandHelp: () => formatCommandHelp,
24360
24296
  formatCommandList: () => formatCommandList,
@@ -24525,7 +24461,7 @@ function getHelp(topic) {
24525
24461
  }
24526
24462
  return formatCommandHelp(topic);
24527
24463
  }
24528
- var TERMINAL_COMMANDS, GLOBAL_FLAGS, help_default;
24464
+ var TERMINAL_COMMANDS, GLOBAL_FLAGS;
24529
24465
  var init_help = __esm({
24530
24466
  "core/utils/help.ts"() {
24531
24467
  "use strict";
@@ -24599,21 +24535,12 @@ var init_help = __esm({
24599
24535
  __name(formatCommandHelp, "formatCommandHelp");
24600
24536
  __name(formatCommandList, "formatCommandList");
24601
24537
  __name(getHelp, "getHelp");
24602
- help_default = {
24603
- formatMainHelp,
24604
- formatCommandHelp,
24605
- formatCommandList,
24606
- formatTerminalCommandHelp,
24607
- formatAgentCommandHelp,
24608
- getHelp
24609
- };
24610
24538
  }
24611
24539
  });
24612
24540
 
24613
24541
  // core/infrastructure/setup.ts
24614
24542
  var setup_exports = {};
24615
24543
  __export(setup_exports, {
24616
- default: () => setup_default,
24617
24544
  hasCursorProject: () => hasCursorProject,
24618
24545
  hasWindsurfProject: () => hasWindsurfProject,
24619
24546
  installAntigravitySkill: () => installAntigravitySkill,
@@ -25284,7 +25211,7 @@ function showResults(results, provider) {
25284
25211
  }
25285
25212
  console.log("");
25286
25213
  }
25287
- var setup_default, isDirectRun;
25214
+ var isDirectRun;
25288
25215
  var init_setup = __esm({
25289
25216
  "core/infrastructure/setup.ts"() {
25290
25217
  "use strict";
@@ -25299,7 +25226,6 @@ var init_setup = __esm({
25299
25226
  init_editors_config();
25300
25227
  __name(installAICLI, "installAICLI");
25301
25228
  __name(run, "run");
25302
- setup_default = { run };
25303
25229
  __name(installGeminiRouter, "installGeminiRouter");
25304
25230
  __name(installGeminiGlobalConfig, "installGeminiGlobalConfig");
25305
25231
  __name(installAntigravitySkill, "installAntigravitySkill");
@@ -25707,11 +25633,11 @@ var init_analytics = __esm({
25707
25633
  }
25708
25634
  if (view === "week" || view === "month") {
25709
25635
  const days = view === "week" ? 7 : 30;
25710
- const startDate = date_helper_default.getDaysAgo(days);
25636
+ const startDate = date_helper_exports.getDaysAgo(days);
25711
25637
  const memoryPath = path_manager_default.getFilePath(projectId, "memory", "context.jsonl");
25712
25638
  let entries = [];
25713
25639
  try {
25714
- const allEntries = await jsonl_helper_default.readJsonLines(memoryPath);
25640
+ const allEntries = await jsonl_helper_exports.readJsonLines(memoryPath);
25715
25641
  entries = allEntries.filter((e) => new Date(e.timestamp) >= startDate);
25716
25642
  } catch {
25717
25643
  entries = [];
@@ -25774,7 +25700,7 @@ ${stalenessWarning}`);
25774
25700
  if (currentTask) {
25775
25701
  console.log(` ${currentTask.description}`);
25776
25702
  if (currentTask.startedAt) {
25777
- const elapsed = date_helper_default.calculateDuration(new Date(currentTask.startedAt));
25703
+ const elapsed = date_helper_exports.calculateDuration(new Date(currentTask.startedAt));
25778
25704
  console.log(` Started: ${elapsed} ago`);
25779
25705
  }
25780
25706
  } else {
@@ -25808,7 +25734,7 @@ ${"\u2550".repeat(50)}`);
25808
25734
  console.log("\u{1F4A1} /p:work to start | /p:done to complete | /p:ship to ship\n");
25809
25735
  await this.logToMemory(projectPath, "dash_viewed", {
25810
25736
  view,
25811
- timestamp: date_helper_default.getTimestamp()
25737
+ timestamp: date_helper_exports.getTimestamp()
25812
25738
  });
25813
25739
  return {
25814
25740
  success: true,
@@ -26103,10 +26029,10 @@ async function cleanupMemory(projectPath) {
26103
26029
  ];
26104
26030
  for (const filePath of jsonlFiles) {
26105
26031
  try {
26106
- const sizeMB = await jsonl_helper_default.getFileSizeMB(filePath);
26032
+ const sizeMB = await jsonl_helper_exports.getFileSizeMB(filePath);
26107
26033
  if (sizeMB > 0) {
26108
26034
  results.totalSize += sizeMB;
26109
- const rotated = await jsonl_helper_default.rotateJsonLinesIfNeeded(filePath, 10);
26035
+ const rotated = await jsonl_helper_exports.rotateJsonLinesIfNeeded(filePath, 10);
26110
26036
  if (rotated) {
26111
26037
  results.rotated.push(path55.basename(filePath));
26112
26038
  results.freedSpace += sizeMB;
@@ -26123,7 +26049,7 @@ async function cleanupMemory(projectPath) {
26123
26049
  async function cleanupMemoryInternal(projectPath) {
26124
26050
  const projectId = await config_manager_default.getProjectId(projectPath);
26125
26051
  const memoryPath = path_manager_default.getFilePath(projectId, "memory", "context.jsonl");
26126
- await jsonl_helper_default.rotateJsonLinesIfNeeded(memoryPath, 10);
26052
+ await jsonl_helper_exports.rotateJsonLinesIfNeeded(memoryPath, 10);
26127
26053
  }
26128
26054
  async function cleanup(options = {}, projectPath = process.cwd()) {
26129
26055
  try {
@@ -26143,10 +26069,10 @@ async function cleanup(options = {}, projectPath = process.cwd()) {
26143
26069
  const cleaned = [];
26144
26070
  const memoryPath = path_manager_default.getFilePath(projectId, "memory", "context.jsonl");
26145
26071
  try {
26146
- const entries = await jsonl_helper_default.readJsonLines(memoryPath);
26072
+ const entries = await jsonl_helper_exports.readJsonLines(memoryPath);
26147
26073
  if (entries.length > 100) {
26148
26074
  const kept = entries.slice(-100);
26149
- await jsonl_helper_default.writeJsonLines(memoryPath, kept);
26075
+ await jsonl_helper_exports.writeJsonLines(memoryPath, kept);
26150
26076
  cleaned.push(`Memory: ${entries.length - 100} old entries removed`);
26151
26077
  } else {
26152
26078
  cleaned.push("Memory: No cleanup needed");
@@ -26192,7 +26118,7 @@ async function cleanup(options = {}, projectPath = process.cwd()) {
26192
26118
  await cleanupMemoryInternal(projectPath);
26193
26119
  await memoryService.log(projectPath, "cleanup_performed", {
26194
26120
  items: cleaned.length,
26195
- timestamp: date_helper_default.getTimestamp()
26121
+ timestamp: date_helper_exports.getTimestamp()
26196
26122
  });
26197
26123
  output_default.done(`${cleaned.length} items cleaned`);
26198
26124
  return { success: true, cleaned };
@@ -26272,7 +26198,7 @@ async function design(target = null, options = {}, projectPath = process.cwd())
26272
26198
  await memoryService.log(projectPath, "design_created", {
26273
26199
  type: designType,
26274
26200
  target: designTarget,
26275
- timestamp: date_helper_default.getTimestamp()
26201
+ timestamp: date_helper_exports.getTimestamp()
26276
26202
  });
26277
26203
  output_default.done(`${designType} design created`);
26278
26204
  return { success: true, designPath: designFilePath, type: designType, target: designTarget };
@@ -26320,7 +26246,7 @@ async function recover(projectPath = process.cwd()) {
26320
26246
  console.log("\n Found abandoned session:\n");
26321
26247
  console.log(` Task: ${sessionData.task}`);
26322
26248
  if (sessionData.startedAt) {
26323
- const elapsed = date_helper_default.calculateDuration(new Date(sessionData.startedAt));
26249
+ const elapsed = date_helper_exports.calculateDuration(new Date(sessionData.startedAt));
26324
26250
  console.log(` Started: ${elapsed} ago`);
26325
26251
  }
26326
26252
  if (sessionData.context) {
@@ -26381,7 +26307,7 @@ async function undo(projectPath = process.cwd()) {
26381
26307
  await file_helper_exports.writeFile(snapshotFile, JSON.stringify(history2, null, 2));
26382
26308
  await memoryService.log(projectPath, "undo_performed", {
26383
26309
  snapshotId: stashMessage,
26384
- timestamp: date_helper_default.getTimestamp()
26310
+ timestamp: date_helper_exports.getTimestamp()
26385
26311
  });
26386
26312
  output_default.done("changes stashed (use /p:redo to restore)");
26387
26313
  return { success: true, snapshotId: stashMessage };
@@ -26442,7 +26368,7 @@ async function redo(projectPath = process.cwd()) {
26442
26368
  history2.current = Math.max(0, history2.current - 1);
26443
26369
  await file_helper_exports.writeFile(snapshotFile, JSON.stringify(history2, null, 2));
26444
26370
  await memoryService.log(projectPath, "redo_performed", {
26445
- timestamp: date_helper_default.getTimestamp()
26371
+ timestamp: date_helper_exports.getTimestamp()
26446
26372
  });
26447
26373
  output_default.done("changes restored");
26448
26374
  return { success: true };
@@ -27030,9 +26956,9 @@ async function removeWorkflowPreference(projectId, hook, command) {
27030
26956
  }
27031
26957
  function formatWorkflowPreferences(preferences) {
27032
26958
  if (preferences.length === 0) {
27033
- return `${chalk17.dim("No workflow preferences configured.")}
26959
+ return `${chalk17.dim(WORKFLOW_HELP.NO_PREFERENCES)}
27034
26960
 
27035
- Set one: "p. workflow antes de ship corre los tests"`;
26961
+ Set one: "${WORKFLOW_HELP.SET_EXAMPLE}"`;
27036
26962
  }
27037
26963
  const lines = ["", "WORKFLOW PREFERENCES", "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"];
27038
26964
  for (const pref of preferences) {
@@ -27040,8 +26966,8 @@ Set one: "p. workflow antes de ship corre los tests"`;
27040
26966
  lines.push(` [${scopeBadge}] ${pref.key.padEnd(15)} \u2192 ${pref.action}`);
27041
26967
  }
27042
26968
  lines.push("");
27043
- lines.push(chalk17.dim('Modify: "p. workflow antes de ship corre npm test"'));
27044
- lines.push(chalk17.dim('Remove: "p. workflow quita el hook de ship"'));
26969
+ lines.push(chalk17.dim(`Modify: "${WORKFLOW_HELP.MODIFY_EXAMPLE}"`));
26970
+ lines.push(chalk17.dim(`Remove: "${WORKFLOW_HELP.REMOVE_EXAMPLE}"`));
27045
26971
  return lines.join("\n");
27046
26972
  }
27047
26973
  var execAsync12, sessionPreferences, oncePreferences;
@@ -27049,6 +26975,7 @@ var init_workflow_preferences = __esm({
27049
26975
  "core/workflow/workflow-preferences.ts"() {
27050
26976
  "use strict";
27051
26977
  init_memory_system();
26978
+ init_constants();
27052
26979
  init_fs();
27053
26980
  execAsync12 = promisify18(exec17);
27054
26981
  sessionPreferences = /* @__PURE__ */ new Map();
@@ -27148,7 +27075,7 @@ ${result.stderr}`.trim();
27148
27075
  await this.logToMemory(projectPath, "feature_shipped", {
27149
27076
  feature: featureName,
27150
27077
  version: newVersion,
27151
- timestamp: date_helper_default.getTimestamp()
27078
+ timestamp: date_helper_exports.getTimestamp()
27152
27079
  });
27153
27080
  await memory_system_default.learnDecision(projectId, "commit_footer", "prjct", "ship");
27154
27081
  if (testResult.success) {
@@ -27234,7 +27161,7 @@ ${result.stderr}`.trim();
27234
27161
  try {
27235
27162
  const changelogPath = path60.join(projectPath, "CHANGELOG.md");
27236
27163
  const changelog = await file_helper_exports.readFile(changelogPath, "# Changelog\n\n");
27237
- const entry = `## [${version}] - ${date_helper_default.formatDate(/* @__PURE__ */ new Date())}
27164
+ const entry = `## [${version}] - ${date_helper_exports.formatDate(/* @__PURE__ */ new Date())}
27238
27165
 
27239
27166
  ### Added
27240
27167
  - ${feature}
@@ -28246,7 +28173,7 @@ var init_workflow = __esm({
28246
28173
  agenticMode: true,
28247
28174
  availableAgents,
28248
28175
  orchestratorContext: result.orchestratorContext,
28249
- timestamp: date_helper_default.getTimestamp()
28176
+ timestamp: date_helper_exports.getTimestamp()
28250
28177
  });
28251
28178
  await runWorkflowHooks(projectId, "after", "task", {
28252
28179
  projectPath,
@@ -28303,7 +28230,7 @@ var init_workflow = __esm({
28303
28230
  let duration = "";
28304
28231
  if (currentTask.startedAt) {
28305
28232
  const started = new Date(currentTask.startedAt);
28306
- duration = date_helper_default.calculateDuration(started);
28233
+ duration = date_helper_exports.calculateDuration(started);
28307
28234
  }
28308
28235
  await stateStorage.completeTask(projectId);
28309
28236
  const linearId = currentTask.linearId;
@@ -28329,7 +28256,7 @@ var init_workflow = __esm({
28329
28256
  await this.logToMemory(projectPath, "task_completed", {
28330
28257
  task,
28331
28258
  duration,
28332
- timestamp: date_helper_default.getTimestamp()
28259
+ timestamp: date_helper_exports.getTimestamp()
28333
28260
  });
28334
28261
  await runWorkflowHooks(projectId, "after", "done", {
28335
28262
  projectPath,
@@ -28391,7 +28318,7 @@ var init_workflow = __esm({
28391
28318
  await this.logToMemory(projectPath, "task_paused", {
28392
28319
  task: currentTask.description,
28393
28320
  reason: reason2,
28394
- timestamp: date_helper_default.getTimestamp()
28321
+ timestamp: date_helper_exports.getTimestamp()
28395
28322
  });
28396
28323
  return { success: true, task: currentTask.description, reason: reason2 };
28397
28324
  } catch (error) {
@@ -28426,7 +28353,7 @@ var init_workflow = __esm({
28426
28353
  showNextSteps("resume");
28427
28354
  await this.logToMemory(projectPath, "task_resumed", {
28428
28355
  task: resumed.description,
28429
- timestamp: date_helper_default.getTimestamp()
28356
+ timestamp: date_helper_exports.getTimestamp()
28430
28357
  });
28431
28358
  return { success: true, task: resumed.description };
28432
28359
  } catch (error) {
@@ -28462,7 +28389,7 @@ var init_workflow = __esm({
28462
28389
  setWorkflowPreference: /* @__PURE__ */ __name(async (pref) => {
28463
28390
  await setWorkflowPreference(projectId, {
28464
28391
  ...pref,
28465
- createdAt: date_helper_default.getTimestamp()
28392
+ createdAt: date_helper_exports.getTimestamp()
28466
28393
  });
28467
28394
  }, "setWorkflowPreference"),
28468
28395
  removeWorkflowPreference: /* @__PURE__ */ __name(async (hook, command) => {
@@ -28719,7 +28646,7 @@ var require_package = __commonJS({
28719
28646
  "package.json"(exports, module) {
28720
28647
  module.exports = {
28721
28648
  name: "prjct-cli",
28722
- version: "1.6.6",
28649
+ version: "1.6.8",
28723
28650
  description: "Context layer for AI agents. Project context for Claude Code, Gemini CLI, and more.",
28724
28651
  main: "core/index.ts",
28725
28652
  bin: {
@@ -29397,7 +29324,9 @@ function createExtendedRoutes() {
29397
29324
  const state = await readJsonFile2(path8.join(projectPath, "storage/state.json"));
29398
29325
  const queue = await readJsonFile2(path8.join(projectPath, "storage/queue.json"));
29399
29326
  const ideas = await readJsonFile2(path8.join(projectPath, "storage/ideas.json"));
29400
- const shipped = await readJsonFile2(path8.join(projectPath, "storage/shipped.json"));
29327
+ const shipped = await readJsonFile2(
29328
+ path8.join(projectPath, "storage/shipped.json")
29329
+ );
29401
29330
  const currentTask = state?.currentTask;
29402
29331
  const duration = await calculateDuration2(currentTask?.startedAt);
29403
29332
  return {
@@ -29547,6 +29476,7 @@ function createExtendedRoutes() {
29547
29476
  const resumedTask = {
29548
29477
  id: state.previousTask.id,
29549
29478
  description: state.previousTask.description,
29479
+ status: "active",
29550
29480
  startedAt: (/* @__PURE__ */ new Date()).toISOString(),
29551
29481
  sessionId: `sess_${Date.now().toString(36)}`
29552
29482
  };
@@ -29588,6 +29518,7 @@ function createExtendedRoutes() {
29588
29518
  const newTask = {
29589
29519
  id: task.id,
29590
29520
  description: task.description,
29521
+ status: "active",
29591
29522
  startedAt: (/* @__PURE__ */ new Date()).toISOString(),
29592
29523
  sessionId: `sess_${Date.now().toString(36)}`,
29593
29524
  featureId: task.featureId
@@ -29617,12 +29548,15 @@ function createExtendedRoutes() {
29617
29548
  if (!text) {
29618
29549
  return c.json({ success: false, error: "text required" }, 400);
29619
29550
  }
29620
- const ideas = await readJsonFile2(ideasPath) || { ideas: [], lastUpdated: "" };
29551
+ const ideas = await readJsonFile2(ideasPath) || {
29552
+ ideas: [],
29553
+ lastUpdated: ""
29554
+ };
29621
29555
  const newIdea = {
29622
29556
  id: `idea_${Date.now().toString(36)}`,
29623
29557
  text,
29624
29558
  status: "pending",
29625
- priority,
29559
+ priority: priority || "medium",
29626
29560
  tags,
29627
29561
  addedAt: (/* @__PURE__ */ new Date()).toISOString()
29628
29562
  };
@@ -29652,7 +29586,9 @@ function createExtendedRoutes() {
29652
29586
  const state = await readJsonFile2(path8.join(projectPath, "storage/state.json"));
29653
29587
  const queue = await readJsonFile2(path8.join(projectPath, "storage/queue.json"));
29654
29588
  const ideas = await readJsonFile2(path8.join(projectPath, "storage/ideas.json"));
29655
- const shipped = await readJsonFile2(path8.join(projectPath, "storage/shipped.json"));
29589
+ const shipped = await readJsonFile2(
29590
+ path8.join(projectPath, "storage/shipped.json")
29591
+ );
29656
29592
  if (state?.currentTask) activeProjects++;
29657
29593
  totalTasks += queue?.tasks?.filter((t) => !t.completed)?.length || 0;
29658
29594
  totalIdeas += ideas?.ideas?.filter((i) => i.status === "pending")?.length || 0;