lampson 0.5.3 → 0.5.4

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/lampson.ps1 CHANGED
@@ -79,12 +79,14 @@ while ($i -lt $args.Count) {
79
79
  $i++
80
80
  }
81
81
 
82
- # motor mínimo: `trust proxy` en el hub y los workspaces (0.6.42+), y las herramientas de la app usan --cap-set,
83
- # --no-env-file y http_sign (probados en 0.6.44). Con uno viejo el
84
- # hub ni arranca: mejor decirlo acá que dejar un 502
85
- $MinEngine = [version]"0.6.44"
82
+ # motor: el rango validado vive en synsema.json ("synsema", único lugar). Mínimo por el motor mismo; techo acá:
83
+ # un motor más nuevo puede cambiar reglas (junctions, module paths) y romper el hub o los workspaces. Se sube
84
+ # solo con la suite completa en verde (ver synsema.json).
85
+ $Fixed = [version]((Get-Content (Join-Path $here "synsema.json") -Raw | ConvertFrom-Json)."synsema")
86
86
  $engine = ((& synsema --version 2>$null) -replace '^\D*', '').Trim()
87
- if (-not ($engine -as [version]) -or [version]$engine -lt $MinEngine) { Write-Error "lampson necesita synsema $MinEngine o más nuevo (tenés '$engine'): synsema update"; exit 1 }
87
+ if (-not ($engine -as [version])) { Write-Error "no pude leer la versión de synsema (tenés '$engine'): sin synsema en el PATH lampson no arranca"; exit 1 }
88
+ if ([version]$engine -lt $Fixed) { Write-Error "lampson necesita synsema $Fixed o más nuevo (tenés '$engine'): synsema update"; exit 1 }
89
+ if ([version]$engine -gt $Fixed) { Write-Error "tenés synsema $engine y lampson está validado hasta $Fixed: npm i -g synsema@$Fixed (o actualizá lampson al release que la valida)"; exit 1 }
88
90
 
89
91
  # skills externas globales (npx skills add -g → ~/.agents/skills; Claude Code → ~/.claude/skills), montadas bajo .lampson\
90
92
  # (una capability no puede apuntar a HOME); los workspaces las ven por su junction .lampson\global
package/lampson.sh CHANGED
@@ -71,11 +71,22 @@ while [ $# -gt 0 ]; do
71
71
  shift
72
72
  done
73
73
  export LAMPSON_HOME="$here"
74
- # motor mínimo: `trust proxy` (0.6.42+) y, para las herramientas de la app, --cap-set, --no-env-file y http_sign (0.6.44)
75
- min_engine="0.6.44"
74
+ # motor: el rango validado vive en synsema.json ("synsema", único lugar). Mínimo por el motor mismo; techo acá:
75
+ # un motor más nuevo puede cambiar reglas (junctions, module paths) y romper el hub o los workspaces. Se sube
76
+ # solo con la suite completa en verde (ver synsema.json).
77
+ fixed="$(sed -n 's/.*"synsema"[[:space:]]*:[[:space:]]*"\([0-9.]*\)".*/\1/p' "$here/synsema.json" 2>/dev/null | head -n1)"
76
78
  engine="$(synsema --version 2>/dev/null | sed 's/^[^0-9]*//')"
77
- if [ -z "$engine" ] || [ "$(printf '%s\n%s\n' "$min_engine" "$engine" | sort -V | head -n1)" != "$min_engine" ]; then
78
- echo "lampson necesita synsema $min_engine o más nuevo (tenés '${engine:-ninguno}'): synsema update" >&2; exit 1
79
+ if [ -z "$fixed" ]; then
80
+ echo "no pude leer el campo \"synsema\" de $here/synsema.json" >&2; exit 1
81
+ fi
82
+ if [ -z "$engine" ]; then
83
+ echo "lampson necesita synsema $fixed (no hay synsema en el PATH)" >&2; exit 1
84
+ fi
85
+ if [ "$(printf '%s\n%s\n' "$fixed" "$engine" | sort -V | head -n1)" != "$fixed" ]; then
86
+ echo "lampson necesita synsema $fixed o más nuevo (tenés '$engine'): synsema update" >&2; exit 1
87
+ fi
88
+ if [ "$(printf '%s\n%s\n' "$fixed" "$engine" | sort -V | tail -n1)" != "$fixed" ]; then
89
+ echo "tenés synsema $engine y lampson está validado hasta $fixed: npm i -g synsema@$fixed (o actualizá lampson al release que la valida)" >&2; exit 1
79
90
  fi
80
91
  # skills externas globales, montadas bajo .lampson/ (los workspaces las ven por .lampson/global)
81
92
  mkdir -p "$here/.lampson"
@@ -177,9 +177,6 @@ task unlink(where_)
177
177
  run("rm", ["-f", where_], 10)
178
178
  give true
179
179
 
180
- task is_link_dir(p)
181
- give file_exists(p)
182
-
183
180
  -- crea una carpeta de la instalación (ruta absoluta: fuera del alcance de write_file, así que por exec)
184
181
  task ensure_dir(p)
185
182
  when is_win()
@@ -191,17 +188,18 @@ task ensure_dir(p)
191
188
  give true
192
189
 
193
190
  -- un link a la instalación (lib, public, skills, plugins, memory): se crea si falta y se REHACE si quedó colgante.
194
- -- file_exists da false tanto si no hay nada como si el link apunta a un destino que no existe (npm no trae
191
+ -- current_target da "" tanto si no hay nada como si el link apunta a un destino que no existe (npm no trae
195
192
  -- memory/ ni plugins/; un `ln -s` a una carpeta inexistente nace roto y después memory(write) muere con
196
- -- "No such file or directory" — visto en un VPS el 2026-09-02). Por eso: destino primero, link después, y si
197
- -- sigue sin resolverse es un error del workspace, no un silencio.
193
+ -- "No such file or directory" — visto en un VPS el 2026-09-02). Y con el mirror de rutas de synsema 0.6.45+
194
+ -- (2026-11-18) un file_exists del link se juzga por su destino real — fuera de toda grant del hub — así que la
195
+ -- existencia y el destino se preguntan por exec, nunca por file.
198
196
  export task ensure_link(where_, target)
199
- when file_exists(where_)
197
+ when current_target(where_) != ""
200
198
  give true
201
199
  unlink(where_)
202
200
  ensure_dir(target)
203
201
  link(where_, target)
204
- when not file_exists(where_)
202
+ when current_target(where_) == ""
205
203
  raise("could not link " + where_ + " → " + target + " (the workspace needs it: memory, plugins and the code live there)")
206
204
  give true
207
205
 
@@ -223,13 +221,15 @@ export task prepare(w)
223
221
  write_file(d + "/.lampson/.keep", "")
224
222
  when fresh
225
223
  migrate(w, d)
226
- -- el proyecto (si la junction apunta a otro lado — carpeta movida — se rehace)
224
+ -- el proyecto (si la junction apunta a otro lado — carpeta movida — se rehace). Por exec con current_target:
225
+ -- el mirror de rutas de synsema 0.6.45+ (2026-11-18) juzga un file_exists del link por su destino real,
226
+ -- que el hub no tiene concedido. "" = no existe o quedó colgante → se crea.
227
227
  let ws_link be d + "/workspace"
228
- when file_exists(ws_link)
229
- let target be current_target(ws_link)
230
- when target != "" and norm(target) != norm(w["path"])
231
- unlink(ws_link)
232
- when not file_exists(ws_link)
228
+ let target be current_target(ws_link)
229
+ when target != "" and norm(target) != norm(w["path"])
230
+ unlink(ws_link)
231
+ set target to ""
232
+ when target == ""
233
233
  when not link(ws_link, w["path"])
234
234
  raise("could not link " + ws_link + " → " + w["path"])
235
235
  each n in LINKS
@@ -292,6 +292,22 @@ task current_target(p)
292
292
  recover err
293
293
  give ""
294
294
 
295
+ -- el mirror de rutas de synsema 0.6.45+ (2026-11-18) refusa leer a través de las junctions del ws (el destino
296
+ -- real no está concedido al hub), así que el contenido del proyecto y de la instalación se mira por exec:
297
+ -- listado y texto sin capabilities de archivo sobre el destino (el patrón de browse()).
298
+ task sh_list(p)
299
+ let r be sh("cd '" + replace(p, "'", "") + "' 2>/dev/null && ls -1 2>/dev/null", 10)
300
+ give where(split(replace(text(r["stdout"]), "\r", ""), "\n"), (x) => trim(x) != "")
301
+
302
+ task sh_read(p)
303
+ try
304
+ let r be sh("cat '" + replace(p, "'", "") + "' 2>/dev/null", 10)
305
+ when trim(text(r["stdout"])) == ""
306
+ give nothing
307
+ give text(r["stdout"])
308
+ recover err
309
+ give nothing
310
+
295
311
  -- registra (si hace falta) y prepara el workspace de una carpeta → la entrada del registro
296
312
  export task ensure(path)
297
313
  require exec
@@ -802,11 +818,9 @@ export task channels_on_disk(w)
802
818
  let found be false
803
819
  each f in [dir_of(w["slug"]) + "/plugins/" + name + "/plugin.json", dir_of(w["slug"]) + "/workspace/.lampson/plugins/" + name + "/plugin.json"]
804
820
  when not found
805
- try
806
- when contains(read_file(f), "\"channel\"")
807
- set found to true
808
- recover err
809
- set found to found
821
+ let raw be sh_read(f)
822
+ when raw != nothing and contains(raw, "\"channel\"")
823
+ set found to true
810
824
  when found
811
825
  set n to n + 1
812
826
  recover err
@@ -843,7 +857,10 @@ export task tasks_summary(w)
843
857
  -- un plugin.json → lo que muestra /plugins (sin código ni techo: eso se revisa al encenderlo, dentro del proyecto)
844
858
  task plugin_card(dir, name, scope)
845
859
  try
846
- let m be json_decode(read_file(dir + "/" + name + "/plugin.json"))
860
+ let raw be sh_read(dir + "/" + name + "/plugin.json")
861
+ when raw == nothing
862
+ give nothing
863
+ let m be json_decode(raw)
847
864
  let tools be field(m, "tools")
848
865
  give {"name": name, "scope": scope, "description": text(field_or(m, "description", "")), "kind": text(field_or(m, "kind", "")), "channel": field(m, "channel") != nothing, "tools": when tools == nothing then [] otherwise apply(tools, (t) => t["name"]), "config": field_or(m, "config", []), "example": field(m, "example") == true}
849
866
  recover err
@@ -852,11 +869,10 @@ task plugin_card(dir, name, scope)
852
869
  task plugin_scan(dir, scope)
853
870
  let out be []
854
871
  try
855
- each e in list_dir(dir)
856
- when e["is_dir"]
857
- let card be plugin_card(dir, e["name"], scope)
858
- when card != nothing
859
- set out to append(out, card)
872
+ each name in sh_list(dir)
873
+ let card be plugin_card(dir, name, scope)
874
+ when card != nothing
875
+ set out to append(out, card)
860
876
  recover err
861
877
  give out
862
878
  give out
@@ -890,18 +906,16 @@ export task resolve_slug(name)
890
906
  -- equipos con rondas en el proyecto (leídos por el link workspace/ del ws: el hub no tiene permiso sobre el proyecto)
891
907
  export task teams_on_disk(w)
892
908
  let n be 0
893
- try
894
- let d be dir_of(w["slug"]) + "/workspace/.lampson/teams"
895
- each e in list_dir(d)
896
- when ends_with(e["name"], ".team.json")
897
- try
898
- let t be json_decode(read_file(d + "/" + e["name"]))
899
- when contains(t, "round_minutes") and t["round_minutes"] != nothing and number(t["round_minutes"]) > 0
900
- set n to n + 1
901
- recover err
902
- set n to n
903
- recover err
904
- give 0
909
+ let d be dir_of(w["slug"]) + "/workspace/.lampson/teams"
910
+ each name in sh_list(d)
911
+ when ends_with(name, ".team.json")
912
+ let doc be nothing
913
+ try
914
+ set doc to json_decode(sh_read(d + "/" + name))
915
+ recover err
916
+ set doc to nothing
917
+ when doc != nothing and contains(doc, "round_minutes") and doc["round_minutes"] != nothing and number(doc["round_minutes"]) > 0
918
+ set n to n + 1
905
919
  give n
906
920
 
907
921
  task api_keys_on_disk(w)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lampson",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "A coding agent written in Synsema: terminal + web, tools confined to the mounted project, plugins (your own tools, any language), LSP, MCP, sub-agents. Also an SDK: import { Lampson } from \"lampson\" (server or local mode).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -47,7 +47,7 @@
47
47
  "node": ">=18"
48
48
  },
49
49
  "dependencies": {
50
- "synsema": "^0.6.46"
50
+ "synsema": "0.6.64"
51
51
  },
52
52
  "scripts": {
53
53
  "test": "pwsh -NoProfile -File tests/run.ps1"