@milpa/comal 0.1.0 → 0.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.
Files changed (187) hide show
  1. package/README.md +30 -28
  2. package/backend/contracts/remote-commands-v1.json +125 -0
  3. package/bin/comal.mjs +16 -5
  4. package/docs/investigation.md +2 -2
  5. package/governance/chrome-task-v2.json +67 -0
  6. package/node_modules/@jitl/quickjs-ffi-types/LICENSE +21 -0
  7. package/node_modules/@jitl/quickjs-ffi-types/README.md +5 -0
  8. package/node_modules/@jitl/quickjs-ffi-types/dist/index.d.mts +549 -0
  9. package/node_modules/@jitl/quickjs-ffi-types/dist/index.d.ts +549 -0
  10. package/node_modules/@jitl/quickjs-ffi-types/dist/index.js +2 -0
  11. package/node_modules/@jitl/quickjs-ffi-types/dist/index.js.map +1 -0
  12. package/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs +2 -0
  13. package/node_modules/@jitl/quickjs-ffi-types/dist/index.mjs.map +1 -0
  14. package/node_modules/@jitl/quickjs-ffi-types/package.json +36 -0
  15. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/LICENSE +47 -0
  16. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/README.md +93 -0
  17. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.browser.d.ts +15 -0
  18. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.browser.mjs +2 -0
  19. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.cjs +2 -0
  20. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.cloudflare.cjs +2 -0
  21. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.cloudflare.d.ts +15 -0
  22. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.d.ts +15 -0
  23. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.mjs +2 -0
  24. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.wasm +0 -0
  25. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/emscripten-module.wasm.map +1 -0
  26. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.d.mts +94 -0
  27. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.d.ts +94 -0
  28. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.js +2 -0
  29. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.js.map +1 -0
  30. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.mjs +2 -0
  31. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/ffi.mjs.map +1 -0
  32. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.d.mts +20 -0
  33. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.d.ts +20 -0
  34. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.js +2 -0
  35. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.js.map +1 -0
  36. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.mjs +2 -0
  37. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/dist/index.mjs.map +1 -0
  38. package/node_modules/@jitl/quickjs-wasmfile-debug-asyncify/package.json +61 -0
  39. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/LICENSE +47 -0
  40. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/README.md +88 -0
  41. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.browser.d.ts +11 -0
  42. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.browser.mjs +5430 -0
  43. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.cjs +5485 -0
  44. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.cloudflare.cjs +5424 -0
  45. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.cloudflare.d.ts +11 -0
  46. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.d.ts +11 -0
  47. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.mjs +5541 -0
  48. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.wasm +0 -0
  49. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/emscripten-module.wasm.map +1 -0
  50. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.d.mts +85 -0
  51. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.d.ts +85 -0
  52. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.js +2 -0
  53. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.js.map +1 -0
  54. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.mjs +2 -0
  55. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/ffi.mjs.map +1 -0
  56. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.d.mts +20 -0
  57. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.d.ts +20 -0
  58. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.js +2 -0
  59. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.js.map +1 -0
  60. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.mjs +2 -0
  61. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/dist/index.mjs.map +1 -0
  62. package/node_modules/@jitl/quickjs-wasmfile-debug-sync/package.json +61 -0
  63. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/LICENSE +47 -0
  64. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/README.md +89 -0
  65. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.browser.d.ts +15 -0
  66. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.browser.mjs +26 -0
  67. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.cjs +25 -0
  68. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.cloudflare.cjs +25 -0
  69. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.cloudflare.d.ts +15 -0
  70. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.d.ts +15 -0
  71. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.mjs +30 -0
  72. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/emscripten-module.wasm +0 -0
  73. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.d.mts +94 -0
  74. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.d.ts +94 -0
  75. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.js +2 -0
  76. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.js.map +1 -0
  77. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.mjs +2 -0
  78. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/ffi.mjs.map +1 -0
  79. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.d.mts +20 -0
  80. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.d.ts +20 -0
  81. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.js +2 -0
  82. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.js.map +1 -0
  83. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.mjs +2 -0
  84. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/dist/index.mjs.map +1 -0
  85. package/node_modules/@jitl/quickjs-wasmfile-release-asyncify/package.json +61 -0
  86. package/node_modules/@jitl/quickjs-wasmfile-release-sync/LICENSE +47 -0
  87. package/node_modules/@jitl/quickjs-wasmfile-release-sync/README.md +82 -0
  88. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.d.ts +11 -0
  89. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.browser.mjs +22 -0
  90. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cjs +21 -0
  91. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.cjs +21 -0
  92. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.cloudflare.d.ts +11 -0
  93. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.d.ts +11 -0
  94. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.mjs +25 -0
  95. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/emscripten-module.wasm +0 -0
  96. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.mts +85 -0
  97. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.d.ts +85 -0
  98. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js +2 -0
  99. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.js.map +1 -0
  100. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs +2 -0
  101. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/ffi.mjs.map +1 -0
  102. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.mts +20 -0
  103. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.d.ts +20 -0
  104. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js +2 -0
  105. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.js.map +1 -0
  106. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs +2 -0
  107. package/node_modules/@jitl/quickjs-wasmfile-release-sync/dist/index.mjs.map +1 -0
  108. package/node_modules/@jitl/quickjs-wasmfile-release-sync/package.json +61 -0
  109. package/node_modules/quickjs-emscripten/LICENSE +21 -0
  110. package/node_modules/quickjs-emscripten/README.md +928 -0
  111. package/node_modules/quickjs-emscripten/dist/chunk-OHAYRCBA.mjs +2 -0
  112. package/node_modules/quickjs-emscripten/dist/chunk-OHAYRCBA.mjs.map +1 -0
  113. package/node_modules/quickjs-emscripten/dist/index.d.mts +57 -0
  114. package/node_modules/quickjs-emscripten/dist/index.d.ts +57 -0
  115. package/node_modules/quickjs-emscripten/dist/index.global.js +7309 -0
  116. package/node_modules/quickjs-emscripten/dist/index.js +2 -0
  117. package/node_modules/quickjs-emscripten/dist/index.js.map +1 -0
  118. package/node_modules/quickjs-emscripten/dist/index.mjs +2 -0
  119. package/node_modules/quickjs-emscripten/dist/index.mjs.map +1 -0
  120. package/node_modules/quickjs-emscripten/dist/variants.d.mts +39 -0
  121. package/node_modules/quickjs-emscripten/dist/variants.d.ts +39 -0
  122. package/node_modules/quickjs-emscripten/dist/variants.js +2 -0
  123. package/node_modules/quickjs-emscripten/dist/variants.js.map +1 -0
  124. package/node_modules/quickjs-emscripten/dist/variants.mjs +2 -0
  125. package/node_modules/quickjs-emscripten/dist/variants.mjs.map +1 -0
  126. package/node_modules/quickjs-emscripten/package.json +69 -0
  127. package/node_modules/quickjs-emscripten-core/LICENSE +21 -0
  128. package/node_modules/quickjs-emscripten-core/README.md +341 -0
  129. package/node_modules/quickjs-emscripten-core/README.template.md +70 -0
  130. package/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.mjs +2 -0
  131. package/node_modules/quickjs-emscripten-core/dist/chunk-TAV5CUKK.mjs.map +1 -0
  132. package/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.mjs +7 -0
  133. package/node_modules/quickjs-emscripten-core/dist/chunk-V2S4ZYJR.mjs.map +1 -0
  134. package/node_modules/quickjs-emscripten-core/dist/index.d.mts +2033 -0
  135. package/node_modules/quickjs-emscripten-core/dist/index.d.ts +2033 -0
  136. package/node_modules/quickjs-emscripten-core/dist/index.js +7 -0
  137. package/node_modules/quickjs-emscripten-core/dist/index.js.map +1 -0
  138. package/node_modules/quickjs-emscripten-core/dist/index.mjs +2 -0
  139. package/node_modules/quickjs-emscripten-core/dist/index.mjs.map +1 -0
  140. package/node_modules/quickjs-emscripten-core/dist/module-ES6BEMUI.mjs +2 -0
  141. package/node_modules/quickjs-emscripten-core/dist/module-ES6BEMUI.mjs.map +1 -0
  142. package/node_modules/quickjs-emscripten-core/dist/module-asyncify-2EFITU5U.mjs +2 -0
  143. package/node_modules/quickjs-emscripten-core/dist/module-asyncify-2EFITU5U.mjs.map +1 -0
  144. package/node_modules/quickjs-emscripten-core/package.json +49 -0
  145. package/package.json +6 -2
  146. package/src/agent.mjs +17 -6
  147. package/src/artifact-tools.mjs +3 -2
  148. package/src/auto-guard.mjs +5 -1
  149. package/src/cli.mjs +267 -201
  150. package/src/cloud-client.mjs +58 -8
  151. package/src/code-run-worker.mjs +70 -0
  152. package/src/code-run.mjs +97 -0
  153. package/src/codex-provider.mjs +28 -28
  154. package/src/compaction.mjs +1 -1
  155. package/src/goals.mjs +2 -2
  156. package/src/house.mjs +24 -24
  157. package/src/i18n/cli-es.mjs +97 -0
  158. package/src/i18n/es.mjs +227 -0
  159. package/src/i18n/index.mjs +48 -0
  160. package/src/image-attachments.mjs +263 -0
  161. package/src/model-controls.mjs +4 -4
  162. package/src/onboarding.mjs +91 -0
  163. package/src/openai-provider.mjs +24 -24
  164. package/src/peer-tools.mjs +4 -3
  165. package/src/permissions.mjs +53 -17
  166. package/src/provider-auth.mjs +30 -30
  167. package/src/provider-profiles.mjs +27 -27
  168. package/src/provider.mjs +30 -30
  169. package/src/remote-commands.mjs +11 -0
  170. package/src/remote-control.mjs +180 -0
  171. package/src/sessions.mjs +3 -3
  172. package/src/subagents.mjs +7 -3
  173. package/src/tool-packs.mjs +5 -2
  174. package/src/tools.mjs +92 -34
  175. package/src/tui/brand.mjs +2 -1
  176. package/src/tui/clipboard.mjs +5 -4
  177. package/src/tui/composer.mjs +77 -11
  178. package/src/tui/controller.mjs +111 -29
  179. package/src/tui/discovery.mjs +105 -100
  180. package/src/tui/markdown.mjs +10 -9
  181. package/src/tui/message-queue.mjs +27 -9
  182. package/src/tui/screen.mjs +209 -118
  183. package/src/vision.mjs +31 -3
  184. package/src/work-assertions.mjs +7 -7
  185. package/src/work-plan.mjs +189 -21
  186. package/src/work-recovery-proof.mjs +13 -1
  187. package/src/workflows/chrome-task.mjs +24 -7
package/README.md CHANGED
@@ -1,82 +1,84 @@
1
- # Instalar Comal
1
+ # Install Comal
2
2
 
3
- Comal es un cliente de terminal. Necesitas Node.js 22 o posterior y npm; para búsquedas de código instala también `rg` (ripgrep). No necesitas desplegar PHP, Docker ni el backend para usar la CLI. Los Artifacts privados usan la casa pública de Comal.
3
+ Comal is a terminal client. You need Node.js 22 or later and npm; for code searches also install `rg` (ripgrep). You do not need to deploy PHP, Docker, or the backend to use the CLI. Private Artifacts use Comal's public house.
4
4
 
5
- ## Arrancar con npx
5
+ ## Start with npx
6
6
 
7
- El paquete `@milpa/comal` incluye sus dependencias JavaScript; no tiene scripts de instalación y no contiene credenciales o sesiones del autor.
7
+ The `@milpa/comal` package includes its JavaScript dependencies; it has no installation scripts and contains no author credentials or sessions.
8
8
 
9
9
  ```sh
10
10
  npx @milpa/comal
11
11
  ```
12
12
 
13
- El primer arranque, sin conexión configurada, muestra cómo elegir demo, Codex o tu endpoint; no intenta usar el servidor privado del autor. Usa la misma invocación en lugar de `comal` para los ejemplos de abajo. npm conserva su caché; el estado y las credenciales de Comal quedan en tu workspace y tu configuración, fuera de esa caché.
13
+ An interactive first start opens setup inside the TUI. Press Enter to try the offline demo, choose Codex to authorize the subscription in your browser, or enter an OpenAI-compatible endpoint and let Comal discover its model. A failed connection returns to setup in the same terminal. Successful connection routing is remembered in `~/.config/comal/connection.json` (or `$XDG_CONFIG_HOME/comal/connection.json`); keys are never stored there. Explicit flags, environment settings, profiles and resumed sessions take precedence. Noninteractive invocations retain plain output.
14
14
 
15
- ## Dejar el comando global comal
15
+ npm keeps its cache; Comal's state and credentials remain in your workspace and your configuration, outside that cache. No repository checkout is required.
16
+
17
+ ## Make the global comal command
16
18
 
17
19
  ```sh
18
20
  npm install --global --ignore-scripts @milpa/comal
19
21
 
20
- # Si tu prefijo global requiere permisos, usa un prefijo de tu usuario:
22
+ # If your global prefix requires permissions, use a user prefix:
21
23
  # npm install --global --prefix "$HOME/.local" --ignore-scripts @milpa/comal
22
24
  export PATH="$HOME/.local/bin:$PATH"
23
25
  comal --version
24
26
  comal --help
25
27
  ```
26
28
 
27
- Conserva la línea de PATH en el archivo de inicio de tu shell si utilizas ese prefijo. Si tu gestor de Node ya proporciona un prefijo de usuario, puedes omitir `--prefix "$HOME/.local"`. El paquete registra el ejecutable `comal`; no necesitas crear un alias de shell.
29
+ Keep the PATH line in your shell startup file if you use that prefix. If your Node manager already provides a user prefix, you can omit `--prefix "$HOME/.local"`. The package registers the `comal` executable; you do not need to create a shell alias.
28
30
 
29
- Puedes fijar una versión con `npx @milpa/comal@0.1.0` o `npm install --global @milpa/comal@0.1.0`. El manifiesto local de release conserva SHA-256 y la integridad SHA-512 se coteja con npm al publicar. No se afirma una firma independiente del editor.
31
+ You can pin a version with `npx @milpa/comal@0.1.2` or `npm install --global @milpa/comal@0.1.2`. The local release manifest preserves SHA-256 and SHA-512 integrity is checked against npm at publish time. No independent publisher signature is claimed.
30
32
 
31
- ## Probar sin cuenta ni modelo
33
+ ## Test without account or model
32
34
 
33
35
  ```sh
34
36
  mkdir -p "$HOME/comal-practica"
35
37
  cd "$HOME/comal-practica"
36
- comal --demo -p 'Muestra el ciclo de herramientas'
38
+ comal --demo -p 'Show the tool cycle'
37
39
  comal sessions
38
40
  ```
39
41
 
40
- La demo es un guion determinista que usa herramientas reales y crea un archivo de práctica. No es inferencia ni requiere pago. Tus sesiones se guardan en el workspace, fuera de la instalación.
42
+ The demo is a deterministic script that uses real tools and creates a practice file. It is not inference and does not require payment. Your sessions are saved in the workspace, outside the installation.
41
43
 
42
- ## Conectar tu modelo
44
+ ## Connect your model
43
45
 
44
- El endpoint heredado del entorno original es `http://llama.local:11438/`; pertenece a esa red y no se incluye un modelo con Comal. Selecciona explícitamente tu conexión:
46
+ The legacy endpoint from the original environment is `http://llama.local:11438/`; it belongs to that network and no model is included with Comal. Explicitly select your connection:
45
47
 
46
48
  ```sh
47
- # Servidor compatible con OpenAI que ya tengas funcionando.
48
- comal --base-url http://127.0.0.1:8080/v1 --model TU_MODELO --name residente
49
+ # OpenAI-compatible server you already have running.
50
+ comal --base-url http://127.0.0.1:8080/v1 --model YOUR_MODEL --name resident
49
51
 
50
- # O tu acceso Codex compatible: autenticación y selección son pasos distintos.
52
+ # Or your compatible Codex access: authentication and selection are separate steps.
51
53
  comal login codex
52
- comal --auth-provider codex --name residente
54
+ comal --auth-provider codex --name resident
53
55
  ```
54
56
 
55
- Para APIs configura la clave mediante el entorno o tu gestor de secretos. No la pegues en el composer ni como argumento. Consulta https://comal.milpahq.com/academy/docs/modelos/ y https://comal.milpahq.com/academy/docs/login/ para perfiles y proveedores.
57
+ For APIs, set the key via the environment or your secrets manager. Do not paste it in the composer or as an argument. See https://comal.milpahq.com/academy/docs/modelos/ and https://comal.milpahq.com/academy/docs/login/ for profiles and providers.
56
58
 
57
- ## Conectar tu cuenta de Artifacts
59
+ ## Connect your Artifacts account
58
60
 
59
61
  ```sh
60
62
  comal cloud login
61
63
  comal cloud status
62
64
  ```
63
65
 
64
- Abre la URL que imprime Comal, entra con Google o GitHub y aprueba esa CLI. Esta cuenta autoriza Artifacts; es independiente del login y la facturación de tu modelo. Tus credenciales quedan en archivos privados de tu usuario, nunca en el paquete.
66
+ Open the URL that Comal prints, sign in with Google or GitHub, and approve that CLI. In the current TUI you can also use `/cloud login`, or discover it with F6. `/rc` offers this login inline when needed and then opens the private remote session. Escape cancels login and returns to your composer. This account authorizes Artifacts and Remote Control; it is independent of your model login and billing. Your credentials remain in private files in your user directory, never in the package.
65
67
 
66
- ## Actualizar o quitar
68
+ ## Update or remove
67
69
 
68
- Instala `@milpa/comal@VERSION` con el mismo comando y prefijo. Comprueba `comal --version`. No hay actualización silenciosa.
70
+ Use `npx @milpa/comal@latest` for the latest release, or pin `npx @milpa/comal@VERSION`. For the optional global command, run `npm install --global @milpa/comal@latest` with the same prefix. Check `comal --version`. There is no silent update.
69
71
 
70
72
  ```sh
71
73
  npm uninstall --global @milpa/comal
72
74
  ```
73
75
 
74
- Esto retira el cliente; conserva las sesiones de los proyectos y las credenciales del usuario. Para desconectar Artifacts antes de quitarlo usa `comal cloud logout`; los proveedores tienen su propio `comal logout PROVEEDOR`.
76
+ This removes the client; it keeps project sessions and user credentials. To disconnect Artifacts before removing it, use `comal cloud logout`; providers have their own `comal logout PROVIDER`.
75
77
 
76
- ## Alcance de esta primera distribución
78
+ ## Scope of this first distribution
77
79
 
78
- La instalación se comprueba en Linux, desde un prefijo y un HOME vacíos. macOS y Windows mediante WSL2 son rutas pendientes de verificación en esos entornos; no se afirma soporte de Windows nativo. Chrome Lab requiere configurar tu propio host SSH/CDP. El paquete no concede acceso al laboratorio del autor.
80
+ Installation is verified on Linux, from an empty prefix and HOME. macOS and Windows via WSL2 are paths pending verification in those environments; native Windows support is not claimed. Chrome Lab requires configuring your own SSH/CDP host. The package does not grant access to the author's lab.
79
81
 
80
- El paquete pertenece a la organización npm `@milpa`. `npx comal` corresponde a otro proyecto; usa el nombre completo `npx @milpa/comal`. Una licencia pública, instaladores nativos y firma del editor se resolverán por separado con el mantenedor. Documentación completa: https://comal.milpahq.com/academy/ .
82
+ The package belongs to the npm organization `@milpa`. `npx comal` corresponds to another project; use the full name `npx @milpa/comal`. A public license, native installers, and publisher signature will be resolved separately with the maintainer. Full documentation: https://comal.milpahq.com/academy/ .
81
83
 
82
- El transporte de tarballs y las dependencias incluidas usan los mecanismos documentados de [npm install](https://docs.npmjs.com/cli/v12/commands/npm-install/) y [bundledDependencies](https://docs.npmjs.com/files/package.json/).
84
+ Tarball transport and bundled dependencies use the documented mechanisms of [npm install](https://docs.npmjs.com/cli/v12/commands/npm-install/) and [bundledDependencies](https://docs.npmjs.com/files/package.json/).
@@ -0,0 +1,125 @@
1
+ {
2
+ "protocol": "comal.remote.commands.v1",
3
+ "commands": [
4
+ {
5
+ "name": "help",
6
+ "arguments": "",
7
+ "description": "Commands available from this browser",
8
+ "argument_pattern": ""
9
+ },
10
+ {
11
+ "name": "status",
12
+ "arguments": "",
13
+ "description": "Session, provider and budget",
14
+ "argument_pattern": ""
15
+ },
16
+ {
17
+ "name": "context",
18
+ "arguments": "",
19
+ "description": "Context budget and provenance",
20
+ "argument_pattern": ""
21
+ },
22
+ {
23
+ "name": "tools",
24
+ "arguments": "",
25
+ "description": "Current tool catalog",
26
+ "argument_pattern": ""
27
+ },
28
+ {
29
+ "name": "house",
30
+ "arguments": "",
31
+ "description": "Receipts and interrupted operations",
32
+ "argument_pattern": ""
33
+ },
34
+ {
35
+ "name": "operations",
36
+ "arguments": "",
37
+ "description": "Operation contracts and effects",
38
+ "argument_pattern": ""
39
+ },
40
+ {
41
+ "name": "state",
42
+ "arguments": "",
43
+ "description": "Request and current work",
44
+ "argument_pattern": ""
45
+ },
46
+ {
47
+ "name": "audit",
48
+ "arguments": "",
49
+ "description": "Verify the local ledger",
50
+ "argument_pattern": ""
51
+ },
52
+ {
53
+ "name": "board",
54
+ "arguments": "",
55
+ "description": "Task board",
56
+ "argument_pattern": ""
57
+ },
58
+ {
59
+ "name": "work",
60
+ "arguments": "[resume|recover]",
61
+ "description": "Inspect or continue accepted work",
62
+ "argument_pattern": "(?:resume|recover)?"
63
+ },
64
+ {
65
+ "name": "compact",
66
+ "arguments": "",
67
+ "description": "Derive context without an LLM",
68
+ "argument_pattern": ""
69
+ },
70
+ {
71
+ "name": "models",
72
+ "arguments": "",
73
+ "description": "List models advertised by this provider",
74
+ "argument_pattern": ""
75
+ },
76
+ {
77
+ "name": "model",
78
+ "arguments": "[ID]",
79
+ "description": "Inspect or change the model at the next queue boundary",
80
+ "argument_pattern": "[^\\s\\x00-\\x1f]{1,160}"
81
+ },
82
+ {
83
+ "name": "effort",
84
+ "arguments": "[LEVEL]",
85
+ "description": "Inspect or change reasoning effort",
86
+ "argument_pattern": "(?:auto|none|minimal|low|medium|high|xhigh|max)"
87
+ },
88
+ {
89
+ "name": "capabilities",
90
+ "arguments": "[refresh]",
91
+ "description": "Model capability support and provenance",
92
+ "argument_pattern": "(?:refresh)?"
93
+ },
94
+ {
95
+ "name": "plugins",
96
+ "arguments": "[status|list]",
97
+ "description": "Inspect plugins",
98
+ "argument_pattern": "(?:status|list)?"
99
+ },
100
+ {
101
+ "name": "mcp",
102
+ "arguments": "[status|list]",
103
+ "description": "Inspect connected MCP servers",
104
+ "argument_pattern": "(?:status|list)?"
105
+ },
106
+ {
107
+ "name": "agents",
108
+ "arguments": "",
109
+ "description": "Inspect child runs",
110
+ "argument_pattern": ""
111
+ }
112
+ ],
113
+ "local_only": [
114
+ "permissions",
115
+ "login",
116
+ "logout",
117
+ "cloud",
118
+ "resume",
119
+ "clear",
120
+ "exit",
121
+ "quit",
122
+ "rc",
123
+ "remote-control"
124
+ ]
125
+ }
package/bin/comal.mjs CHANGED
@@ -1,21 +1,32 @@
1
1
  #!/usr/bin/env node
2
2
  try {
3
- const args=process.argv.slice(2);
3
+ const originalArgs=process.argv.slice(2);
4
4
  const {readFile,access}=await import('node:fs/promises');
5
5
  const {default:path}=await import('node:path');
6
6
  const pkg=JSON.parse(await readFile(new URL('../package.json',import.meta.url),'utf8'));
7
+ // Exact version checks remain independent of CLI modules and UI configuration.
8
+ if(originalArgs.length===1 && ['--version','-v'].includes(originalArgs[0])) {
9
+ process.stdout.write(`Comal ${pkg.version}\n`);
10
+ } else if(pkg.name!=='@milpa/comal') {
11
+ const {main}=await import('../src/cli.mjs');
12
+ process.exitCode=await main(originalArgs);
13
+ } else {
14
+ const {t,configureLanguage,languageArguments}=await import('../src/i18n/index.mjs');
15
+ const {requested,remaining:args}=languageArguments(originalArgs);
16
+ configureLanguage({requested});
7
17
  const configured=Object.entries(process.env).some(([key,value])=>value && /^(?:(?:COMAL|HARNESS)_(?:PROVIDER|BASE_URL|MODEL|PROVIDERS_CONFIG|PROFILE)|(?:OPENAI|ANTHROPIC|GEMINI)_(?:BASE_URL|MODEL|API_KEY))$/.test(key));
8
18
  const hasProfile=await Promise.all(['.comal/providers.json','.harness/providers.json'].map(file=>access(path.resolve(file)).then(()=>true,()=>false)));
9
19
  const firstRun=pkg.name==='@milpa/comal' && !args.length && !configured && !hasProfile.some(Boolean);
10
20
  let pipedPrompt='';
11
- if(firstRun && !process.stdin.isTTY)for await(const chunk of process.stdin){pipedPrompt+=chunk;if(Buffer.byteLength(pipedPrompt)>1024*1024)throw Error('Prompt excede 1 MiB.');}
21
+ if(firstRun && !process.stdin.isTTY)for await(const chunk of process.stdin){pipedPrompt+=chunk;if(Buffer.byteLength(pipedPrompt)>1024*1024)throw Error(t("Prompt exceeds 1 MiB."));}
12
22
  if(args.length===1 && ['--version','-v'].includes(args[0])) {
13
23
  process.stdout.write(`Comal ${pkg.version}\n`);
14
- } else if(firstRun && !pipedPrompt.trim()) {
24
+ } else if(firstRun && !pipedPrompt.trim() && !(process.stdin.isTTY && process.stdout.isTTY)) {
15
25
  const command=process.env.npm_command==='exec'?'npx @milpa/comal':'comal';
16
- process.stdout.write(`Comal ${pkg.version} · Tu primera vuelta\n\nElige cómo empezar desde tu proyecto:\n\n Probar sin cuenta ni modelo:\n ${command} --demo\n\n Conectar Codex:\n ${command} login codex\n ${command} --auth-provider codex\n\n Usar tu servidor compatible con OpenAI:\n ${command} --base-url http://127.0.0.1:8080/v1 --model TU_MODELO\n\n Conectar tu cuenta de Artifacts (opcional):\n ${command} cloud login\n\nGuía: https://comal.milpahq.com/academy/\n`);
26
+ process.stdout.write(t("Comal {v0} · Your first turn\n\nChoose how to start from your project:\n\n Try without account or model:\n {v1} --demo\n\n Connect Codex:\n {v2} login codex\n {v3} --auth-provider codex\n\n Use your OpenAI-compatible server:\n {v4} --base-url http://127.0.0.1:8080/v1 --model YOUR_MODEL\n\n Connect your Artifacts account (optional):\n {v5} cloud login\n\nGuide: https://comal.milpahq.com/academy/\n", {v0: pkg.version, v1: command, v2: command, v3: command, v4: command, v5: command}));
17
27
  } else {
18
28
  const {main}=await import('../src/cli.mjs');
19
- process.exitCode=await main(pipedPrompt.trim()?['--print','--',pipedPrompt]:args);
29
+ process.exitCode=await main(pipedPrompt.trim()?[...originalArgs,'--print','--',pipedPrompt]:originalArgs);
30
+ }
20
31
  }
21
32
  } catch(error){process.stderr.write(`Comal: ${error.message}\n`);process.exitCode=1;}
@@ -1,3 +1,3 @@
1
- # Procedencia de Comal
1
+ # Comal provenance
2
2
 
3
- Comal es una implementación independiente investigada mediante REA. El paquete incluye el cliente Node, sus herramientas y contratos compartidos. No ejecuta Claude Code para responder. Documentación: https://comal.milpahq.com/academy/
3
+ Comal is an independent implementation researched using REA. The package includes the Node client, its tools, and shared contracts. It does not run Claude Code to produce responses. Documentation: https://comal.milpahq.com/academy/
@@ -0,0 +1,67 @@
1
+ {
2
+ "profile": {
3
+ "name": "comal-chrome-task",
4
+ "version": "2",
5
+ "decisionIds": [
6
+ "COMAL-CHROME-002"
7
+ ]
8
+ },
9
+ "decisions": [
10
+ {
11
+ "id": "COMAL-CHROME-001",
12
+ "title": "La casa conserva el encargo y cierra con evidencia vigente",
13
+ "status": "accepted",
14
+ "supersedes": null,
15
+ "gates": [
16
+ {
17
+ "id": "task-scope",
18
+ "tier": "enforced",
19
+ "operations": [
20
+ "*"
21
+ ],
22
+ "boundTo": "runtime:chrome-task.scope"
23
+ },
24
+ {
25
+ "id": "current-evidence",
26
+ "tier": "enforced",
27
+ "operations": [
28
+ "WorkTaskUpdate"
29
+ ],
30
+ "boundTo": "runtime:chrome-task.close"
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ "id": "COMAL-CHROME-002",
36
+ "title": "The accepted Chrome task binds exact artifact bytes through a narrow host hash capability",
37
+ "status": "accepted",
38
+ "supersedes": "COMAL-CHROME-001",
39
+ "gates": [
40
+ {
41
+ "id": "task-scope",
42
+ "tier": "enforced",
43
+ "operations": [
44
+ "*"
45
+ ],
46
+ "boundTo": "runtime:chrome-task.scope"
47
+ },
48
+ {
49
+ "id": "current-evidence",
50
+ "tier": "enforced",
51
+ "operations": [
52
+ "WorkTaskUpdate"
53
+ ],
54
+ "boundTo": "runtime:chrome-task.close"
55
+ },
56
+ {
57
+ "id": "artifact-hash",
58
+ "tier": "enforced",
59
+ "operations": [
60
+ "FileInfo"
61
+ ],
62
+ "boundTo": "runtime:chrome-task.artifact-hash"
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ quickjs-emscripten copyright (c) 2019-2024 Jake Teton-Landis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ # @jitl/quickjs-ffi-types
2
+
3
+ This is an internal package, part of [quickjs-emscripten](https://github.com/justjake/quickjs-emscripten).
4
+
5
+ See the main package for documentation.