@paths.design/caws-cli 3.2.2 → 3.2.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.js"],"names":[],"mappings":";mCAakD,OAAO;AAOzD;;;GAGG;AACH,6CAkBC;AAED;;;GAGG;AACH,uCAFa,MAAO,IAAI,CAqBvB;AAED;;;GAGG;AACH,6CAFa,MAAO,IAAI,CAmCvB;AAED;;;GAGG;AACH,0CAEC;AAED;;;GAGG;AACH,qDAEC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.js"],"names":[],"mappings":";mCAakD,OAAO;AAOzD;;;GAGG;AACH,6CAkBC;AAED;;;GAGG;AACH,uCAFa,MAAO,IAAI,CA2CvB;AAED;;;GAGG;AACH,6CAFa,MAAO,IAAI,CAmCvB;AAED;;;GAGG;AACH,0CAEC;AAED;;;GAGG;AACH,qDAEC"}
@@ -49,21 +49,43 @@ function initializeGlobalSetup() {
49
49
  function loadProvenanceTools() {
50
50
  if (provenanceTools) return provenanceTools; // Already loaded
51
51
 
52
+ // Try multiple possible locations for provenance tools
53
+ const possiblePaths = [
54
+ // 1. Bundled templates in CLI package (for global installs)
55
+ path.join(__dirname, '../../templates/apps/tools/caws/provenance.js'),
56
+ // 2. Local project templates
57
+ path.join(process.cwd(), 'apps/tools/caws/provenance.js'),
58
+ // 3. Template package in monorepo
59
+ path.join(__dirname, '../../../caws-template/apps/tools/caws/provenance.js'),
60
+ // 4. Detected setup template directory
61
+ null, // Will be set from setup if available
62
+ ];
63
+
64
+ // Add detected template directory if available
52
65
  try {
53
66
  const setup = cawsSetup || initializeGlobalSetup();
54
67
  if (setup?.hasTemplateDir && setup?.templateDir) {
55
- const { generateProvenance, saveProvenance } = require(
56
- path.join(setup.templateDir, 'apps/tools/caws/provenance.js')
57
- );
68
+ possiblePaths[3] = path.join(setup.templateDir, 'apps/tools/caws/provenance.js');
69
+ }
70
+ } catch (setupError) {
71
+ // Continue without detected setup
72
+ }
73
+
74
+ // Try each path until one works
75
+ for (const testPath of possiblePaths) {
76
+ if (!testPath) continue;
77
+
78
+ try {
79
+ const { generateProvenance, saveProvenance } = require(testPath);
58
80
  provenanceTools = { generateProvenance, saveProvenance };
59
- console.log('✅ Loaded provenance tools from:', setup.templateDir);
81
+ return provenanceTools;
82
+ } catch (pathError) {
83
+ // Continue to next path
60
84
  }
61
- } catch (error) {
62
- // Fallback for environments without template
63
- provenanceTools = null;
64
- console.warn('⚠️ Provenance tools not available:', error.message);
65
85
  }
66
86
 
87
+ // If all paths fail, return null (don't warn during init - templates aren't ready yet)
88
+ provenanceTools = null;
67
89
  return provenanceTools;
68
90
  }
69
91
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paths.design/caws-cli",
3
- "version": "3.2.2",
3
+ "version": "3.2.3",
4
4
  "description": "CAWS CLI - Coding Agent Workflow System command line tools",
5
5
  "main": "dist/index.js",
6
6
  "bin": {