stringray-ai 1.0.24 → 1.0.26

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/README.md CHANGED
@@ -79,7 +79,7 @@ npm install stringray-ai
79
79
  npx stringray-ai install
80
80
  ```
81
81
 
82
- **Note:** The setup command is required because npm's postinstall scripts have security restrictions that prevent automatic configuration. This ensures you have full control over the installation process.
82
+ **Note:** The setup command is required because npm's postinstall scripts have security restrictions and may not run automatically in all environments. Running the install command manually ensures proper configuration.
83
83
 
84
84
  This will automatically:
85
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stringray-ai",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "⚡ StringRay ⚡: Bulletproof AI orchestration with systematic error prevention. Zero dead ends. Ship clean, tested, optimized code — every time.",
5
5
  "type": "module",
6
6
  "main": "./dist/plugin/index.js",
@@ -1,60 +1,102 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // Check if we're in the right directory
3
+ // Validate codex integration in both development and deployed environments
4
4
  import fs from "fs";
5
5
  import path from "path";
6
6
 
7
- if (!fs.existsSync("src/codex-injector.ts")) {
8
- process.exit(1);
7
+ // Check if we're in development or deployed environment
8
+ const isDevelopment = fs.existsSync("src/codex-injector.ts");
9
+ const isDeployed = fs.existsSync("node_modules/stringray-ai");
10
+
11
+ if (!isDevelopment && !isDeployed) {
12
+ process.exit(1); // Not in a valid environment
9
13
  }
10
14
 
11
- // Check if codex files exist
12
- const codexFiles = [
13
- "docs/framework/agents_template.md",
14
- ".strray/agents_template.md",
15
- ];
15
+ // In deployed environment, check if the plugin was installed correctly
16
+ if (isDeployed) {
17
+ console.log('DEBUG: Running in deployed environment');
18
+ console.log('DEBUG: Current directory:', process.cwd());
16
19
 
17
- let codexFound = false;
18
- for (const file of codexFiles) {
19
- if (fs.existsSync(file)) {
20
- codexFound = true;
20
+ // Check if .mcp.json exists (created by postinstall)
21
+ const mcpExists = fs.existsSync(".mcp.json");
22
+ console.log('DEBUG: .mcp.json exists:', mcpExists);
23
+ if (!mcpExists) {
24
+ console.log('DEBUG: .mcp.json not found, exiting with code 1');
25
+ process.exit(1);
26
+ }
21
27
 
22
- // Basic validation of codex content
23
- try {
24
- const content = fs.readFileSync(file, "utf-8");
25
- const versionMatch = content.match(/\*\*Version\*\*:\s*(\d+\.\d+\.\d+)/);
26
- if (versionMatch) {
27
- }
28
-
29
- const termMatches = content.match(/####\s*\d+\.\s/g);
30
- if (termMatches) {
31
- }
32
- } catch (error) {}
28
+ // Check if package.json exists
29
+ const pkgExists = fs.existsSync("package.json");
30
+ console.log('DEBUG: package.json exists:', pkgExists);
31
+ if (!pkgExists) {
32
+ console.log('DEBUG: package.json not found, exiting with code 1');
33
+ process.exit(1);
33
34
  }
34
- }
35
35
 
36
- if (!codexFound) {
37
- process.exit(1);
38
- }
36
+ // Check if the plugin files exist
37
+ const pluginExists = fs.existsSync("node_modules/stringray-ai/dist/plugin/plugins/stringray-codex-injection.js");
38
+ console.log('DEBUG: plugin file exists:', pluginExists);
39
+ if (!pluginExists) {
40
+ console.log('DEBUG: plugin file not found, exiting with code 1');
41
+ process.exit(1);
42
+ }
39
43
 
40
- // Check if built files exist
41
- if (fs.existsSync("dist")) {
42
- } else {
44
+ console.log('DEBUG: All checks passed, exiting with code 0');
45
+ process.exit(0); // All checks passed for deployed environment
43
46
  }
44
47
 
45
- // Check package.json
46
- if (fs.existsSync("package.json")) {
47
- try {
48
- const pkg = JSON.parse(fs.readFileSync("package.json", "utf-8"));
49
- } catch (error) {}
50
- } else {
51
- process.exit(1);
52
- }
48
+ // Development environment checks
49
+ if (isDevelopment) {
50
+ // Check if codex files exist
51
+ const codexFiles = [
52
+ "docs/framework/agents_template.md",
53
+ ".strray/agents_template.md",
54
+ ];
55
+
56
+ let codexFound = false;
57
+ for (const file of codexFiles) {
58
+ if (fs.existsSync(file)) {
59
+ codexFound = true;
60
+
61
+ // Basic validation of codex content
62
+ try {
63
+ const content = fs.readFileSync(file, "utf-8");
64
+ const versionMatch = content.match(/\*\*Version\*\*:\s*(\d+\.\d+\.\d+)/);
65
+ if (versionMatch) {
66
+ }
67
+
68
+ const termMatches = content.match(/####\s*\d+\.\s/g);
69
+ if (termMatches) {
70
+ }
71
+ } catch (error) {}
72
+ }
73
+ }
53
74
 
54
- // Check .strray directory
55
- if (fs.existsSync(".strray")) {
56
- if (fs.existsSync(".strray/codex.json")) {
75
+ if (!codexFound) {
76
+ process.exit(1);
77
+ }
78
+
79
+ // Check if built files exist
80
+ if (fs.existsSync("dist")) {
81
+ } else {
82
+ }
83
+
84
+ // Check package.json
85
+ if (fs.existsSync("package.json")) {
86
+ try {
87
+ const pkg = JSON.parse(fs.readFileSync("package.json", "utf-8"));
88
+ } catch (error) {}
89
+ } else {
90
+ process.exit(1);
91
+ }
92
+
93
+ // Check .strray directory
94
+ if (fs.existsSync(".strray")) {
95
+ if (fs.existsSync(".strray/codex.json")) {
96
+ } else {
97
+ }
57
98
  } else {
58
99
  }
59
- } else {
60
100
  }
101
+
102
+ process.exit(0); // All checks passed