@hynaweb/stage 0.0.0-stage → 1.0.0

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 (3) hide show
  1. package/bin/cli.js +51 -0
  2. package/package.json +14 -3
  3. package/README.md +0 -3
package/bin/cli.js ADDED
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ const axios = require('axios');
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const readline = require('readline');
6
+
7
+ // Points to your new Edge Function
8
+ const API_URL = 'https://mczesspakhkomlnmfstw.supabase.co/functions/v1/deploy-stage';
9
+ const SUPABASE_KEY = 'sb_publishable_sG0q8k6txKHOihBduyr67w_UKfolcvj';
10
+
11
+ const configPath = path.join(require('os').homedir(), '.hyna-stage');
12
+
13
+ async function getApiKey() {
14
+ if (fs.existsSync(configPath)) {
15
+ return fs.readFileSync(configPath, 'utf8').trim();
16
+ }
17
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
18
+ return new Promise((resolve) => {
19
+ rl.question('šŸ”‘ Enter your HYNA-Stage API Key: ', (key) => {
20
+ fs.writeFileSync(configPath, key.trim());
21
+ rl.close();
22
+ resolve(key.trim());
23
+ });
24
+ });
25
+ }
26
+
27
+ async function main() {
28
+ console.log('šŸš€ Initializing HYNA-Stage...');
29
+ const apiKey = await getApiKey();
30
+
31
+ try {
32
+ console.log('šŸ“¦ Spinning up cloud environment...');
33
+
34
+ const res = await axios.post(API_URL, {}, {
35
+ headers: {
36
+ 'Authorization': 'Bearer ' + apiKey,
37
+ 'apikey': SUPABASE_KEY,
38
+ 'Content-Type': 'application/json'
39
+ }
40
+ });
41
+
42
+ console.log('\nāœ… Environment is LIVE!');
43
+ console.log('šŸ”— URL: \x1b[36m' + res.data.url + '\x1b[0m');
44
+ console.log('šŸ†” Sandbox ID: ' + res.data.sandbox_id);
45
+ console.log('ā±ļø Auto-destruct in: 1 hour\n');
46
+
47
+ } catch (err) {
48
+ console.error('āŒ Error:', err.response?.data?.error || err.message);
49
+ }
50
+ }
51
+ main();
package/package.json CHANGED
@@ -1,6 +1,17 @@
1
1
  {
2
2
  "name": "@hynaweb/stage",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "Instant ephemeral staging environments for AI agents.",
5
+ "main": "bin/cli.js",
6
+ "bin": {
7
+ "hyna-stage": "bin/cli.js"
8
+ },
9
+ "files": [
10
+ "bin/"
11
+ ],
12
+ "dependencies": {
13
+ "axios": "^1.6.0"
14
+ },
15
+ "author": "HYNAWEB",
16
+ "license": "MIT"
6
17
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.