shipsafe-tidesync 0.1.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 (2) hide show
  1. package/bin/tidesync.js +44 -0
  2. package/package.json +13 -0
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ const [,, cmd, ...args] = process.argv;
3
+ const BASE = "https://tidesync-336382452417.us-central1.run.app";
4
+
5
+ const commands = {
6
+ health: async () => {
7
+ const r = await fetch(`${BASE}/health`).catch(() => null);
8
+ if (!r) return console.error("✗ Cannot reach tidesync agent");
9
+ const d = await r.json();
10
+ console.log(`✓ tidesync ${d.status ?? "ok"} — ${BASE}`);
11
+ },
12
+ demo: async () => {
13
+ console.log("▶ Running Hormuz Crisis demo on tidesync...");
14
+ const r = await fetch(`${BASE}/run`, {
15
+ method: "POST",
16
+ headers: { "Content-Type": "application/json" },
17
+ body: JSON.stringify({ scenario: "hormuz" }),
18
+ }).catch(() => null);
19
+ if (!r) return console.error("✗ Demo failed — is tidesync agent running?");
20
+ const d = await r.json();
21
+ console.log(JSON.stringify(d, null, 2));
22
+ },
23
+ init: async () => {
24
+ console.log(`
25
+ ShipSafe Tidesync — powered by Fivetran
26
+ ${"-".repeat(48)}
27
+ Agent URL : ${BASE}
28
+ Dashboard : https://tidesync-336382452417.us-central1.run.app
29
+
30
+ To connect to your own data:
31
+ 1. Set credentials in GCP Secret Manager (project: shipsafe-ai)
32
+ 2. Run: npx shipsafe-tidesync demo
33
+
34
+ Health check:`);
35
+ await commands.health();
36
+ },
37
+ };
38
+
39
+ const fn = commands[cmd];
40
+ if (!fn) {
41
+ console.log("Usage: npx shipsafe-tidesync <init|demo|health>");
42
+ process.exit(1);
43
+ }
44
+ fn().catch(e => { console.error(e.message); process.exit(1); });
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "shipsafe-tidesync",
3
+ "version": "0.1.0",
4
+ "description": "ShipSafe Tidesync CLI \u2014 powered by Fivetran",
5
+ "type": "module",
6
+ "bin": {
7
+ "tidesync": "./bin/tidesync.js"
8
+ },
9
+ "engines": {
10
+ "node": ">=20"
11
+ },
12
+ "license": "MIT"
13
+ }