@zerwiz/ymir 0.1.10 → 0.1.12

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 (41) hide show
  1. package/.agents/skills/galdr-ymirsystem/assets/installation.md +29 -0
  2. package/CHANGELOG.md +100 -0
  3. package/bin/app-lib.sh +11 -1
  4. package/bin/design-icon.sh +32 -14
  5. package/bin/ymir-config.sh +76 -0
  6. package/bin/ymir-install.sh +15 -9
  7. package/bin/ymir-style.sh +24 -0
  8. package/bin/ymir.js +16 -1
  9. package/midgard/README.md +16 -0
  10. package/midgard/design-system/.gitkeep +0 -0
  11. package/midgard/design-system/ember.d.ts +13 -0
  12. package/midgard/design-system/ember.js +183 -0
  13. package/midgard/design-system/icons/algiz.svg +4 -0
  14. package/midgard/design-system/icons/ansuz.svg +4 -0
  15. package/midgard/design-system/icons/berkana.svg +4 -0
  16. package/midgard/design-system/icons/dagaz.svg +4 -0
  17. package/midgard/design-system/icons/ehwaz.svg +4 -0
  18. package/midgard/design-system/icons/fehu.svg +4 -0
  19. package/midgard/design-system/icons/gjallarhorn.svg +4 -0
  20. package/midgard/design-system/icons/gungnir.svg +4 -0
  21. package/midgard/design-system/icons/heimdall.svg +4 -0
  22. package/midgard/design-system/icons/ingwaz.svg +4 -0
  23. package/midgard/design-system/icons/jera.svg +4 -0
  24. package/midgard/design-system/icons/kaunan.svg +4 -0
  25. package/midgard/design-system/icons/midgard.svg +4 -0
  26. package/midgard/design-system/icons/mimirsbrunn.svg +4 -0
  27. package/midgard/design-system/icons/othala.svg +4 -0
  28. package/midgard/design-system/icons/raidho.svg +4 -0
  29. package/midgard/design-system/icons/ratatoskr.svg +4 -0
  30. package/midgard/design-system/icons/sowilo.svg +4 -0
  31. package/midgard/design-system/icons/tiwaz.svg +4 -0
  32. package/midgard/design-system/icons/utgard.svg +4 -0
  33. package/midgard/design-system/icons/valhalla.svg +4 -0
  34. package/midgard/design-system/icons/yggdrasil.svg +4 -0
  35. package/midgard/design-system/icons.md +59 -0
  36. package/midgard/design-system/runes.md +78 -0
  37. package/midgard/design-system/tokens.css +109 -0
  38. package/midgard/design-system/ymir-mark.svg +62 -0
  39. package/package.json +3 -2
  40. package/scripts/electron.sh +18 -2
  41. package/scripts/start.sh +53 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerwiz/ymir",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Ymir \u2014 the single-tenant agent operating system. Omarchy-first, host-aware, self-healing.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/zerwiz/ymir",
@@ -30,6 +30,7 @@
30
30
  ".agents/",
31
31
  "scripts/",
32
32
  "RULES/",
33
+ "midgard/design-system/",
33
34
  "docs/",
34
35
  "packaging/",
35
36
  "AGENTS.md",
@@ -61,7 +62,7 @@
61
62
  "optionalDependencies": {
62
63
  "@zerwiz/hlidskjalf": "^0.1.0",
63
64
  "@zerwiz/odrerir": "^0.1.0",
64
- "@zerwiz/sessrumnir": "^0.1.8-alpha",
65
+ "@zerwiz/sessrumnir": "0.1.8-alpha",
65
66
  "@zerwiz/smidja-factory": "^0.1.0"
66
67
  }
67
68
  }
@@ -184,9 +184,25 @@ ensure_electron_binary() {
184
184
  return 1
185
185
  }
186
186
 
187
+ # npm gates install scripts by default (11.16+ warns, 12 refuses), and Electron's
188
+ # postinstall is what downloads the runtime — so a fresh install can build the web
189
+ # app perfectly and still have no window. Before refusing, do the mending a user
190
+ # would otherwise be told to do by hand: approve the script and rebuild.
191
+ repair_electron() { # <app-dir>
192
+ local dir="$1"
193
+ command -v npm >/dev/null 2>&1 || return 1
194
+ ( cd "$dir" && npm install-scripts approve electron >/dev/null 2>&1 || true
195
+ cd "$dir" && npm rebuild electron >/dev/null 2>&1 )
196
+ }
187
197
  if ! ensure_electron_binary; then
188
- printf 'error: the Electron binary is missing (the package installed but its postinstall was blocked)\nhelp: cd apps/hlidskjalf && node node_modules/electron/install.js\nhelp: if npm blocks install scripts, run: npm install --foreground-scripts\n' >&2
189
- exit 1
198
+ # Try the mending ourselves before telling the user to do it by hand: npm's
199
+ # gating is the cause, and the cure is one command we can run.
200
+ echo "the Electron runtime is partial — mending it (npm rebuild electron)…" >&2
201
+ repair_electron "$APP" >/dev/null 2>&1 || true
202
+ ensure_electron_binary || {
203
+ printf 'error: the Electron runtime could not be mended\nhelp: cd <the app> && npm install-scripts approve electron && npm rebuild electron\nhelp: or run the web surfaces only: ymir install --no-desktop\n' >&2
204
+ exit 1
205
+ }
190
206
  fi
191
207
 
192
208
  app_dir() { case "$1" in odrerir) printf '%s' "$Odrerir_app" ;; *) printf '%s' "$APP" ;; esac; }
package/scripts/start.sh CHANGED
@@ -98,7 +98,22 @@ fi
98
98
  if [[ ! -d "$APP/node_modules" ]]; then
99
99
  style_patience "the seat's own dependencies are being fetched, then the hall is raised"
100
100
  echo "Installing dependencies…"
101
- (cd "$APP" && npm install --no-audit --no-fund)
101
+ (# Sessrúmnir the seat-hall. Its own Electron app (not a browser surface), so it
102
+ # rises here rather than with the SPA: four surfaces, one raise.
103
+ if [ -x "$ROOT/bin/sessrumnir.sh" ]; then
104
+ if app_dir sessrumnir APP_SESSRUMNIR; then
105
+ if "$ROOT/bin/sessrumnir.sh" start >/dev/null 2>&1; then
106
+ echo "Sessrúmnir — the seat-hall raised → (its own window)"
107
+ else
108
+ echo "Sessrúmnir — the seat-hall did not rise (run: bin/sessrumnir.sh start)" >&2
109
+ fi
110
+ else
111
+ echo "Sessrúmnir — NOT raised: the sessrumnir surface is missing from this install" >&2
112
+ echo "help: npm i -g @zerwiz/ymir (it is a dependency), or from a clone: bin/sessrumnir-ensure.sh install" >&2
113
+ fi
114
+ fi
115
+
116
+ cd "$APP" && npm install --no-audit --no-fund)
102
117
  fi
103
118
 
104
119
  # NOTE: when the SPA is already up we still raise the API and the services
@@ -201,18 +216,49 @@ app_dir odrerir HALL_DIR || HALL_DIR=""
201
216
  HALL_PORT="${ODRERIR_PORT:-4322}"
202
217
  HALL_PID_FILE="$RUN/odrerir.pid"
203
218
  HALL_LOG="$RUN/odrerir.log"
204
- if [ -d "$HALL_DIR" ]; then
205
- [ -d "$HALL_DIR/node_modules" ] || (cd "$HALL_DIR" && npm install --no-audit --no-fund >/dev/null 2>&1 || true)
219
+ if [ -d "$HALL_DIR" ] && [ -n "$HALL_DIR" ]; then
220
+ # Its dependencies are not optional and their absence is not silent: an Astro
221
+ # dev server without them dies with MODULE_NOT_FOUND while the raise claims it
222
+ # was "raised" — the failure the truth-telling above exists to prevent.
223
+ if [ ! -d "$HALL_DIR/node_modules" ]; then
224
+ echo "Óðrerir — fetching its dependencies…"
225
+ if ! (cd "$HALL_DIR" && npm install --no-audit --no-fund >/dev/null 2>&1); then
226
+ echo "Óðrerir — Live Hall NOT raised: its dependencies could not be installed" >&2
227
+ echo "help: (cd ${HALL_DIR#"$ROOT"/} && npm install)" >&2
228
+ HALL_DIR=""
229
+ fi
230
+ fi
231
+ fi
232
+ if [ -n "$HALL_DIR" ] && [ -d "$HALL_DIR" ]; then
206
233
  if [ -f "$HALL_PID_FILE" ] && kill -0 "$(cat "$HALL_PID_FILE")" 2>/dev/null; then
207
234
  echo "Óðrerir — Live Hall already running (pid $(cat "$HALL_PID_FILE")) → http://127.0.0.1:${HALL_PORT}/"
208
235
  else
209
- ymir_detach bash -c "cd '$HALL_DIR' && exec npm run dev -- --port '$HALL_PORT' --host" >"$HALL_LOG" 2>&1
236
+ # A packaged app ships a BUILD (odrerir's tarball carries dist/, and its dev
237
+ # command calls a script the tarball does not carry — so `npm run dev` could
238
+ # never work from a package). Serve the build where there is one; develop
239
+ # where there is not.
240
+ if [ -d "$HALL_DIR/dist" ]; then
241
+ ymir_detach bash -c "cd '$HALL_DIR' && exec npx --no-install astro preview --port '$HALL_PORT' --host" >"$HALL_LOG" 2>&1
242
+ else
243
+ ymir_detach bash -c "cd '$HALL_DIR' && exec npm run dev -- --port '$HALL_PORT' --host" >"$HALL_LOG" 2>&1
244
+ fi
210
245
  echo $! > "$HALL_PID_FILE"
211
- for _ in $(seq 1 30); do curl -s -o /dev/null "http://127.0.0.1:${HALL_PORT}/" && break; sleep 0.5; done
212
- echo "Óðrerir Live Hall raised (pid $(cat "$HALL_PID_FILE")) → http://127.0.0.1:${HALL_PORT}/"
246
+ _hall_up=0
247
+ for _ in $(seq 1 40); do
248
+ curl -s -o /dev/null "http://127.0.0.1:${HALL_PORT}/" && { _hall_up=1; break; }
249
+ kill -0 "$(cat "$HALL_PID_FILE")" 2>/dev/null || break
250
+ sleep 0.5
251
+ done
252
+ if [ "$_hall_up" = 1 ]; then
253
+ echo "Óðrerir — Live Hall raised (pid $(cat "$HALL_PID_FILE")) → http://127.0.0.1:${HALL_PORT}/"
254
+ else
255
+ echo "Óðrerir — Live Hall started (pid $(cat "$HALL_PID_FILE")) but :${HALL_PORT} did not answer — see $HALL_LOG" >&2
256
+ tail -5 "$HALL_LOG" >&2 2>/dev/null || true
257
+ fi
213
258
  fi
214
259
  else
215
- echo "Óðrerir — Live Hall skipped (the odrerir surface is not present)." >&2
260
+ echo "Óðrerir — NOT raised: the odrerir surface is missing from this install" >&2
261
+ echo "help: npm i -g @zerwiz/ymir (it is a dependency)" >&2
216
262
  fi
217
263
 
218
264
  cd "$APP"