iosm-cli 0.2.11 → 0.2.13

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 (42) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +6 -3
  3. package/dist/core/agent-session.d.ts +2 -0
  4. package/dist/core/agent-session.d.ts.map +1 -1
  5. package/dist/core/agent-session.js +80 -1
  6. package/dist/core/agent-session.js.map +1 -1
  7. package/dist/core/background-processes.d.ts +11 -0
  8. package/dist/core/background-processes.d.ts.map +1 -1
  9. package/dist/core/background-processes.js +115 -9
  10. package/dist/core/background-processes.js.map +1 -1
  11. package/dist/core/openrouter-model-catalog.d.ts +9 -0
  12. package/dist/core/openrouter-model-catalog.d.ts.map +1 -0
  13. package/dist/core/openrouter-model-catalog.js +139 -0
  14. package/dist/core/openrouter-model-catalog.js.map +1 -0
  15. package/dist/core/settings-manager.d.ts +2 -0
  16. package/dist/core/settings-manager.d.ts.map +1 -1
  17. package/dist/core/settings-manager.js +6 -0
  18. package/dist/core/settings-manager.js.map +1 -1
  19. package/dist/core/slash-commands.d.ts.map +1 -1
  20. package/dist/core/slash-commands.js +9 -1
  21. package/dist/core/slash-commands.js.map +1 -1
  22. package/dist/core/system-prompt.d.ts.map +1 -1
  23. package/dist/core/system-prompt.js +4 -0
  24. package/dist/core/system-prompt.js.map +1 -1
  25. package/dist/core/tools/task.js +1 -1
  26. package/dist/core/tools/task.js.map +1 -1
  27. package/dist/core/usage-cost.d.ts +4 -0
  28. package/dist/core/usage-cost.d.ts.map +1 -0
  29. package/dist/core/usage-cost.js +28 -0
  30. package/dist/core/usage-cost.js.map +1 -0
  31. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  32. package/dist/modes/interactive/components/footer.js +7 -5
  33. package/dist/modes/interactive/components/footer.js.map +1 -1
  34. package/dist/modes/interactive/interactive-mode.d.ts +19 -0
  35. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  36. package/dist/modes/interactive/interactive-mode.js +646 -37
  37. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  38. package/docs/cli-reference.md +11 -2
  39. package/docs/configuration.md +6 -3
  40. package/docs/interactive-mode.md +16 -2
  41. package/docs/sessions-traces-export.md +2 -2
  42. package/package.json +1 -1
@@ -132,9 +132,17 @@ These commands run inside interactive mode (`iosm`), not as top-level CLI subcom
132
132
  - carries compact checkpoint state between iterations (facts, rejected hypotheses, open questions, next checks)
133
133
  - auto-injects a grounding retry when early passes return no tool evidence, forcing live workspace probes
134
134
  - if query is omitted, reuses latest meaningful user request from session context
135
- - `/bg [list [limit]|status [id]|logs [id] [lines]|stop [id]]` — interactive background shell process manager:
135
+ - `/bg` — interactive background shell process menu
136
+ - `/bg [list [limit]|running [limit]|status [id]|logs [id] [lines]|stop [id]|stop-all|prune [hours]]` — direct background shell process commands:
136
137
  - run detached shell commands with `! <command> &`
137
- - inspect process state, log tail, and stop running background jobs
138
+ - inspect process state, log tail, stop individual jobs, stop all running jobs, and prune old completed records
139
+ - `/extensions` (`/ext`) — extension lifecycle manager:
140
+ - `/extensions list [--global]`
141
+ - `/extensions install <source> [--global]`
142
+ - `/extensions update [source]`
143
+ - `/extensions remove <source> [--global]`
144
+ - `/extensions enable <target> [--global]`
145
+ - `/extensions disable <target> [--global]`
138
146
  - `/swarm` — canonical gated execution runtime:
139
147
  - `/swarm run <task> [--max-parallel N] [--budget-usd X]`
140
148
  - `/swarm from-singular <run-id> --option <1|2|3> [--max-parallel N] [--budget-usd X]`
@@ -303,6 +311,7 @@ Best-practice patterns:
303
311
  - File mutation: prefer `edit` for surgical changes and `write` for full rewrites; use `fs_ops` for `mkdir/move/copy/delete`, with `force=true` only when replacement/no-op behavior is intentional.
304
312
  - Verification: prefer `test_run` / `lint_run` / `typecheck_run` over ad-hoc bash commands for deterministic runner resolution and normalized status reporting.
305
313
  - Long-running shell jobs: prefer detached `bash` (`run_in_background=true`) or interactive `! <command> &`, then monitor with `/bg` instead of blocking the foreground turn.
314
+ - Project/server startup requests (for example "run project", "start dev server", watcher modes): default to detached background execution and return/process `backgroundTaskId` for status/log/stop follow-up.
306
315
  - DB operations: prefer `db_run` with named profiles; keep read flows in `query/schema/explain` and use `allow_write=true` only for `exec/migrate`.
307
316
  - Structured data transforms: use `jq`/`yq` to compute/preview transforms, then persist the final state through `edit`/`write`.
308
317
  - Semantic retrieval: use `semantic_search status` first when relevance looks stale, then run `query`; run `index`/`rebuild` when config or index freshness requires it.
@@ -105,7 +105,8 @@ Settings are merged in this order (later wins):
105
105
  "enableContextDedupe": true,
106
106
  "maxContextCharsPerFile": 4000,
107
107
  "maxTotalContextChars": 12000,
108
- "enableGitSnapshotContext": false
108
+ "enableGitSnapshotContext": false,
109
+ "gitSnapshotMaxChars": 2000
109
110
  },
110
111
  "permissions": {
111
112
  "autoApprove": false,
@@ -117,7 +118,7 @@ Settings are merged in this order (later wins):
117
118
  `githubTools.networkEnabled` controls whether `git_write` network actions (`fetch`, `pull`, `push`) are allowed.
118
119
  `githubTools.token` is optional and, when set, is injected for GitHub HTTPS authentication during network git actions.
119
120
  `dbTools` defines named DB connection profiles consumed by `db_run`; for network adapters (`postgres`, `mysql`, `mongodb`, `redis`) use `dsnEnv` so secrets stay in environment variables instead of tool input.
120
- `promptContext` controls system prompt context compaction before model call: dedupe by normalized content hash, per-file char budget, total char budget, and optional git snapshot context inclusion.
121
+ `promptContext` controls system prompt context compaction before model call: dedupe by normalized content hash, per-file char budget, total char budget, optional git snapshot context inclusion, and bounded git snapshot size.
121
122
  `permissions.extensionToolEnforcement` enables strict runtime permission tier checks for extension tools (off by default).
122
123
 
123
124
  ### `db_run` Setup (Recommended)
@@ -431,6 +432,7 @@ Example:
431
432
  - per-file cap (`maxContextCharsPerFile`)
432
433
  - total cap (`maxTotalContextChars`)
433
434
  - optional git snapshot context (`enableGitSnapshotContext`)
435
+ - git snapshot cap (`gitSnapshotMaxChars`, default `2000`)
434
436
 
435
437
  Default values:
436
438
 
@@ -440,7 +442,8 @@ Default values:
440
442
  "enableContextDedupe": true,
441
443
  "maxContextCharsPerFile": 4000,
442
444
  "maxTotalContextChars": 12000,
443
- "enableGitSnapshotContext": false
445
+ "enableGitSnapshotContext": false,
446
+ "gitSnapshotMaxChars": 2000
444
447
  }
445
448
  }
446
449
  ```
@@ -83,7 +83,8 @@ iosm --continue
83
83
  | `/agents` | Inspect custom/system agents | `/agents` |
84
84
  | `/subagent-runs` | List subagent run history | `/subagent-runs` |
85
85
  | `/subagent-resume` | Resume a subagent run | `/subagent-resume run-123` |
86
- | `/bg` | Background shell process manager (`list/status/logs/stop`) | `/bg status bg_...` |
86
+ | `/bg` | Background shell process manager (interactive menu + `list/running/status/logs/stop/stop-all/prune`) | `/bg` |
87
+ | `/extensions` | Extension lifecycle manager (`/ext` alias) | `/extensions list` |
87
88
  | `/team-runs` | List team orchestration runs | `/team-runs` |
88
89
  | `/team-status` | Check team run status | `/team-status team-456` |
89
90
 
@@ -114,7 +115,20 @@ In `/semantic setup`, the headers step is optional: press `Enter` on empty input
114
115
  `/ultrathink [-q N|--iterations N] [query]` runs `N` root-agent analysis passes in strict read-only mode (`N` defaults to `5`, max `12`), carries a compact checkpoint between passes, and emits concise per-iteration summaries with a final synthesis.
115
116
  `/ultrathink` without query reuses the latest meaningful user request from session context.
116
117
  If early passes produce no tool evidence, ultrathink injects an internal grounding retry so the agent probes the workspace with read-only tools before continuing.
117
- Run detached shell jobs with `! <command> &` (example: `! npm run dev &`) and manage them using `/bg`, `/bg status <id>`, `/bg logs <id> [lines]`, `/bg stop <id>`.
118
+ Run detached shell jobs with `! <command> &` (example: `! npm run dev &`) and manage them via `/bg` interactive menu or direct commands:
119
+ - `/bg list` or `/bg running`
120
+ - `/bg status <id>`
121
+ - `/bg logs <id> [lines]`
122
+ - `/bg stop <id>` or `/bg stop-all`
123
+ - `/bg prune [hours]` (remove old completed records; keeps running jobs)
124
+ Manage extension lifecycle from interactive mode:
125
+ - `/extensions list` (or `/extensions list --global`)
126
+ - `/extensions install <source> [--global]`
127
+ - `/extensions update [source]`
128
+ - `/extensions remove <source> [--global]`
129
+ - `/extensions enable <target> [--global]`
130
+ - `/extensions disable <target> [--global]`
131
+ For agent-driven execution, prompts like "start/run project", "start dev server", or watcher startup are treated as detached background jobs by default unless foreground output is explicitly requested.
118
132
  `/swarm` enforces `Scopes -> Touches -> Locks -> Gates -> Done`. If effective contract is missing, it blocks execution and opens a bootstrap menu (auto-draft, guided Q&A, or manual `/contract` editor).
119
133
  `/orchestrate --parallel` defaults `--max-parallel` to `--agents` when omitted and auto-selects `meta` workers when profiles are not explicitly set (outside read-only host contexts).
120
134
  For orchestrate assignments, `delegate_parallel_hint` is carried into child task calls; high hints should trigger nested delegate fan-out or explicit `DELEGATION_IMPOSSIBLE`.
@@ -129,7 +129,7 @@ Traces are stored as `<session-id>.jsonl` files. Each line is a JSON event:
129
129
  ```jsonl
130
130
  {"type":"session_start","timestamp":"2026-03-09T15:42:00Z","sessionId":"abc123"}
131
131
  {"type":"user_message","timestamp":"2026-03-09T15:42:05Z","content":"Analyze the project"}
132
- {"type":"system_prompt_context_compose","timestamp":"2026-03-09T15:42:05Z","context_before_chars":16422,"context_after_chars":11998,"dedupe_hits":2,"truncated_files":["README.md"],"dropped_files":1}
132
+ {"type":"system_prompt_context_compose","timestamp":"2026-03-09T15:42:05Z","context_before_chars":16422,"context_after_chars":11998,"dedupe_hits":2,"truncated_files":["README.md"],"dropped_files":1,"git_snapshot_included":true,"git_snapshot_chars_before":2450,"git_snapshot_chars_after":2000,"git_snapshot_truncated":true,"git_snapshot_max_chars":2000}
133
133
  {"type":"tool_call","timestamp":"2026-03-09T15:42:06Z","tool":"ls","input":{"path":"."}}
134
134
  {"type":"tool_result","timestamp":"2026-03-09T15:42:06Z","tool":"ls","output":"..."}
135
135
  {"type":"bash_end","timestamp":"2026-03-09T15:42:07Z","command":"npm run dev","backgroundTaskId":"bg_1770000000000_ab12cd34"}
@@ -139,7 +139,7 @@ Traces are stored as `<session-id>.jsonl` files. Each line is a JSON event:
139
139
 
140
140
  Notable runtime events:
141
141
 
142
- - `system_prompt_context_compose` shows prompt-context preprocessing stats (before/after chars, dedupe hits, truncation, dropped files).
142
+ - `system_prompt_context_compose` shows prompt-context preprocessing stats (before/after chars, dedupe hits, truncation, dropped files) plus git snapshot diagnostics when enabled.
143
143
  - `bash_end.backgroundTaskId` is populated when a shell command was started in detached background mode.
144
144
 
145
145
  ### Analyzing Traces
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iosm-cli",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "description": "Standalone IOSM CLI with agent tooling, session management, and IOSM artifact orchestration",
5
5
  "type": "module",
6
6
  "iosmConfig": {