ai-first-os 2.1.0 → 2.1.2
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/README.md +16 -14
- package/bin/ai-first-os.js +67 -8
- package/core/VERSION +1 -1
- package/core/lib/bootstrap.sh +21 -16
- package/core/lib/common.sh +97 -9
- package/core/lib/mount-repo.sh +5 -3
- package/core/lib/pack-install.sh +10 -1
- package/core/lib/recall.sh +15 -4
- package/core/lib/remote-backup.sh +60 -18
- package/core/manual/COMO-FUNCIONA.md +13 -0
- package/core/manual/HOW-IT-WORKS.md +13 -0
- package/core/skills/bootstrap.md +67 -36
- package/core/skills/mount-repo.md +3 -2
- package/core/skills/recall.md +6 -0
- package/core/templates/strings.md +72 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,23 +15,27 @@ This document is written for your agent to execute, not for you to follow step b
|
|
|
15
15
|
|
|
16
16
|
## Requirements
|
|
17
17
|
|
|
18
|
-
**Installing the system takes
|
|
19
|
-
— an agent that installs first and reads the error afterwards leaves you with
|
|
20
|
-
instead of an answer.
|
|
18
|
+
**Installing the system takes one thing: git. Python 3 is recommended.** They are checked before
|
|
19
|
+
anything runs — an agent that installs first and reads the error afterwards leaves you with
|
|
20
|
+
`command not found` instead of an answer.
|
|
21
21
|
|
|
22
22
|
| What | When it is needed | How the agent checks it | Where it comes from if it is missing |
|
|
23
23
|
|---|---|---|---|
|
|
24
24
|
| git | To install the system | `git --version` | macOS: `xcode-select --install` · Windows: git-scm.com |
|
|
25
|
-
| python3 |
|
|
25
|
+
| python3 | Recommended, not required — without it the install goes on and warns that two features are missing: connecting a code repository (`mount-repo`) and Living Memory search (`recall`). It is found as `python3`, `python` or `py -3` | `python3 --version` (or `python --version`, or `py -3 --version`) | macOS: `xcode-select --install` (same command as git) · Windows: python.org · Linux: your distro's package manager |
|
|
26
26
|
| Node.js | Only for the `npx` install path and for the pack of skills offered at the end of the install — installing the system by git clone never needs it | `node --version` | The LTS installer at nodejs.org |
|
|
27
27
|
|
|
28
28
|
**The agent guides; you install.** System software is never installed by the agent on its own: it
|
|
29
29
|
points at the official channel, waits for you to run it, and checks again.
|
|
30
30
|
|
|
31
|
-
**git has no path around it
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
**git has no path around it.** Every brain is versioned from the moment it exists — that is what gives
|
|
32
|
+
you an auditable history and updates you can undo — so nothing gets written until git is there.
|
|
33
|
+
Install it and say "run bootstrap" again; nothing you already answered is lost.
|
|
34
|
+
|
|
35
|
+
**Python 3 does not stop the install.** Without it the system installs completely and warns, once,
|
|
36
|
+
that two features will not be available: connecting a code repository (`mount-repo`) and Living Memory
|
|
37
|
+
search (`recall`; the AI searches files as plain text instead). Install Python from python.org later
|
|
38
|
+
and they start working; nothing needs to be reinstalled.
|
|
35
39
|
|
|
36
40
|
**Node is not a requirement of the git-clone path below, and that path never runs `npx`.** Node
|
|
37
41
|
belongs to two optional things: installing with `npx ai-first-os` instead of cloning, and the pack of
|
|
@@ -94,8 +98,8 @@ places, so updating them has two halves and both run:
|
|
|
94
98
|
1. **The system.** The agent goes to the local folder where the repository ended up, brings down the
|
|
95
99
|
newest version and runs `core/install.sh` from that folder.
|
|
96
100
|
2. **The pack**, if you installed it. The agent runs
|
|
97
|
-
`npx skills add pedroromeroluna/ai-first-product-skills` again, which replaces the skills in
|
|
98
|
-
published version. With no pack installed there is nothing to refresh, and this half is skipped.
|
|
101
|
+
`npx --yes skills add pedroromeroluna/ai-first-product-skills --agent claude-code --yes` again, which replaces the skills in
|
|
102
|
+
`.claude/skills/` with the published version. With no pack installed there is nothing to refresh, and this half is skipped.
|
|
99
103
|
|
|
100
104
|
Your brain —your workspaces, your decisions, your content— is not touched: the update only
|
|
101
105
|
refreshes the tools. And if the installer were run by mistake through the hook that is already
|
|
@@ -135,11 +139,10 @@ my-brain/
|
|
|
135
139
|
├── .os/
|
|
136
140
|
│ ├── core -> …/ai-first-os/core # The chassis by symlink: the eleven system skills in core/skills/, the shell in core/lib/
|
|
137
141
|
│ └── packs/<pack> -> … # Each installed pack, by symlink
|
|
138
|
-
├── .agents/skills/ # The pack's skills, left here by `npx skills add` (born with the first skill)
|
|
139
142
|
└── .claude/
|
|
140
143
|
├── CLAUDE.md # The same symlink as AGENTS.md: Claude Code reads the contract from here
|
|
141
144
|
├── agents/ # complete-spec, ambiguous-spec, scout — one symlink each
|
|
142
|
-
└── skills/ #
|
|
145
|
+
└── skills/ # The pack's skills, one folder each, left here by `npx skills add` (born with the first skill)
|
|
143
146
|
```
|
|
144
147
|
|
|
145
148
|
The interview writes `account/operator.md`, `account/voice/voice.md`, `.system/resolver.md`, `.system/tree.md` and `workspaces/personal/` —
|
|
@@ -153,8 +156,7 @@ needs instead of the whole register.
|
|
|
153
156
|
**Where the skills live.** The eleven skills of the system are not copied into your brain: they live
|
|
154
157
|
in `.os/core/skills/`, a symlink to the `core/` of the repository you brought down, and the agent
|
|
155
158
|
reaches them through the resolver. The skills of the pack are what `npx skills add` installs: one
|
|
156
|
-
folder per skill under `.
|
|
157
|
-
—the place Claude Code reads skills from, which is why they show up as `/cpo`, `/prd` and so on— plus
|
|
159
|
+
folder per skill under `.claude/skills/<name>/SKILL.md` —the place Claude Code reads skills from, which is why they show up as `/cpo`, `/prd` and so on— plus
|
|
158
160
|
`product-builder-resolver`, the pack's index. Your own skills, if you write any, go next to them as
|
|
159
161
|
plain folders in `.claude/skills/`.
|
|
160
162
|
|
package/bin/ai-first-os.js
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
// AI First OS launcher — this is what `npx ai-first-os` runs.
|
|
5
5
|
//
|
|
6
6
|
// It does three things, in this order, and nothing else:
|
|
7
|
-
// 1. checks git
|
|
8
|
-
// core/lib/bootstrap.sh
|
|
7
|
+
// 1. checks git is on PATH — the one hard requirement of the system, the same check
|
|
8
|
+
// core/lib/bootstrap.sh makes before writing anything. Python 3 is looked up by its three names
|
|
9
|
+
// (python3, python, py -3: the same order and the same test as os_python_find in
|
|
10
|
+
// core/lib/common.sh); without it the install goes on and prints a warning;
|
|
9
11
|
// 2. copies core/, README.md and LICENSE from this package to a fixed folder, ~/.ai-first-os,
|
|
10
12
|
// replacing whatever was already there — the npm cache this script runs from is reclaimed,
|
|
11
13
|
// so the system cannot keep living inside it;
|
|
@@ -31,6 +33,43 @@ function fail(message) {
|
|
|
31
33
|
process.exit(1);
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
// A candidate is accepted only if it runs and exits 0 exactly when its major version is 3. That
|
|
37
|
+
// leaves out the Microsoft Store shortcut (it fails) and a Python 2. Same order as os_python_find.
|
|
38
|
+
const PYTHON_PROBE = 'import sys; sys.exit(0 if sys.version_info[0] == 3 else 1)';
|
|
39
|
+
const PYTHON_CANDIDATES = [['python3'], ['python'], ['py', '-3']];
|
|
40
|
+
|
|
41
|
+
// Each probe has a deadline: a candidate that hangs counts as failed and the next one is tried.
|
|
42
|
+
const PROBE_TIMEOUT_MS = Number(process.env.AI_FIRST_OS_PROBE_TIMEOUT_MS) || 10000;
|
|
43
|
+
|
|
44
|
+
// Runs one probe of `argv` (command first). On Windows, a `.cmd` shim (pyenv-win and some managers)
|
|
45
|
+
// cannot be spawned directly: the spawn fails with ENOENT or EINVAL, and the probe is retried through
|
|
46
|
+
// `cmd.exe /d /s /c` with the line quoted. `.exe` candidates never reach that retry.
|
|
47
|
+
function runProbe(argv) {
|
|
48
|
+
const opts = { stdio: 'ignore', timeout: PROBE_TIMEOUT_MS };
|
|
49
|
+
let result = spawnSync(argv[0], argv.slice(1), opts);
|
|
50
|
+
if (result.error && process.platform === 'win32' && (result.error.code === 'ENOENT' || result.error.code === 'EINVAL')) {
|
|
51
|
+
const line = argv.map((a) => (/[\s"]/.test(a) ? '"' + a + '"' : a)).join(' ');
|
|
52
|
+
result = spawnSync(process.env.ComSpec || 'cmd.exe', ['/d', '/s', '/c', '"' + line + '"'], {
|
|
53
|
+
...opts,
|
|
54
|
+
windowsVerbatimArguments: true,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return !result.error && result.status === 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function findPython() {
|
|
61
|
+
for (const candidate of PYTHON_CANDIDATES) {
|
|
62
|
+
if (runProbe(candidate.concat(['-c', PYTHON_PROBE]))) return candidate.join(' ');
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Required by the evals (S080-C1) to run findPython alone; `npx` runs this file directly, never so.
|
|
68
|
+
if (require.main !== module) {
|
|
69
|
+
module.exports = { findPython };
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
34
73
|
if (!hasCommand('git')) {
|
|
35
74
|
fail(
|
|
36
75
|
'git is missing. Install it from the official channel (macOS: `xcode-select --install`; ' +
|
|
@@ -38,12 +77,29 @@ if (!hasCommand('git')) {
|
|
|
38
77
|
);
|
|
39
78
|
}
|
|
40
79
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
80
|
+
// Printed in both languages, English first: the brain does not exist yet, so its language is unknown.
|
|
81
|
+
const PYTHON_WARNING =
|
|
82
|
+
"Python 3 was not found \u2014 installing anyway. Without Python, 2 features won't be available:\n" +
|
|
83
|
+
' \u2022 Connecting a code repository (mount-repo).\n' +
|
|
84
|
+
' \u2022 Living Memory search (recall). The AI searches files as plain text instead: it can\'t put the\n' +
|
|
85
|
+
' current version of a document above a replaced one, open the exact section, or follow what a\n' +
|
|
86
|
+
' document is about or what replaced it.\n' +
|
|
87
|
+
'To get them: install Python (python.org). Nothing needs to be reinstalled.\n' +
|
|
88
|
+
'\n' +
|
|
89
|
+
'No se encontr\u00f3 Python 3: la instalaci\u00f3n sigue. Sin Python hay 2 funcionalidades que no vas a tener disponibles:\n' +
|
|
90
|
+
' \u2022 Conectar un repositorio de c\u00f3digo (mount-repo).\n' +
|
|
91
|
+
' \u2022 La b\u00fasqueda de Living Memory (recall). La IA busca en los archivos como texto com\u00fan: no puede\n' +
|
|
92
|
+
' poner la versi\u00f3n vigente de un documento por encima de una reemplazada, abrir la secci\u00f3n exacta\n' +
|
|
93
|
+
' ni seguir de qu\u00e9 trata un documento o qu\u00e9 lo reemplaz\u00f3.\n' +
|
|
94
|
+
'Para tenerlas: instal\u00e1 Python (python.org). No hace falta reinstalar nada.\n';
|
|
95
|
+
|
|
96
|
+
// The marker means "the launcher already warned during this install": it is deleted at the start of
|
|
97
|
+
// every run and written only when this run warns. A retry of the launcher warns again.
|
|
98
|
+
const warnedMarker = path.join(os.homedir(), '.ai-first-os', '.python-warned');
|
|
99
|
+
fs.rmSync(warnedMarker, { force: true });
|
|
100
|
+
const pythonFound = findPython() !== null;
|
|
101
|
+
if (!pythonFound) {
|
|
102
|
+
process.stderr.write(PYTHON_WARNING);
|
|
47
103
|
}
|
|
48
104
|
|
|
49
105
|
const packageRoot = path.join(__dirname, '..');
|
|
@@ -61,6 +117,8 @@ copyReplace('core');
|
|
|
61
117
|
copyReplace('README.md');
|
|
62
118
|
copyReplace('LICENSE');
|
|
63
119
|
|
|
120
|
+
if (!pythonFound) fs.writeFileSync(warnedMarker, 'The launcher warned that Python 3 was not found.\n');
|
|
121
|
+
|
|
64
122
|
const LOGO = [
|
|
65
123
|
' █████╗ ██╗ ███████╗██╗██████╗ ███████╗████████╗ ██████╗ ███████╗',
|
|
66
124
|
'██╔══██╗██║ ██╔════╝██║██╔══██╗██╔════╝╚══██╔══╝ ██╔═══██╗██╔════╝',
|
|
@@ -185,3 +243,4 @@ printLogo().then(() => {
|
|
|
185
243
|
);
|
|
186
244
|
process.stdout.write('Tell your agent: read and follow ' + bootstrapPath + '\n');
|
|
187
245
|
});
|
|
246
|
+
|
package/core/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.1.
|
|
1
|
+
2.1.2
|
package/core/lib/bootstrap.sh
CHANGED
|
@@ -62,13 +62,6 @@ done
|
|
|
62
62
|
command -v git > /dev/null 2>&1 \
|
|
63
63
|
|| os_die "falta git: instalalo desde el canal oficial (macOS: correr \`xcode-select --install\`; Windows: bajarlo de git-scm.com — lo instala el operador, nunca el agente) y volvé a correr este mismo comando — el bootstrap no escribió nada"
|
|
64
64
|
|
|
65
|
-
# python3 es requisito duro junto a git (spec 030): mount-repo lo necesita para autorizar el
|
|
66
|
-
# checkout que monta. Mismo patrón y mismo momento que el chequeo de git — la segunda verificación,
|
|
67
|
-
# todavía antes de crear ningún archivo. Con git ausente el mensaje de arriba ya frenó, así que este
|
|
68
|
-
# chequeo solo se alcanza con git presente.
|
|
69
|
-
command -v python3 > /dev/null 2>&1 \
|
|
70
|
-
|| os_die "falta python3: instalalo desde el canal oficial (macOS: correr \`xcode-select --install\`, el mismo comando que trae git; Windows: bajarlo de python.org; Linux: el gestor de paquetes de la distro) y volvé a correr este mismo comando — el bootstrap no escribió nada"
|
|
71
|
-
|
|
72
65
|
name=""
|
|
73
66
|
language=""
|
|
74
67
|
profile=""
|
|
@@ -109,14 +102,16 @@ os_append_kv() {
|
|
|
109
102
|
# - sin identidad de git configurada, el commit se firma con una identidad genérica del producto y
|
|
110
103
|
# se avisa: el respaldo vale más que la firma.
|
|
111
104
|
respaldo_local() {
|
|
112
|
-
local brain="$1" lang="$2"
|
|
105
|
+
local brain="$1" lang="$2" state
|
|
113
106
|
os_lang_load "$lang"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
107
|
+
state=$(os_brain_repo_state "$brain")
|
|
108
|
+
case "$state" in
|
|
109
|
+
inside\ *)
|
|
110
|
+
printf 'sin respaldo: el brain vive adentro del repo %s — un repo anidado no se crea solo; moverlo afuera o versionarlo a mano lo elige el operador\n' "${state#inside }"
|
|
111
|
+
return 0
|
|
112
|
+
;;
|
|
113
|
+
none) git -C "$brain" init -q ;;
|
|
114
|
+
esac
|
|
120
115
|
git -C "$brain" add -A
|
|
121
116
|
if git -C "$brain" commit -q -m "$S_FIRST_COMMIT" > /dev/null 2>&1; then
|
|
122
117
|
printf 'respaldo local: git init + primer commit\n'
|
|
@@ -183,10 +178,20 @@ elif ! os_language_valido "$language"; then
|
|
|
183
178
|
fi
|
|
184
179
|
os_lang_load "$language"
|
|
185
180
|
|
|
181
|
+
# Python 3 es recomendado, no obligatorio (spec 080; reemplaza el requisito duro de la spec 030). Se
|
|
182
|
+
# busca por sus tres nombres (`os_python_find`). Sin él el cerebro nace completo y el aviso dice, en el
|
|
183
|
+
# idioma del cerebro, qué dos funcionalidades no van a estar. La persona lo ve una sola vez por
|
|
184
|
+
# instalación: si el lanzador `npx` ya lo imprimió (antes de que existiera un cerebro, en los dos
|
|
185
|
+
# idiomas) dejó `.python-warned` en la raíz del producto instalado, y acá no se repite.
|
|
186
|
+
if ! os_python_find && [ ! -f "$here/../../.python-warned" ]; then
|
|
187
|
+
printf '%s\n' "$S_PYTHON_MISSING_WARNING" >&2
|
|
188
|
+
fi
|
|
189
|
+
|
|
186
190
|
templates="$here/../templates"
|
|
187
191
|
mkdir -p "$brain"
|
|
188
|
-
# Ruta física: `
|
|
189
|
-
#
|
|
192
|
+
# Ruta física: sin symlinks adentro (`/var` → `/private/var` en macOS), para que lo que se imprime
|
|
193
|
+
# y lo que git nombra sean la misma carpeta. Si el brain es la raíz de su repo lo decide
|
|
194
|
+
# `os_brain_repo_state`, no una comparación de rutas.
|
|
190
195
|
brain=$(cd "$brain" && pwd -P)
|
|
191
196
|
|
|
192
197
|
# El bootstrap crea; no rehace. Si las piezas de la raíz ya están, frena: reescribirlas borraría lo
|
package/core/lib/common.sh
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Funciones compartidas por los comandos de core/. Interno: no es invocable.
|
|
3
|
-
# Bash 3.2 en adelante. Sin dependencias fuera de bash + coreutils, con una excepción:
|
|
4
|
-
# —
|
|
5
|
-
#
|
|
3
|
+
# Bash 3.2 en adelante. Sin dependencias fuera de bash + coreutils, con una excepción: Python 3 (python3)
|
|
4
|
+
# —recomendado, no obligatorio desde la spec 080— lo usan `os_settings_authorize`, `mount-repo.sh` y
|
|
5
|
+
# `recall.sh`. Se busca con `os_python_find`, por sus tres nombres.
|
|
6
6
|
|
|
7
7
|
# Tope de identidad, en líneas. Única enunciación del número en el código distribuido.
|
|
8
8
|
OS_IDENTITY_CAP=40
|
|
@@ -252,6 +252,34 @@ os_language() {
|
|
|
252
252
|
fi
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
# os_brain_repo_state BRAIN -> prints one of: `root` (the brain is the root of its own git repo),
|
|
256
|
+
# `inside <toplevel>` (it lives inside another repo, named by its root) or `none` (no repo at all).
|
|
257
|
+
# The decision comes from `git rev-parse --show-prefix`, which is empty exactly at the root and does
|
|
258
|
+
# not depend on how a path is written: on Windows `--show-toplevel` answers `C:/...` while the
|
|
259
|
+
# shell's `pwd -P` answers `/c/...`, so the two never match as text (spec 081). The toplevel is
|
|
260
|
+
# only printed to name the outer repo, never compared against the brain's path.
|
|
261
|
+
# An empty prefix is also what git answers inside a repository's `.git` directory, which is not a
|
|
262
|
+
# worktree: there the brain is reported as inside that repository, named by its git directory, so
|
|
263
|
+
# neither caller treats it as its own root.
|
|
264
|
+
os_brain_repo_state() {
|
|
265
|
+
local brain="$1" prefix top
|
|
266
|
+
if ! prefix=$(git -C "$brain" rev-parse --show-prefix 2>/dev/null); then
|
|
267
|
+
printf 'none'
|
|
268
|
+
return 0
|
|
269
|
+
fi
|
|
270
|
+
if [ "$(git -C "$brain" rev-parse --is-inside-work-tree 2>/dev/null)" != "true" ]; then
|
|
271
|
+
top=$(git -C "$brain" rev-parse --absolute-git-dir 2>/dev/null) || top=""
|
|
272
|
+
printf 'inside %s' "$top"
|
|
273
|
+
return 0
|
|
274
|
+
fi
|
|
275
|
+
if [ -z "$prefix" ]; then
|
|
276
|
+
printf 'root'
|
|
277
|
+
return 0
|
|
278
|
+
fi
|
|
279
|
+
top=$(git -C "$brain" rev-parse --show-toplevel 2>/dev/null) || top=""
|
|
280
|
+
printf 'inside %s' "$top"
|
|
281
|
+
}
|
|
282
|
+
|
|
255
283
|
# os_lang_load IDIOMA
|
|
256
284
|
# Carga el catálogo `templates/strings.md` en variables `S_<CLAVE>`, y deja las claves leídas en
|
|
257
285
|
# `OS_STRING_KEYS`. Una clave sin su línea en el idioma pedido cae a `en` y lo dice por stderr: un
|
|
@@ -2221,9 +2249,61 @@ os_gitignore_ensure() {
|
|
|
2221
2249
|
return 0
|
|
2222
2250
|
}
|
|
2223
2251
|
|
|
2224
|
-
#
|
|
2225
|
-
#
|
|
2226
|
-
#
|
|
2252
|
+
# Python 3 por sus tres nombres (spec 080). Única enunciación del orden y de la prueba en bash;
|
|
2253
|
+
# `findPython` de ai-first-os.js (el lanzador de npx) la espeja. Orden: `python3`, `python`, `py -3` (el lanzador de Windows,
|
|
2254
|
+
# que deja `py` y `python` pero nunca `python3`). Un candidato se acepta solo si corre de verdad y
|
|
2255
|
+
# termina con éxito únicamente cuando su versión mayor es 3: así quedan afuera el atajo de la
|
|
2256
|
+
# Microsoft Store (falla) y un Python 2.
|
|
2257
|
+
# El comando queda en el arreglo `OS_PY` —una palabra o dos (`py -3`)—, y se corre siempre como
|
|
2258
|
+
# "${OS_PY[@]}" o con `os_py`, sin depender de que una cadena se parta en espacios.
|
|
2259
|
+
OS_PY=()
|
|
2260
|
+
OS_PYTHON_PROBE='import sys; sys.exit(0 if sys.version_info[0] == 3 else 1)'
|
|
2261
|
+
|
|
2262
|
+
# os_python_probe CMD... -> 0 si CMD (una o dos palabras) corre y es Python 3. Con `perl` en el PATH la
|
|
2263
|
+
# prueba tiene un plazo (OS_PYTHON_PROBE_TIMEOUT, 10 s por defecto): un candidato colgado cuenta como
|
|
2264
|
+
# fallo y se pasa al siguiente. Sin `perl` no hay plazo.
|
|
2265
|
+
os_python_probe() {
|
|
2266
|
+
if command -v perl > /dev/null 2>&1; then
|
|
2267
|
+
perl -e 'alarm shift; exec @ARGV' "${OS_PYTHON_PROBE_TIMEOUT:-10}" "$@" -c "$OS_PYTHON_PROBE" > /dev/null 2>&1
|
|
2268
|
+
else
|
|
2269
|
+
"$@" -c "$OS_PYTHON_PROBE" > /dev/null 2>&1
|
|
2270
|
+
fi
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
# os_python_find -> 0 y deja el comando en OS_PY; 1 y deja OS_PY vacío si ningún nombre sirve.
|
|
2274
|
+
os_python_find() {
|
|
2275
|
+
OS_PY=()
|
|
2276
|
+
if command -v python3 > /dev/null 2>&1 && os_python_probe python3; then
|
|
2277
|
+
OS_PY=(python3); return 0
|
|
2278
|
+
fi
|
|
2279
|
+
if command -v python > /dev/null 2>&1 && os_python_probe python; then
|
|
2280
|
+
OS_PY=(python); return 0
|
|
2281
|
+
fi
|
|
2282
|
+
if command -v py > /dev/null 2>&1 && os_python_probe py -3; then
|
|
2283
|
+
OS_PY=(py -3); return 0
|
|
2284
|
+
fi
|
|
2285
|
+
return 1
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
# os_python_cmd -> imprime el comando de Python 3 (`python3`, `python` o `py -3`); sin Python 3 no
|
|
2289
|
+
# imprime nada y sale 1. Para mostrarlo y para los evals; para correrlo, `os_py`.
|
|
2290
|
+
os_python_cmd() {
|
|
2291
|
+
( os_python_find && printf '%s' "${OS_PY[*]}" )
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
# os_py ARGS... -> corre Python 3 con ARGS (stdin y stdout pasan tal cual). Sale 127 sin escribir
|
|
2295
|
+
# nada si no hay Python 3. Busca una vez por proceso. Fuerza UTF-8 en la entrada y la salida: el Python
|
|
2296
|
+
# nativo de Windows usa la página de códigos ANSI en los pipes, que corrompe nombres de archivo con
|
|
2297
|
+
# tildes y rompe con `→` o emoji.
|
|
2298
|
+
os_py() {
|
|
2299
|
+
if [ "${#OS_PY[@]}" -eq 0 ]; then
|
|
2300
|
+
os_python_find || return 127
|
|
2301
|
+
fi
|
|
2302
|
+
PYTHONIOENCODING=utf-8 PYTHONUTF8=1 "${OS_PY[@]}" "$@"
|
|
2303
|
+
}
|
|
2304
|
+
|
|
2305
|
+
# El nombre del archivo de permisos del harness, relativo al brain (spec 030). Python 3 lo lee y
|
|
2306
|
+
# escribe (`os_py`); `mount-repo.sh` lo busca antes de escribir y frena sin él (spec 080).
|
|
2227
2307
|
OS_SETTINGS_ARCHIVO=".claude/settings.local.json"
|
|
2228
2308
|
|
|
2229
2309
|
# os_settings_authorize BRAIN RUTA
|
|
@@ -2235,11 +2315,12 @@ OS_SETTINGS_ARCHIVO=".claude/settings.local.json"
|
|
|
2235
2315
|
# 0 la agregó (el archivo pudo nacer o ya existir)
|
|
2236
2316
|
# 1 ya estaba
|
|
2237
2317
|
# 2 el archivo existe y no es JSON válido — no se tocó
|
|
2318
|
+
# 9 Python falló por otra razón (una excepción, no haber Python): nada se puede dar por autorizado
|
|
2238
2319
|
os_settings_authorize() {
|
|
2239
2320
|
local brain="$1" ruta="$2" archivo
|
|
2240
2321
|
archivo="$brain/$OS_SETTINGS_ARCHIVO"
|
|
2241
2322
|
mkdir -p "$(dirname "$archivo")" 2>/dev/null
|
|
2242
|
-
|
|
2323
|
+
os_py - "$archivo" "$ruta" <<'PY'
|
|
2243
2324
|
import json
|
|
2244
2325
|
import os
|
|
2245
2326
|
import sys
|
|
@@ -2264,7 +2345,7 @@ directorios = permisos.setdefault("additionalDirectories", [])
|
|
|
2264
2345
|
if not isinstance(directorios, list):
|
|
2265
2346
|
sys.exit(2)
|
|
2266
2347
|
if ruta in directorios:
|
|
2267
|
-
sys.exit(
|
|
2348
|
+
sys.exit(10)
|
|
2268
2349
|
directorios.append(ruta)
|
|
2269
2350
|
|
|
2270
2351
|
with open(archivo, "w", encoding="utf-8") as f:
|
|
@@ -2272,7 +2353,14 @@ with open(archivo, "w", encoding="utf-8") as f:
|
|
|
2272
2353
|
f.write("\n")
|
|
2273
2354
|
sys.exit(0)
|
|
2274
2355
|
PY
|
|
2275
|
-
|
|
2356
|
+
local rc=$?
|
|
2357
|
+
# Dentro de Python, 10 es «ya estaba»: un `exit 1` es el de una excepción sin atrapar, y no puede
|
|
2358
|
+
# leerse como «ya autorizado».
|
|
2359
|
+
case "$rc" in
|
|
2360
|
+
0|2) return "$rc" ;;
|
|
2361
|
+
10) return 1 ;;
|
|
2362
|
+
*) return 9 ;;
|
|
2363
|
+
esac
|
|
2276
2364
|
}
|
|
2277
2365
|
|
|
2278
2366
|
# os_now_ms -> milisegundos desde epoch.
|
package/core/lib/mount-repo.sh
CHANGED
|
@@ -32,9 +32,10 @@
|
|
|
32
32
|
#
|
|
33
33
|
# Exit: 0 montó o ya estaba · 2 argumentos o cabeza inválidos · 3 el remote no responde
|
|
34
34
|
# 4 la cabeza ya declara otro `repo:` · 5 la raíz de clonado falta o es inválida
|
|
35
|
-
# 6 falta `python3`
|
|
35
|
+
# 6 falta Python 3 —buscado como `python3`, `python` o `py -3`, spec 080—, necesario para autorizar el checkout (spec 030)
|
|
36
36
|
# 7 `--new` on a remote that does answer: there is nothing to create (spec 034)
|
|
37
37
|
# 8 `--new`: the birth of the repo failed — the message names why (spec 034)
|
|
38
|
+
# 9 Python 3 was found but the authorization of the checkout failed (spec 080): not an «already authorized»
|
|
38
39
|
#
|
|
39
40
|
# Nada se escribe antes de que las seis validaciones pasen —siete con `--new`, que suma la del
|
|
40
41
|
# destino—: una negativa a mitad de camino deja el nodo montado a medias, que es peor que no
|
|
@@ -106,7 +107,7 @@ remote_github_slug() {
|
|
|
106
107
|
printf '%s/%s' "$owner" "$name"
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
#
|
|
110
|
+
# Python 3 es necesario acá (spec 030, buscado por sus tres nombres desde la spec 080): el cuarto acto —autorizar el
|
|
110
111
|
# checkout para el harness— lo necesita para leer y escribir el JSON de settings.local.json. Se
|
|
111
112
|
# chequea antes de la primera escritura, con el mismo criterio que el resto de las validaciones.
|
|
112
113
|
# The language of what gets written is the brain's, declared once in `operator.md` (spec 021), and
|
|
@@ -115,7 +116,7 @@ remote_github_slug() {
|
|
|
115
116
|
language=$(os_language "$brain")
|
|
116
117
|
os_lang_load "$language"
|
|
117
118
|
|
|
118
|
-
|
|
119
|
+
os_python_find || {
|
|
119
120
|
printf '%s\n' "$S_MOUNT_NO_PYTHON3" >&2
|
|
120
121
|
printf '%s\n' "$S_MOUNT_NOTHING_WRITTEN" >&2
|
|
121
122
|
exit 6
|
|
@@ -498,6 +499,7 @@ case "$?" in
|
|
|
498
499
|
0) printf "$S_MOUNT_SETTINGS_ADDED\n" "$OS_SETTINGS_ARCHIVO" "$destino" ;;
|
|
499
500
|
1) printf "$S_MOUNT_SETTINGS_ALREADY\n" "$OS_SETTINGS_ARCHIVO" ;;
|
|
500
501
|
2) printf "$S_MOUNT_SETTINGS_INVALID\n" "$OS_SETTINGS_ARCHIVO" "$brain/$OS_SETTINGS_ARCHIVO" ;;
|
|
502
|
+
*) printf '%s\n' "$S_MOUNT_SETTINGS_FAILED" >&2; exit 9 ;;
|
|
501
503
|
esac
|
|
502
504
|
|
|
503
505
|
# La tabla no viaja: la frontera es el gitignore del brain, y la escribe el comando que crea el
|
package/core/lib/pack-install.sh
CHANGED
|
@@ -54,7 +54,12 @@ brain=$(cd "$brain" && pwd -P)
|
|
|
54
54
|
# El nombre del repo del pack: el fuente lleva el placeholder y el release lo resuelve al generar el
|
|
55
55
|
# chasis. El comando exacto se arma una sola vez acá y lo leen las tres salidas.
|
|
56
56
|
pack_repo="pedroromeroluna/ai-first-product-skills"
|
|
57
|
-
|
|
57
|
+
# Spec 081: no confirmation left to ask. `npx --yes` skips npx's own "Ok to proceed?" and the CLI's
|
|
58
|
+
# `--yes` skips its prompts; `--agent claude-code` names the destination, because with `--yes` and no
|
|
59
|
+
# agent the CLI installs to every agent it knows when it detects none (skills CLI 1.7.4: only
|
|
60
|
+
# `.claude/skills/` is written, plus `skills-lock.json` at the brain root). Still no `--all` and no
|
|
61
|
+
# `--skill '*'`.
|
|
62
|
+
comando="npx --yes skills add $pack_repo --agent claude-code --yes"
|
|
58
63
|
|
|
59
64
|
# Qué del pack ya está donde el CLI lo deja. No es una lista escrita: es lo que hay en el brain.
|
|
60
65
|
instalados=""
|
|
@@ -118,6 +123,10 @@ fi
|
|
|
118
123
|
# CLI lo saltea sin que nadie tenga que nombrarlo (spec 029). Nunca se instala para después borrar.
|
|
119
124
|
if command -v node > /dev/null 2>&1; then
|
|
120
125
|
printf 'node: %s\n' "$(node --version 2>/dev/null || printf 'presente')"
|
|
126
|
+
printf '%s\n' "$S_PACK_OFFER_QUESTION"
|
|
127
|
+
printf ' 1. %s\n' "$S_PACK_OPTION_INSTALL"
|
|
128
|
+
printf ' 2. %s\n' "$S_PACK_OPTION_LATER"
|
|
129
|
+
printf '%s\n' "$S_CHOICE_REPLY_WITH_NUMBER"
|
|
121
130
|
printf ' comando: %s\n' "$comando"
|
|
122
131
|
printf ' tal cual: sin --all y sin --skill "*", que bajan también lo que el chasis ya provee\n'
|
|
123
132
|
printf ' lo corre la sesión con el sí del operador, desde la carpeta del brain; este script nunca lo corre\n'
|
package/core/lib/recall.sh
CHANGED
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
# WHAT THIS COMMAND INDEXES. The index is `.os/living-memory.sqlite`, inside the brain: never
|
|
12
12
|
# committed (`.os/` is already in every brain's `.gitignore`, `os_gitignore_ensure`), and it is
|
|
13
13
|
# derived and discardable — deleting it just costs the next call a full reindex. It is written with
|
|
14
|
-
# `python3
|
|
15
|
-
#
|
|
14
|
+
# Python 3 (found by `os_python_find`: python3, python or py -3) and the `sqlite3` module of the
|
|
15
|
+
# standard library, using an FTS5 table: no dependency the product does not already carry (Python 3
|
|
16
|
+
# is recommended since spec 080, and the sqlite3
|
|
16
17
|
# that ships with the official installers of macOS, Windows and Linux carries FTS5).
|
|
17
18
|
#
|
|
18
19
|
# THE FILE LIST HAS ONE READER. `tree.md` has two classes of line since spec 007, and the only
|
|
@@ -54,7 +55,8 @@
|
|
|
54
55
|
#
|
|
55
56
|
# Exit: 0 the search or the expansion ran, with or without results/neighbours. 1 invalid arguments
|
|
56
57
|
# (missing/contradictory flags, no scope named). 2 the named workspace does not exist (same keys as
|
|
57
|
-
# `session-start.sh`).
|
|
58
|
+
# `session-start.sh`). 3 Python 3 is not available under any of its names (spec 080); 1 stays for a
|
|
59
|
+
# Python that is there and an index that failed.
|
|
58
60
|
#
|
|
59
61
|
# No `set -e`: a query with no results is not a failure.
|
|
60
62
|
|
|
@@ -215,9 +217,18 @@ stdin_data="$true_heads
|
|
|
215
217
|
%%FILES%%
|
|
216
218
|
$all_files"
|
|
217
219
|
|
|
218
|
-
|
|
220
|
+
# Python 3 se busca por sus tres nombres (spec 080). Sin él, un mensaje del catálogo y el código 3:
|
|
221
|
+
# distinto del 1, que sigue siendo "hay Python 3 y el índice falló".
|
|
222
|
+
os_python_find || {
|
|
223
|
+
printf '%s\n' "$S_RECALL_NO_PYTHON" >&2
|
|
224
|
+
exit 3
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
result=$(printf '%s\n' "$stdin_data" | os_py -B "$here/recall_index.py" \
|
|
219
228
|
"$db" "$brain" "$mode" "$scope_kind" "$wsdir" "$scope_slug" "$arg" "$limit")
|
|
220
229
|
rc=$?
|
|
230
|
+
# El Python de Windows termina las líneas con CRLF: sin sacar el \r, `grep -qx` no reconoce el centinela.
|
|
231
|
+
result=${result//$'\r'/}
|
|
221
232
|
if [ "$rc" != "0" ]; then
|
|
222
233
|
printf 'error: recall.sh could not run its index (python3/sqlite3)\n' >&2
|
|
223
234
|
exit 1
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# La conduce core/skills/bootstrap.md al cerrar el bootstrap, y la puede volver a correr cualquier
|
|
4
4
|
# sesión posterior — que es lo que la tarea pendiente del backlog le pide al operador.
|
|
5
5
|
#
|
|
6
|
-
# Uso: remote-backup.sh --brain DIR [--note]
|
|
6
|
+
# Uso: remote-backup.sh --brain DIR [--service github|bitbucket|other|none] [--note]
|
|
7
7
|
#
|
|
8
8
|
# El script NUNCA crea el repo ni pushea: eso escapa del sistema —queda algo en la cuenta de una
|
|
9
9
|
# persona— y se hace con la confirmación del operador en la sesión. Acá se decide cuál de las dos
|
|
@@ -15,8 +15,17 @@
|
|
|
15
15
|
# spec 076): con el sí del operador en ese turno, la sesión lo vuelve a correr con `--note`, que
|
|
16
16
|
# deja la tarea guiada en el backlog de la iniciativa tasks-to-sort del workspace personal.
|
|
17
17
|
#
|
|
18
|
-
#
|
|
19
|
-
#
|
|
18
|
+
# Spec 081: sin `--service` y sin `origin`, el script pregunta DÓNDE va el respaldo (GitHub, Bitbucket,
|
|
19
|
+
# otro servicio o ninguno): imprime la pregunta y las cuatro opciones del catálogo, no escribe nada y
|
|
20
|
+
# sale con 8; la sesión pregunta y vuelve a correr con `--service <lo elegido>`.
|
|
21
|
+
# - github: lo de arriba, sin cambios (gh, o BACKUP_TASK y exit 7);
|
|
22
|
+
# - bitbucket | other: no miran `gh`; imprimen BACKUP_TASK_GENERIC y la pregunta, exit 7; con
|
|
23
|
+
# `--note` la tarea queda en el backlog, igual que la de GitHub;
|
|
24
|
+
# - none: imprime BACKUP_NONE, exit 0, no escribe nada.
|
|
25
|
+
#
|
|
26
|
+
# Exit: 0 decidió (o anotó con --note, o `none`) · 1 si el brain no está versionado · 7 sin gh (o en
|
|
27
|
+
# Bitbucket/otro) y sin --note: la pregunta quedó impresa y no se escribió nada · 8 sin
|
|
28
|
+
# `--service`: la pregunta de dónde quedó impresa y no se escribió nada.
|
|
20
29
|
|
|
21
30
|
set -eu
|
|
22
31
|
|
|
@@ -25,23 +34,31 @@ here=$(cd "$(dirname "$0")" && pwd)
|
|
|
25
34
|
|
|
26
35
|
brain=""
|
|
27
36
|
note=0
|
|
37
|
+
service=""
|
|
28
38
|
|
|
29
39
|
while [ $# -gt 0 ]; do
|
|
30
40
|
case "$1" in
|
|
31
41
|
--brain) brain="$2"; shift 2 ;;
|
|
32
42
|
--note) note=1; shift ;;
|
|
43
|
+
--service) [ $# -ge 2 ] || os_die "falta el valor de --service"; service="$2"; shift 2 ;;
|
|
33
44
|
*) os_die "argumento desconocido: $1" ;;
|
|
34
45
|
esac
|
|
35
46
|
done
|
|
36
47
|
|
|
37
48
|
[ -n "$brain" ] || os_die "falta --brain"
|
|
49
|
+
# Las banderas mal usadas frenan antes de tocar nada (spec 081, C8).
|
|
50
|
+
case "$service" in
|
|
51
|
+
''|github|bitbucket|other|none) ;;
|
|
52
|
+
*) os_die "--service acepta github, bitbucket, other o none: $service" ;;
|
|
53
|
+
esac
|
|
54
|
+
if [ "$note" = "1" ] && [ -z "$service" ]; then os_die "--note necesita --service: sin saber dónde va el respaldo no hay tarea que anotar"; fi
|
|
55
|
+
if [ "$note" = "1" ] && [ "$service" = "none" ]; then os_die "--service none no anota nada: --note no aplica"; fi
|
|
38
56
|
[ -d "$brain" ] || os_die "no existe el brain: $brain"
|
|
39
57
|
# Ruta física: ver el comentario de bootstrap.sh.
|
|
40
58
|
brain=$(cd "$brain" && pwd -P)
|
|
41
59
|
|
|
42
60
|
command -v git > /dev/null 2>&1 || os_die "git no está en el PATH: sin respaldo local no hay remoto que armar"
|
|
43
|
-
|
|
44
|
-
if [ "$top" != "$brain" ]; then
|
|
61
|
+
if [ "$(os_brain_repo_state "$brain")" != "root" ]; then
|
|
45
62
|
os_die "el brain no es un repo git: el respaldo remoto va después del local"
|
|
46
63
|
fi
|
|
47
64
|
|
|
@@ -52,20 +69,48 @@ if [ -n "$remoto" ]; then
|
|
|
52
69
|
exit 0
|
|
53
70
|
fi
|
|
54
71
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
language=$(os_language "$brain")
|
|
73
|
+
os_lang_load "$language"
|
|
74
|
+
|
|
75
|
+
# Sin `--service`: la pregunta de dónde va el respaldo. No corre `gh`, no escribe nada, sale con 8.
|
|
76
|
+
if [ -z "$service" ]; then
|
|
77
|
+
printf '%s\n' "$S_BACKUP_WHERE_QUESTION"
|
|
78
|
+
printf ' 1. %s\n' "$S_BACKUP_OPTION_GITHUB"
|
|
79
|
+
printf ' 2. %s\n' "$S_BACKUP_OPTION_BITBUCKET"
|
|
80
|
+
printf ' 3. %s\n' "$S_BACKUP_OPTION_OTHER"
|
|
81
|
+
printf ' 4. %s\n' "$S_BACKUP_OPTION_NONE"
|
|
82
|
+
printf '%s\n' "$S_CHOICE_REPLY_WITH_NUMBER"
|
|
83
|
+
exit 8
|
|
61
84
|
fi
|
|
62
85
|
|
|
63
|
-
if [ "$
|
|
64
|
-
printf '
|
|
65
|
-
printf ' comando: gh repo create %s --private --source %s --push\n' "$(basename "$brain")" "$brain"
|
|
86
|
+
if [ "$service" = "none" ]; then
|
|
87
|
+
printf '%s\n' "$S_BACKUP_NONE"
|
|
66
88
|
exit 0
|
|
67
89
|
fi
|
|
68
90
|
|
|
91
|
+
# `gh auth status` solo lee. Ningún otro comando de `gh` corre desde acá, y solo con GitHub elegido.
|
|
92
|
+
if [ "$service" = "github" ]; then
|
|
93
|
+
autenticado=0
|
|
94
|
+
if command -v gh > /dev/null 2>&1; then
|
|
95
|
+
if gh auth status > /dev/null 2>&1; then
|
|
96
|
+
autenticado=1
|
|
97
|
+
fi
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
if [ "$autenticado" = "1" ]; then
|
|
101
|
+
printf 'respaldo remoto: gh autenticado — el repo lo crea el operador con su sí, nunca este script\n'
|
|
102
|
+
printf ' comando: gh repo create %s --private --source %s --push\n' "$(basename "$brain")" "$brain"
|
|
103
|
+
exit 0
|
|
104
|
+
fi
|
|
105
|
+
tarea="$S_BACKUP_TASK"
|
|
106
|
+
causa="sin gh autenticado"
|
|
107
|
+
else
|
|
108
|
+
# Bitbucket u otro servicio: pasos genéricos, sin `gh` ni github.com.
|
|
109
|
+
if [ "$service" = "bitbucket" ]; then nombre="$S_BACKUP_OPTION_BITBUCKET"; else nombre="$S_BACKUP_SERVICE_OTHER"; fi
|
|
110
|
+
tarea=$(printf "$S_BACKUP_TASK_GENERIC" "$nombre")
|
|
111
|
+
causa="el repositorio remoto lo crea el operador"
|
|
112
|
+
fi
|
|
113
|
+
|
|
69
114
|
# Sin gh no se puede armar el remoto hoy: la tarea queda en el backlog del espacio de trabajo
|
|
70
115
|
# `personal` (spec 059: la raíz ya no tiene backlog propio), con la guía adentro, y el que la termina
|
|
71
116
|
# es cualquier sesión posterior. Un pendiente que nadie escribe es un pendiente que nadie completa.
|
|
@@ -73,9 +118,6 @@ fi
|
|
|
73
118
|
# que pueda nombrar una iniciativa — armar el remoto de respaldo no es trabajo de ninguna. Va al
|
|
74
119
|
# backlog de la iniciativa `tasks-to-sort` del workspace `personal` (spec 076, C29). La escritura vive
|
|
75
120
|
# en `os_personal_backlog_append`.
|
|
76
|
-
language=$(os_language "$brain")
|
|
77
|
-
os_lang_load "$language"
|
|
78
|
-
tarea="$S_BACKUP_TASK"
|
|
79
121
|
if [ "$note" = "0" ]; then
|
|
80
122
|
printf "$S_NOTE_FOR_LATER_STEP\n" "$tarea"
|
|
81
123
|
printf '%s\n' "$S_NOTE_FOR_LATER_QUESTION"
|
|
@@ -86,7 +128,7 @@ os_ws_check "$brain"
|
|
|
86
128
|
rc=0
|
|
87
129
|
os_personal_backlog_append "$brain" "$tarea" || rc=$?
|
|
88
130
|
case "$rc" in
|
|
89
|
-
0) printf 'respaldo remoto: pendiente —
|
|
131
|
+
0) printf 'respaldo remoto: pendiente — %s, la tarea guiada quedó en el backlog de la iniciativa tasks-to-sort del workspace personal\n' "$causa" ;;
|
|
90
132
|
1) printf 'respaldo remoto: la tarea pendiente ya estaba en el backlog de la iniciativa tasks-to-sort del workspace personal\n' ;;
|
|
91
133
|
3) printf 'respaldo remoto: pendiente y sin escribir — el slug tasks-to-sort del workspace personal lo usa una iniciativa que trata sobre un nodo\n' ;;
|
|
92
134
|
*) printf 'respaldo remoto: pendiente y sin escribir — el workspace personal no existe todavía; correr migrate-root.sh y repetir\n' ;;
|
|
@@ -244,6 +244,19 @@ Cualquier skill que escribas vos va al lado, como carpeta común en `.claude/ski
|
|
|
244
244
|
> manual apunta ahí en vez de contarlo de nuevo, porque dos versiones del mismo procedimiento se
|
|
245
245
|
> separan.
|
|
246
246
|
|
|
247
|
+
## 🧰 Requisitos
|
|
248
|
+
|
|
249
|
+
**`git` es obligatorio; Python 3 es recomendado.** El sistema se instala sin Python y lo avisa cuando
|
|
250
|
+
pasa. Sin Python 3 hay dos cosas que no funcionan:
|
|
251
|
+
|
|
252
|
+
- **Conectar un repositorio de código** (`mount-repo`).
|
|
253
|
+
- **La búsqueda de Living Memory** (`recall`). La IA busca en los archivos como texto común: no puede
|
|
254
|
+
poner la versión vigente de un documento por encima de una reemplazada, abrir la sección exacta ni
|
|
255
|
+
seguir de qué trata un documento o qué lo reemplazó.
|
|
256
|
+
|
|
257
|
+
Para tenerlas, instalá Python desde python.org: el sistema lo encuentra como `python3`, `python` o
|
|
258
|
+
`py -3`. No hace falta reinstalar nada.
|
|
259
|
+
|
|
247
260
|
## 💬 Qué podés pedir, y cómo
|
|
248
261
|
|
|
249
262
|
**El índice es el resolver, no tu memoria.** Pedís con tus palabras —"qué hay pendiente", "cerrá la
|
|
@@ -233,6 +233,19 @@ them, as a plain folder in `.claude/skills/`.
|
|
|
233
233
|
> written once, in the `README.md` of the product's folder under **Update**; this manual points at
|
|
234
234
|
> it instead of telling it again, because two versions of the same procedure drift apart.
|
|
235
235
|
|
|
236
|
+
## 🧰 Requirements
|
|
237
|
+
|
|
238
|
+
**`git` is required; Python 3 is recommended.** The system installs without Python and says so when it
|
|
239
|
+
does. Without Python 3, two things do not work:
|
|
240
|
+
|
|
241
|
+
- **Connecting a code repository** (`mount-repo`).
|
|
242
|
+
- **Living Memory search** (`recall`). The AI searches the files as plain text instead: it cannot put
|
|
243
|
+
the current version of a document above a replaced one, open the exact section, or follow what a
|
|
244
|
+
document is about or what replaced it.
|
|
245
|
+
|
|
246
|
+
To get them, install Python from python.org: the system finds it as `python3`, `python` or `py -3`.
|
|
247
|
+
Nothing needs to be reinstalled.
|
|
248
|
+
|
|
236
249
|
## 💬 What you can ask for, and how
|
|
237
250
|
|
|
238
251
|
**The index is the resolver, not your memory.** You ask in your own words —"what is pending", "close
|
package/core/skills/bootstrap.md
CHANGED
|
@@ -20,27 +20,32 @@ what is missing:
|
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
git --version
|
|
23
|
-
python3 --version
|
|
23
|
+
python3 --version # or `python --version`, or `py -3 --version` on Windows
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
- **git missing**: macOS, `xcode-select --install`; Windows, git-scm.com.
|
|
27
|
-
- **
|
|
28
|
-
|
|
27
|
+
- **Python 3 missing** (under all of `python3`, `python` and `py -3`): python.org; macOS,
|
|
28
|
+
`xcode-select --install` — the same command that brings git; Linux, the distro's package manager.
|
|
29
|
+
It is recommended, not required: the install goes on without it.
|
|
29
30
|
|
|
30
|
-
**You guide; the operator installs.** You never install system software on your own
|
|
31
|
-
official channel, wait for them to run it, and check again.
|
|
31
|
+
**You guide; the operator installs.** You never install system software on your own. For **git**, you
|
|
32
|
+
name the official channel, wait for them to run it, and check again. For Python you wait for nothing
|
|
33
|
+
(see below). Anything they decline is a choice, not
|
|
32
34
|
an error: report it and take the branch below that matches.
|
|
33
35
|
|
|
34
|
-
**git has no path around it
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
**git has no path around it: there is no alternative branch for it.** If it is missing, stop right
|
|
37
|
+
there — point at the install channel, wait for the operator to run it, check again. `bootstrap.sh`
|
|
38
|
+
itself refuses to write anything without git, and re-running the same command once it is installed
|
|
39
|
+
picks the interview up cleanly.
|
|
40
|
+
|
|
41
|
+
**Python 3 does not stop the install (spec 080).** Without it `bootstrap.sh` prints a warning in the
|
|
42
|
+
brain's language and creates the full brain. Tell the operator the two things it costs: connecting a
|
|
43
|
+
code repository (`mount-repo`) and Living Memory search (`recall`; the AI searches files as plain
|
|
44
|
+
text instead). Then continue straight to the interview: do not ask them to install Python first, do not
|
|
45
|
+
wait for it, do not re-check it. Installing Python later needs no reinstall.
|
|
41
46
|
|
|
42
47
|
**Nothing else is checked here, and Node is not checked here on purpose.** Installing the system
|
|
43
|
-
needs git and
|
|
48
|
+
needs git and nothing more: no `npx`, no download from a registry, no npm prompt in the
|
|
44
49
|
middle of an install that has not written a single file yet. Node is the requirement of one later
|
|
45
50
|
step —the pack, offered at the close of this bootstrap— and it gets checked there, when it is the
|
|
46
51
|
thing being done.
|
|
@@ -155,23 +160,43 @@ them. Adding a second workspace to a brain that already exists is `new-workspace
|
|
|
155
160
|
`git init` and the first commit. Nothing to ask; a brain with no history loses work silently. git is
|
|
156
161
|
guaranteed present by the preflight in Step 0 — there is no unversioned brain to describe here.
|
|
157
162
|
|
|
158
|
-
**Remote, right after**, and it never runs alone:
|
|
163
|
+
**Remote, right after**, and it never runs alone. First the script asks where it goes:
|
|
159
164
|
|
|
160
165
|
```
|
|
161
166
|
.os/core/lib/remote-backup.sh --brain .
|
|
162
167
|
```
|
|
163
168
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
With no `origin` declared it prints the question, four numbered options (GitHub, Bitbucket, another
|
|
170
|
+
service, none) and "Reply with the number", writes nothing and exits 8. With an `origin` it prints
|
|
171
|
+
where the backup already is and exits 0: nothing to ask.
|
|
172
|
+
|
|
173
|
+
**Ask it as a multiple-choice question**: with the harness's multiple-choice tool if it has one (in
|
|
174
|
+
Claude Code, `AskUserQuestion`), using the question, labels and descriptions the script printed; if
|
|
175
|
+
it has none, show the numbered list the script printed, and a number is enough as the answer. Then
|
|
176
|
+
run `.os/core/lib/remote-backup.sh --brain . --service <github|bitbucket|other|none>` and follow what
|
|
177
|
+
it prints:
|
|
178
|
+
|
|
179
|
+
- **GitHub.** With `gh` authenticated it prints the offer and the exact `gh repo create` command.
|
|
180
|
+
**Ask the operator and run it only with their yes in that turn**: it leaves a repository in their
|
|
181
|
+
account, which escapes the system. Without `gh`, it writes nothing: it prints the pending step
|
|
182
|
+
(create the account at github.com —**the operator creates it, never the agent**—, run
|
|
183
|
+
`gh auth login`, and any later session finishes the rest by running the same script) and the
|
|
184
|
+
question to ask, and exits 7. Ask the operator the question it printed, in the brain's language
|
|
185
|
+
("Should I note it down for later?", from `NOTE_FOR_LATER_QUESTION` in the strings catalog).
|
|
186
|
+
**Only with their yes in that turn** run
|
|
187
|
+
`.os/core/lib/remote-backup.sh --brain . --service github --note`: the guided task lands in the
|
|
188
|
+
`personal` workspace, in its "Tasks to sort" initiative, created the first time. No yes: nothing
|
|
189
|
+
is written, and say so plainly ("I did not note anything down").
|
|
190
|
+
- **Bitbucket or another service.** The script never looks at `gh`: it prints the generic pending
|
|
191
|
+
step (the operator creates an empty private repository there, never the agent; then
|
|
192
|
+
`git remote add origin <repository address>` and `git push -u origin HEAD`) and the same question,
|
|
193
|
+
and exits 7. If the person already has the repository address, run those two `git` commands with
|
|
194
|
+
that address **only with their yes in that turn**. If they do not have it yet, ask the question the
|
|
195
|
+
script printed and, **only with their yes in that turn**, run
|
|
196
|
+
`.os/core/lib/remote-backup.sh --brain . --service <bitbucket|other> --note`. No yes: nothing is
|
|
197
|
+
written, and say so plainly.
|
|
198
|
+
- **None.** Run `--service none`: it says `BACKUP_NONE` ("No remote backup for now...") and writes
|
|
199
|
+
nothing, not even a note in the backlog.
|
|
175
200
|
|
|
176
201
|
Synced folders (iCloud, Drive) are not offered as backup: the system runs on symlinks and those
|
|
177
202
|
folders break them.
|
|
@@ -192,17 +217,21 @@ got installed.** Whoever came in through `npx ai-first-os` has Node by construct
|
|
|
192
217
|
the git-clone prompt may or may not.
|
|
193
218
|
|
|
194
219
|
- **Node present: one question, not two.** There is nothing to defer when the download can run right
|
|
195
|
-
now
|
|
220
|
+
now. The offer prints the question, two numbered options (Install, Later) and "Reply with the
|
|
221
|
+
number". **Ask it as a multiple-choice question**: with the harness's multiple-choice tool if it has
|
|
222
|
+
one (in Claude Code, `AskUserQuestion`), with the labels and descriptions the offer printed; if it
|
|
223
|
+
has none, show the numbered list it printed, and a number is enough as the answer:
|
|
196
224
|
|
|
197
225
|
> The craft on top —discovery, the metric brief, the interview that writes a product's strategic
|
|
198
|
-
> layer— travels in a pack of skills. Install it now?
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
What lands: one folder per skill
|
|
203
|
-
(`<pack>-resolver`), which is what the session
|
|
204
|
-
|
|
205
|
-
|
|
226
|
+
> layer— travels in a pack of skills. Install it now?
|
|
227
|
+
|
|
228
|
+
Install: run the command the offer printed, from the brain folder, **only with their yes in that turn**
|
|
229
|
+
(choosing Install is the yes). The command carries its own confirmations (`npx --yes`, the CLI's `--yes`) and names
|
|
230
|
+
its destination, so nothing else asks anything in the terminal. What lands: one folder per skill
|
|
231
|
+
under `.claude/skills/`, plus the pack's own index (`<pack>-resolver`), which is what the session
|
|
232
|
+
contract reads to route a request to the pack. The harness also offers those skills natively,
|
|
233
|
+
because that is where it looks for them. Later: leave it as is —
|
|
234
|
+
**nothing gets written to the backlog**; the same offer comes back the day a session needs a
|
|
206
235
|
capability of the pack that is not installed.
|
|
207
236
|
- **Node missing: the only exit is later.** Point at the LTS installer on nodejs.org — you guide, the
|
|
208
237
|
operator installs, and a no is an answer, not an error. Whether they install it right now or not,
|
|
@@ -218,8 +247,10 @@ the git-clone prompt may or may not.
|
|
|
218
247
|
system already provides travels marked internal in the pack, and the CLI skips it on its own — there
|
|
219
248
|
is no list to keep here, and nothing is ever installed and then deleted.
|
|
220
249
|
|
|
221
|
-
**If it fails —no network, registry down, the operator says no— the flow does not stop.** Retry once
|
|
222
|
-
|
|
250
|
+
**If it fails —no network, registry down, the operator says no— the flow does not stop.** Retry once,
|
|
251
|
+
and only for a technical failure: the command no longer asks before downloading, so a no from the
|
|
252
|
+
operator is never retried — it takes the later exit right away. If the retry fails too, take the
|
|
253
|
+
later exit above —the same question, and the note only with a yes— and say it out loud. A
|
|
223
254
|
bootstrap aborted halfway because a download failed is the worse outcome of the two.
|
|
224
255
|
|
|
225
256
|
## When it finishes
|
|
@@ -83,11 +83,12 @@ Running it twice on the same remote neither duplicates the row nor clones again.
|
|
|
83
83
|
| 3 | The remote does not answer | Check the remote and the permissions; if the repo does not exist yet, `--new` |
|
|
84
84
|
| 4 | The head already declares **another** `repo:` | It belongs to the operator: ask which one stays |
|
|
85
85
|
| 5 | The clone root is missing, or falls inside the brain or inside another repo; with `--new`, the destination is taken by something that is not this remote's repo, or `mounts.md` points this remote outside the clone root | Ask where the checkouts go; a destination or a row that is already there belongs to the operator |
|
|
86
|
-
| 6 |
|
|
86
|
+
| 6 | Python 3 is missing under all of its names (`python3`, `python`, `py -3`) — mounting needs it to authorize the checkout | Install it (python.org; macOS: `xcode-select --install`, the same command that brings git; Linux: the distro's package manager) and re-run |
|
|
87
87
|
| 7 | `--new` on a remote that **does** answer | There is nothing to create: mount it without `--new` |
|
|
88
88
|
| 8 | `--new`: the birth failed — the message names why | What the command had created gets removed, or it says what was left behind; fix what the message names and run it again |
|
|
89
|
+
| 9 | Python 3 was found but failed while authorizing the checkout (it is not read as «already authorized») | Fix Python (the message says so) and re-run the same command: the mount resumes |
|
|
89
90
|
|
|
90
|
-
In
|
|
91
|
+
In exits 2 to 8 nothing was written; exit 9 comes after the clone and the table, and re-running resumes it. A half-mounted node is worse than an unmounted one.
|
|
91
92
|
|
|
92
93
|
## When it finishes
|
|
93
94
|
|
package/core/skills/recall.md
CHANGED
|
@@ -57,6 +57,12 @@ Prints the head this file's `about:` names, the files whose `about:` names this
|
|
|
57
57
|
one's `superseded_by:` names, and the files whose `superseded_by:` names this one — one line each,
|
|
58
58
|
`<relation> · <path> · <title>`. One jump: what a neighbour itself declares is never followed.
|
|
59
59
|
|
|
60
|
+
## Exit codes
|
|
61
|
+
|
|
62
|
+
`0` ran, with or without results. `1` bad arguments, or Python 3 is there and the index failed. `2` the
|
|
63
|
+
named workspace does not exist. `3` Python 3 is not on this computer (not as `python3`, `python` or
|
|
64
|
+
`py -3`): the command says so and the session searches with `grep` instead.
|
|
65
|
+
|
|
60
66
|
## What it does not do
|
|
61
67
|
|
|
62
68
|
It does not read meaning across two matches, and it does not follow a chain of more than one jump.
|
|
@@ -442,6 +442,54 @@ key: BACKUP_TASK
|
|
|
442
442
|
en: Remote backup pending: create the account at github.com (the operator creates it, never the agent), run `gh auth login`, and then ask any session to run `.os/core/lib/remote-backup.sh --brain .`
|
|
443
443
|
es: Respaldo remoto pendiente: crear la cuenta en github.com (la crea el operador, nunca el agente), correr `gh auth login`, y después pedirle a cualquier sesión que corra `.os/core/lib/remote-backup.sh --brain .`
|
|
444
444
|
|
|
445
|
+
key: BACKUP_WHERE_QUESTION
|
|
446
|
+
en: Where should the remote backup of your brain live? It is a private copy outside this computer. If your brain will hold your company's information, use the service your company approved.
|
|
447
|
+
es: ¿Dónde querés el respaldo remoto de tu brain? Es una copia privada fuera de esta computadora. Si tu brain va a tener información de tu empresa, usá el servicio que tu empresa aprobó.
|
|
448
|
+
|
|
449
|
+
key: BACKUP_OPTION_GITHUB
|
|
450
|
+
en: GitHub
|
|
451
|
+
es: GitHub
|
|
452
|
+
|
|
453
|
+
key: BACKUP_OPTION_BITBUCKET
|
|
454
|
+
en: Bitbucket
|
|
455
|
+
es: Bitbucket
|
|
456
|
+
|
|
457
|
+
key: BACKUP_OPTION_OTHER
|
|
458
|
+
en: Another service — GitLab, Azure DevOps or your company's server
|
|
459
|
+
es: Otro servicio — GitLab, Azure DevOps o el servidor de tu empresa
|
|
460
|
+
|
|
461
|
+
key: BACKUP_OPTION_NONE
|
|
462
|
+
en: None for now — the local backup keeps working
|
|
463
|
+
es: Ninguno por ahora — el respaldo local sigue funcionando
|
|
464
|
+
|
|
465
|
+
key: BACKUP_TASK_GENERIC
|
|
466
|
+
en: Remote backup pending on %s: create an empty private repository there (the operator creates it, never the agent), then ask any session to connect it with `git remote add origin <repository address>` and `git push -u origin HEAD`.
|
|
467
|
+
es: Respaldo remoto pendiente en %s: crear ahí un repositorio privado y vacío (lo crea el operador, nunca el agente), y después pedirle a cualquier sesión que lo conecte con `git remote add origin <dirección del repositorio>` y `git push -u origin HEAD`.
|
|
468
|
+
|
|
469
|
+
key: BACKUP_SERVICE_OTHER
|
|
470
|
+
en: the service you chose
|
|
471
|
+
es: el servicio que elegiste
|
|
472
|
+
|
|
473
|
+
key: BACKUP_NONE
|
|
474
|
+
en: No remote backup for now. The local backup keeps working, and nothing was noted down.
|
|
475
|
+
es: Sin respaldo remoto por ahora. El respaldo local sigue funcionando y no se anotó nada.
|
|
476
|
+
|
|
477
|
+
key: PACK_OFFER_QUESTION
|
|
478
|
+
en: The craft on top —discovery, the metric brief, the interview that writes a product's strategic layer— travels in a pack of skills. Install it now?
|
|
479
|
+
es: El oficio de arriba —discovery, el brief de métricas, la entrevista que escribe la capa estratégica de un producto— viaja en un pack de skills. ¿Lo instalo ahora?
|
|
480
|
+
|
|
481
|
+
key: PACK_OPTION_INSTALL
|
|
482
|
+
en: Install — downloads the pack into this brain, with no other confirmation
|
|
483
|
+
es: Instalar — baja el pack a este brain, sin otra confirmación
|
|
484
|
+
|
|
485
|
+
key: PACK_OPTION_LATER
|
|
486
|
+
en: Later — everything else works without it, and nothing is noted down
|
|
487
|
+
es: Después — todo lo demás funciona sin él, y no se anota nada
|
|
488
|
+
|
|
489
|
+
key: CHOICE_REPLY_WITH_NUMBER
|
|
490
|
+
en: Reply with the number.
|
|
491
|
+
es: Contestá con el número.
|
|
492
|
+
|
|
445
493
|
key: REPO_INTRO
|
|
446
494
|
en: The body of an initiative: the specs, the decisions and the as-built of what gets built here.
|
|
447
495
|
en: The head —what it is for and what state it is in— lives in the brain that mounted this repo.
|
|
@@ -603,8 +651,30 @@ en: nothing was written.
|
|
|
603
651
|
es: no se escribió nada.
|
|
604
652
|
|
|
605
653
|
key: MOUNT_NO_PYTHON3
|
|
606
|
-
en:
|
|
607
|
-
es: falta
|
|
654
|
+
en: Python 3 is missing: install it from python.org (macOS: run `xcode-select --install`, the same command that brings git; Linux: your distro's package manager) and run this same command again. It is searched as python3, python or py -3.
|
|
655
|
+
es: falta Python 3: instalalo desde python.org (macOS: correr `xcode-select --install`, el mismo comando que trae git; Linux: el gestor de paquetes de la distro) y volvé a correr este mismo comando. Se busca como python3, python o py -3.
|
|
656
|
+
|
|
657
|
+
key: PYTHON_MISSING_WARNING
|
|
658
|
+
en: Python 3 was not found — installing anyway. Without Python, 2 features won't be available:
|
|
659
|
+
es: No se encontró Python 3: la instalación sigue. Sin Python hay 2 funcionalidades que no vas a tener disponibles:
|
|
660
|
+
en: • Connecting a code repository (mount-repo).
|
|
661
|
+
es: • Conectar un repositorio de código (mount-repo).
|
|
662
|
+
en: • Living Memory search (recall). The AI searches files as plain text instead: it can't put the
|
|
663
|
+
es: • La búsqueda de Living Memory (recall). La IA busca en los archivos como texto común: no puede
|
|
664
|
+
en: current version of a document above a replaced one, open the exact section, or follow what a
|
|
665
|
+
es: poner la versión vigente de un documento por encima de una reemplazada, abrir la sección exacta
|
|
666
|
+
en: document is about or what replaced it.
|
|
667
|
+
es: ni seguir de qué trata un documento o qué lo reemplazó.
|
|
668
|
+
en: To get them: install Python (python.org). Nothing needs to be reinstalled.
|
|
669
|
+
es: Para tenerlas: instalá Python (python.org). No hace falta reinstalar nada.
|
|
670
|
+
|
|
671
|
+
key: RECALL_NO_PYTHON
|
|
672
|
+
en: recall needs Python 3, which is not available on this computer. Search the brain with grep instead.
|
|
673
|
+
es: recall necesita Python 3, que no está en esta computadora. Buscá en el cerebro con grep.
|
|
674
|
+
|
|
675
|
+
key: MOUNT_SETTINGS_FAILED
|
|
676
|
+
en: Python 3 failed while authorizing the checkout for the agent: the mount is incomplete. Fix Python and run this same command again.
|
|
677
|
+
es: Python 3 falló al autorizar el checkout para el agente: el montaje quedó incompleto. Arreglá Python y volvé a correr este mismo comando.
|
|
608
678
|
|
|
609
679
|
key: MOUNT_HEAD_ABSOLUTE
|
|
610
680
|
en: the head is named relative to the brain: %s
|
package/package.json
CHANGED