mneme-ai 3.16.0 → 3.17.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.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `mneme orbital` — a sensory nerve to the sky for a space-ops agent (internal).
3
+ * Pulls REAL, free, public, real-time telemetry over plain internet (no API key) and turns it into a
4
+ * signed context + an honest operational advisory that can tighten an APHELION charter.
5
+ * orbital weather → live NOAA space weather + advisory
6
+ * orbital track --lat 13.7 --lon 100.5 → is the ISS overhead you right now
7
+ * HONEST: telemetry the agent READS + governs by — not a claim that space weather alters the model.
8
+ */
9
+ import type { Command } from "commander";
10
+ export declare function registerOrbitalCommands(program: Command): void;
11
+ //# sourceMappingURL=orbital.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orbital.d.ts","sourceRoot":"","sources":["../../src/commands/orbital.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAczC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoC9D"}
@@ -0,0 +1,68 @@
1
+ import { get as httpsGet } from "node:https";
2
+ import { get as httpGet } from "node:http";
3
+ import { orbital } from "@mneme-ai/core";
4
+ function out(s) { process.stdout.write(s + "\n"); }
5
+ function fetchJson(url) {
6
+ return new Promise((resolve, reject) => {
7
+ const lib = url.startsWith("https") ? httpsGet : httpGet;
8
+ const req = lib(url, (r) => { let b = ""; r.on("data", (c) => (b += c)); r.on("end", () => { try {
9
+ resolve(JSON.parse(b));
10
+ }
11
+ catch (e) {
12
+ reject(e);
13
+ } }); });
14
+ req.on("error", reject);
15
+ req.setTimeout(8000, () => req.destroy(new Error("timeout")));
16
+ });
17
+ }
18
+ export function registerOrbitalCommands(program) {
19
+ const k = program.command("orbital").description("🛰 ORBITAL (internal) — a sensory nerve to the sky: ingest REAL free public space-weather (NOAA) + satellite position as signed context + an APHELION charter advisory. Honest: the agent READS the sky, it doesn't 'feel' it.");
20
+ k.command("weather", { isDefault: true }).description("Live NOAA space weather (geomagnetic / radio-blackout / solar + Kp) → an operational advisory.")
21
+ .option("--json", "print the parsed weather + advisory as JSON")
22
+ .action(async (o) => {
23
+ try {
24
+ const [scales, kp] = await Promise.all([
25
+ fetchJson("https://services.swpc.noaa.gov/products/noaa-scales.json"),
26
+ fetchJson("https://services.swpc.noaa.gov/json/planetary_k_index_1m.json").catch(() => []),
27
+ ]);
28
+ const sw = orbital.parseSpaceWeather(scales, kp);
29
+ const adv = orbital.spaceWeatherAdvisory(sw);
30
+ if (o.json) {
31
+ out(JSON.stringify({ sw, advisory: adv }, null, 2));
32
+ return;
33
+ }
34
+ const ico = adv.level === "severe" ? "🔴" : adv.level === "warning" ? "🟠" : adv.level === "caution" ? "🟡" : "🟢";
35
+ out(`🛰 SPACE WEATHER · ${ico} ${adv.level.toUpperCase()} · ${sw.condition} · captured ${sw.capturedAt || "now"}`);
36
+ out(` geomagnetic G${sw.geomagnetic.scale} · radio-blackout R${sw.radioBlackout.scale} · solar S${sw.solarRadiation.scale} · Kp ${sw.kpIndex ?? "?"} · risk ${adv.riskFactor}`);
37
+ for (const i of adv.impacts)
38
+ out(` • ${i}`);
39
+ if (adv.charterSuggestion) {
40
+ const c = adv.charterSuggestion;
41
+ out(` 🛡 suggested APHELION charter: maxRisk→${c.lowerMaxRiskTo}${c.requireApprovalFor?.length ? ` · approve: ${c.requireApprovalFor.join("/")}` : ""}${c.addForbidden?.length ? ` · forbid: ${c.addForbidden.join("/")}` : ""}`);
42
+ out(` → apply: mneme aphelion amend --node <n> --reason "${c.reason}" --max-risk ${c.lowerMaxRiskTo}`);
43
+ }
44
+ else
45
+ out(" 🟢 nominal — no charter change advised.");
46
+ out(" (real NOAA telemetry the agent reads + governs by — not a mood/entropy claim)");
47
+ }
48
+ catch (e) {
49
+ out(`✗ could not reach NOAA (need internet): ${e.message}`);
50
+ process.exitCode = 2;
51
+ }
52
+ });
53
+ k.command("track").description("Is the ISS overhead you right now? (live position over plain internet).")
54
+ .requiredOption("--lat <n>", "your latitude", parseFloat).requiredOption("--lon <n>", "your longitude", parseFloat)
55
+ .action(async (o) => {
56
+ try {
57
+ const iss = await fetchJson("http://api.open-notify.org/iss-now.json");
58
+ const sLat = Number(iss?.iss_position?.latitude), sLon = Number(iss?.iss_position?.longitude);
59
+ const v = orbital.isOverhead(sLat, sLon, 420, o.lat, o.lon);
60
+ out(`🛰 ISS at ${sLat.toFixed(2)}, ${sLon.toFixed(2)} · ${v.overhead ? "🟢 OVERHEAD (in view)" : "⚪ below horizon"} · ${v.groundDistanceKm} km away (horizon ${v.horizonKm} km)`);
61
+ }
62
+ catch (e) {
63
+ out(`✗ could not reach the ISS feed: ${e.message}`);
64
+ process.exitCode = 2;
65
+ }
66
+ });
67
+ }
68
+ //# sourceMappingURL=orbital.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orbital.js","sourceRoot":"","sources":["../../src/commands/orbital.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,GAAG,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,GAAG,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,SAAS,GAAG,CAAC,CAAS,IAAU,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACjE,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;QACzD,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI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YAC5D,GAAG,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,iBAAiB,MAAM,CAAC,CAAC,gBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC;QACpL,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YAAC,GAAG,CAAC,mCAAoC,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;YAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QAAC,CAAC;IACvG,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAkMA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAkmNvD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmMA,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmmNvD"}
package/dist/index.js CHANGED
@@ -112,6 +112,7 @@ import { registerAgentcertCommands } from "./commands/agentcert.js";
112
112
  import { registerThymosCommands } from "./commands/thymos.js";
113
113
  import { registerInfraCommands } from "./commands/infra.js";
114
114
  import { registerAphelionCommands } from "./commands/aphelion.js";
115
+ import { registerOrbitalCommands } from "./commands/orbital.js";
115
116
  import { registerAdamasCommands } from "./commands/adamas.js";
116
117
  import { registerPrismCommands } from "./commands/prism.js";
117
118
  import { registerGoldilocksCommands } from "./commands/goldilocks.js";
@@ -4791,6 +4792,7 @@ export async function run(argv) {
4791
4792
  registerThymosCommands(program);
4792
4793
  registerInfraCommands(program);
4793
4794
  registerAphelionCommands(program);
4795
+ registerOrbitalCommands(program);
4794
4796
  registerAdamasCommands(program);
4795
4797
  registerPrismCommands(program);
4796
4798
  registerGoldilocksCommands(program);