ai-first-os 2.4.0 → 2.4.1

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/core/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.0
1
+ 2.4.1
@@ -112,7 +112,23 @@ respaldo_local() {
112
112
  ;;
113
113
  none) git -C "$brain" init -q ;;
114
114
  esac
115
+ # `.os/` holds symlinks with absolute paths of this machine (spec 051). Whether git ignores them is
116
+ # asked to git, never read off the file: a negation (`!.os`), a `.gitignore` that is a folder or one
117
+ # that cannot be read all leave a line `.os` in the file and `.os/` in the commit. What git does not
118
+ # ignore is declared and kept out of the first commit.
119
+ local ruta rutas=".os/core" d os_ignorado=1
120
+ for d in "$brain"/.os/packs/*; do
121
+ [ -e "$d" ] || [ -L "$d" ] || continue
122
+ rutas="$rutas .os/packs/${d##*/}"
123
+ done
124
+ for ruta in $rutas; do
125
+ git -C "$brain" check-ignore -q "$ruta" > /dev/null 2>&1 || os_ignorado=0
126
+ done
115
127
  git -C "$brain" add -A
128
+ if [ "$os_ignorado" = "0" ]; then
129
+ git -C "$brain" rm -r -q --cached --ignore-unmatch .os > /dev/null 2>&1 || true
130
+ printf 'sin .gitignore: git no ignora .os (el .gitignore de %s no se pudo escribir, o una regla lo vuelve a incluir) — el primer commit deja .os/ afuera, y hay que ignorarlo a mano antes del próximo git add\n' "$brain"
131
+ fi
116
132
  if git -C "$brain" commit -q -m "$S_FIRST_COMMIT" > /dev/null 2>&1; then
117
133
  printf 'respaldo local: git init + primer commit\n'
118
134
  return 0
@@ -228,7 +244,20 @@ os_render "$templates/tree.md" "MANUAL=$OS_MANUAL_LINK" > "$brain/$OS_TREE_FILE"
228
244
 
229
245
  os_check_identity_cap "$brain/$OS_OPERATOR_FILE"
230
246
 
231
- printf '%s · %s · %s · %s\n' "$OS_OPERATOR_FILE" "$OS_VOICE_FILE" "$OS_ROOT_RESOLVER_FILE" "$OS_TREE_FILE"
247
+ # `.os` is the product's own folder (`.os/core` and `.os/packs/*` are symlinks with absolute paths of
248
+ # the machine that made them, broken on any other): the brain declares it in its `.gitignore` before
249
+ # the first commit below (spec 051). The entry is `.os`, the exact text `recall.sh` already writes;
250
+ # `os_gitignore_ensure` compares text, so another spelling would leave two lines. A `.gitignore` that
251
+ # was already there keeps its rules and is not one of the pieces that stop a second run.
252
+ # The output names `.gitignore` only when this run wrote it. `os_gitignore_ensure` answers 1 for
253
+ # "already there" and 0 even when its write failed, so the file is read back for the name; whether
254
+ # `.os/` ends up ignored is asked to git in `respaldo_local`, which declares it when it is not.
255
+ escrito="$OS_OPERATOR_FILE · $OS_VOICE_FILE · $OS_ROOT_RESOLVER_FILE · $OS_TREE_FILE"
256
+ if os_gitignore_ensure "$brain" ".os" > /dev/null 2>&1 \
257
+ && grep -qx '[[:space:]]*\.os[[:space:]]*' "$brain/.gitignore" 2>/dev/null; then
258
+ escrito="$escrito · .gitignore"
259
+ fi
260
+ printf '%s\n' "$escrito"
232
261
 
233
262
  # El manual se engancha por symlink al del producto: nace con el brain y se actualiza con el
234
263
  # producto, sin volver a correr nada.
@@ -9,7 +9,8 @@
9
9
  # with the same value, or only one, work the same; the two with different values stop with an error.
10
10
  #
11
11
  # WHAT THIS COMMAND INDEXES. The index is `.os/living-memory.sqlite`, inside the brain: never
12
- # committed (`.os/` is already in every brain's `.gitignore`, `os_gitignore_ensure`), and it is
12
+ # committed (`bootstrap.sh` writes `.os` into the `.gitignore` of a new brain since spec 051; this
13
+ # command still calls `os_gitignore_ensure` for the brains born before it), and it is
13
14
  # derived and discardable — deleting it just costs the next call a full reindex. It is written with
14
15
  # Python 3 (found by `os_python_find`: python3, python or py -3) and the `sqlite3` module of the
15
16
  # standard library, using an FTS5 table: no dependency the product does not already carry (Python 3
@@ -169,9 +170,10 @@ head_file=$(os_head_file "$brain") || true
169
170
 
170
171
  mkdir -p "$brain/.os" 2>/dev/null
171
172
  # The index never gets committed. `.os/` is meant to be gitignored everywhere it is used
172
- # (`.os/core` is the product's own symlink), but nothing before this spec had ever written the
173
- # entry — this is the first thing under `.os/` a brain accumulates on disk instead of just holding a
174
- # symlink, so the first call that would leave one is the one that makes sure the entry is there.
173
+ # (`.os/core` is the product's own symlink). A brain born since spec 051 already has the entry,
174
+ # written by `bootstrap.sh`, and this call is a no-op there; a brain born before it does not, and
175
+ # this is the first thing under `.os/` it accumulates on disk instead of just holding a symlink, so
176
+ # the first call that would leave one is the one that makes sure the entry is there.
175
177
  os_gitignore_ensure "$brain" ".os" > /dev/null 2>&1 || true
176
178
  db="$brain/.os/living-memory.sqlite"
177
179
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-first-os",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "A product operating system for working with agents. Install with npx, no clone required.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/pedroromeroluna/ai-first-os",