@jetrabbits/agentic 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,16 +4,19 @@
4
4
 
5
5
  - Post-install doctor checks run independently for `codex`, `opencode`, `claude`, and `gemini`.
6
6
  - `AGENTIC_DOCTOR_TIMEOUT_SECONDS` defaults to `10`; a timeout is reported as a doctor failure and install continues.
7
- - Codex doctor runs non-interactively with `--ephemeral` and `--sandbox workspace-write`.
7
+ - Codex doctor runs non-interactively with `--ephemeral`, `--sandbox workspace-write`, and the same lightweight smoke prompt as other supported doctor targets.
8
8
  - OpenCode uses `agent-model-mapper` instead of the removed `model-checker` artifacts.
9
9
  - `agent-model-mapper` writes `.opencode/opencode.json` during interactive install only after confirmation.
10
10
  - `agent-model-mapper` uses `fzf` for install-time model dropdowns when available and OpenCode startup skips once all roles are mapped.
11
11
  - The runtime OpenCode plugin never opens `fzf`, asks questions, or writes project files.
12
- - Context7 no longer asks for an API key; it uses `CONTEXT7_API_KEY` when set and otherwise prints config-path guidance for adding one later.
13
- - OpenCode MemPalace setup writes `mempalace-mcp` config without running `mempalace init` automatically.
14
- - Telegram notification credentials are read only from `OPENCODE_TELEGRAM_BOT_TOKEN` and `OPENCODE_TELEGRAM_CHAT_ID`.
12
+ - Context7 offers an interactive key mode: configure without a key or enter `CONTEXT7_API_KEY` for the selected target configs.
13
+ - OpenCode MemPalace setup writes `mempalace-mcp` config and initializes/mines project memory into a project-specific wing without LLM calls.
14
+ - Telegram notification credentials are read from project `.agentic.json` when the plugin is enabled.
15
15
  - MemPalace-enabled installs create a managed `.mempalaceignore` unless the target project already has one.
16
- - Real Codex, OpenCode, and Telegram blackbox scenarios are part of `make test`.
16
+ - `make test` runs the fast deterministic e2e suite; longer deterministic checks, real blackbox, and coverage checks are explicit targets.
17
+ - `make test-all` runs the full local suite including longer deterministic checks, install/evidence blackbox, and coverage.
18
+ - Real Codex, OpenCode, and Telegram blackbox install/evidence scenarios run through `make test-real-blackbox`.
19
+ - Live Codex/OpenCode/Telegram blackbox sessions require `AGENTIC_REAL_BLACKBOX_LIVE=1`.
17
20
  - `make test-coverage` traces `agentic` through e2e runs and fails below 90% line coverage.
18
21
 
19
22
  ## Acceptance Criteria
@@ -24,10 +27,11 @@
24
27
  - `extensions/opencode/opencode.json` lists `agent-model-mapper`.
25
28
  - Runtime model mapper execution does not prompt or modify project files.
26
29
  - Telegram plugin tests prove environment-only credentials and no secret output.
27
- - Real blackbox tests print created files, instruction evidence, MCP usage prompts, and MemPalace fact prompts without printing Telegram secrets.
30
+ - Real blackbox tests print created files, managed guidance sources, and MCP config evidence, then save instruction evidence to a temp file without printing Telegram secrets.
28
31
 
29
32
  ## Operational Constraints
30
33
 
31
- - `make test` now requires real `codex` and `opencode` binaries, working model auth, network access, Context7/MemPalace access, and Telegram credentials.
34
+ - `make test` is deterministic, designed for a sub-minute local loop, and does not require real agent binaries, model auth, network access, Context7/MemPalace access, or Telegram credentials.
35
+ - `AGENTIC_REAL_BLACKBOX_LIVE=1 make test-real-blackbox` requires real `codex` and `opencode` binaries, working model auth, network access, Context7/MemPalace access, and Telegram credentials for the Telegram case.
32
36
  - Telegram credentials must never be committed or written to Agentic config.
33
37
  - Coverage is line-based Bash trace coverage for the `agentic` script, not branch coverage.
@@ -32,15 +32,17 @@ When installing for OpenCode, `agentic` writes optional plugin state to:
32
32
  ~/.config/agentic/opencode-plugins.json
33
33
  ```
34
34
 
35
- Interactive installs ask whether to enable Telegram notifications and model checking. Non-interactive installs default optional plugins to disabled when no config exists.
35
+ Interactive installs ask whether to enable Telegram notifications and model mapping. Non-interactive installs default optional plugins to disabled when no config exists.
36
36
 
37
- The OpenCode plugins read this config at startup and return no hooks when disabled. Telegram credentials can also be supplied through:
37
+ The OpenCode plugins read project `.agentic.json` at startup and return no hooks when disabled. When Telegram is enabled, credentials are stored in plaintext at:
38
38
 
39
39
  ```text
40
- OPENCODE_TELEGRAM_BOT_TOKEN
41
- OPENCODE_TELEGRAM_CHAT_ID
40
+ settings.opencode_plugins.telegram.botToken
41
+ settings.opencode_plugins.telegram.chatId
42
42
  ```
43
43
 
44
+ Do not commit a Telegram-enabled `.agentic.json` to public repositories.
45
+
44
46
  ## Context7
45
47
 
46
48
  `agentic` adds Context7 MCP configuration for known project-level formats:
@@ -54,7 +56,7 @@ OPENCODE_TELEGRAM_CHAT_ID
54
56
  - `.kilocode/mcp.json` for `kilocode`
55
57
  - `~/.gemini/antigravity/mcp_config.json` for `antigravity` (global user config)
56
58
 
57
- Interactive installs ask whether to enable Context7. If enabled, Context7 is configured without a key unless `CONTEXT7_API_KEY` is already set; the install output prints the config path(s) and an example key placement. Non-interactive installs enable Context7 when either `AGENTIC_ENABLE_CONTEXT7=y` or `CONTEXT7_API_KEY` is set. Generated guidance requires agents to use Context7 for framework, SDK, library, and API documentation before relying on model memory when the project config is present.
59
+ Interactive installs ask whether to enable Context7. If enabled, Context7 can be configured without a key or with a `CONTEXT7_API_KEY` entered during setup. Non-interactive installs enable Context7 when either `AGENTIC_ENABLE_CONTEXT7=y` or `CONTEXT7_API_KEY` is set. Generated guidance requires agents to use Context7 for framework, SDK, library, and API documentation before relying on model memory when the project config is present.
58
60
 
59
61
  Directory copies are processed in batches so large specialization installs avoid spawning a separate marker/manifest process for every copied file. Manifest protection still applies: existing unmanaged files are skipped on rerun, user-modified managed files are skipped, and new generated files can be added by newer `agentic` versions.
60
62
 
@@ -104,7 +104,7 @@ The final install line prints the exact path:
104
104
  Agentic log file: /tmp/agentic-20260512-114203.ABC123
105
105
  ```
106
106
 
107
- `agentic` also runs a final doctor smoke check for selected real agent targets (`codex`, `opencode`, `claude`, `gemini`). The doctor runs in a temporary copy of the project and prints one status row per selected agent. OpenCode uses a lightweight pure smoke prompt instead of the full `develop-feature` command, so install-time doctor checks do not start a long SDLC workflow. Each agent has an independent timeout controlled by `AGENTIC_DOCTOR_TIMEOUT_SECONDS` and defaults to `10` seconds. Doctor failures and timeouts are reported but do not roll back or fail the install. Disable doctor for cheap checks with:
107
+ `agentic` also runs a final doctor smoke check for selected real agent targets (`codex`, `opencode`, `claude`, `gemini`). The doctor runs in a temporary copy of the project and prints one status row per selected agent. All supported doctor targets use a lightweight pure smoke prompt, so install-time doctor checks do not start a long SDLC workflow. Each agent has an independent timeout controlled by `AGENTIC_DOCTOR_TIMEOUT_SECONDS` and defaults to `10` seconds. Doctor failures and timeouts are reported but do not roll back or fail the install. Disable doctor for cheap checks with:
108
108
 
109
109
  ```bash
110
110
  AGENTIC_DOCTOR=0 agentic install ...
@@ -169,11 +169,11 @@ When `opencode` is selected, interactive installs ask whether to enable Telegram
169
169
  ~/.config/agentic/opencode-plugins.json
170
170
  ```
171
171
 
172
- Non-interactive installs create a disabled config when no config exists. Telegram reads `OPENCODE_TELEGRAM_BOT_TOKEN` and `OPENCODE_TELEGRAM_CHAT_ID` from the environment only; tokens are not written to `~/.config/agentic/opencode-plugins.json`. When enabled, `agent-model-mapper` runs during interactive `agentic install`/`agentic tui`, uses `fzf` as a dropdown picker when available, and writes `.opencode/opencode.json` only after confirmation. OpenCode startup never prompts for model mapping; the runtime plugin only reports whether install-time mapping is already complete.
172
+ Non-interactive installs create a disabled config when no config exists. Interactive installs ask for Telegram `botToken` and `chatId` when `telegram-notification` is selected. Those credentials are written to the target project `.agentic.json` under `settings.opencode_plugins.telegram`, not to `~/.config/agentic/opencode-plugins.json`. Treat `.agentic.json` as plaintext secret-bearing project config when Telegram is enabled and do not commit it to public repositories. When enabled, `agent-model-mapper` runs during interactive `agentic install`/`agentic tui`, uses `fzf` as a dropdown picker when available, and writes `.opencode/opencode.json` only after a Confirm action. OpenCode startup never prompts for model mapping; the runtime plugin only reports whether install-time mapping is already complete.
173
173
 
174
174
  ## Context7
175
175
 
176
- For `opencode`, `codex`, `claude`, `cursor`, `gemini`, `kilocode`, and `antigravity`, interactive installs ask whether to add Context7 MCP configuration. If enabled, Context7 is configured without a key unless `CONTEXT7_API_KEY` is already set in the environment. The install output prints the generated config path(s) and an example showing where to add the key later. Most targets use project-level files, while `antigravity` is written to the global user path `~/.gemini/antigravity/mcp_config.json`.
176
+ For `opencode`, `codex`, `claude`, `cursor`, `gemini`, `kilocode`, and `antigravity`, interactive installs ask whether to add Context7 MCP configuration. If enabled, a follow-up menu chooses either keyless mode or entering `CONTEXT7_API_KEY`. The selected key is written to all selected target configs for the current project. Most targets use project-level files, while `antigravity` is written to the global user path `~/.gemini/antigravity/mcp_config.json`.
177
177
 
178
178
  Non-interactive installs enable Context7 when either `AGENTIC_ENABLE_CONTEXT7=y` or `CONTEXT7_API_KEY` is set. Agents are instructed to use Context7 for framework, library, SDK, API, and setup documentation when the project config is present.
179
179
 
@@ -183,14 +183,21 @@ For `opencode`, `codex`, `claude`, `cursor`, `gemini`, `kilocode`, and `antigrav
183
183
 
184
184
  Generated configs run `mempalace-mcp` without arguments for all supported agent targets. Runtime startup and MCP tool errors are checked by the post-install doctor stage.
185
185
 
186
- During install, if MemPalace is enabled, `agentic` writes a managed `.mempalaceignore` when the target project does not already have one. OpenCode installs do not run `mempalace init` automatically; project indexing is optional and printed as a manual follow-up. If auto-install or runtime checks fail, install continues, manual setup instructions are printed, and agents fall back to standard context discovery.
186
+ During install, if MemPalace is enabled, `agentic` writes a managed `.mempalaceignore` when the target project does not already have one. It initializes the project with `mempalace init --yes --no-llm`, then mines project knowledge into a wing named from the target project basename. If `docs/` exists, those files are also mined into the shared `shared_docs` wing for cross-project Markdown knowledge. MemPalace commands time out after `60` seconds by default; override with `AGENTIC_MEMPALACE_TIMEOUT_SECONDS`. If auto-install, initialization, mining, timeout, or runtime checks fail, install continues, manual setup instructions are printed, and agents fall back to standard context discovery. If `pip install mempalace` fails, `agentic` prints the pip exit status, a temporary pip output log path, and the first non-empty pip output line as the likely reason; the full pip output is also copied into the main Agentic run log.
187
+
188
+ For environments that already provide `mempalace-mcp` and need a fast install path, set `AGENTIC_MEMPALACE_SETUP=skip`. This writes the same MCP configuration and `.mempalaceignore` but skips Python package installation and project indexing.
187
189
 
188
190
  ## Real agent blackbox E2E
189
191
 
190
- `make test` includes real Codex, OpenCode, and Telegram blackbox scenarios. The local environment must provide working `codex`, `opencode`, Context7/MemPalace access, network access, valid auth, and Telegram credentials in `OPENCODE_TELEGRAM_BOT_TOKEN` and `OPENCODE_TELEGRAM_CHAT_ID`. Secrets are redacted from test output.
192
+ `make test` runs the fast deterministic e2e suite and is intended to finish in under a minute on a normal local machine. Longer deterministic checks (`test-doctor`, `test-markers`), real-agent blackbox, and coverage checks are explicit targets so the default local loop stays short.
193
+
194
+ `make test-real-blackbox` validates real Codex/OpenCode install artifacts, generated guidance, MCP config, and manifest evidence without starting live LLM sessions by default. Set `AGENTIC_REAL_BLACKBOX_LIVE=1` to execute live `codex`/`opencode` runs. Live Telegram checks require Telegram credentials to be present in the target project `.agentic.json`; secrets are redacted from test output.
195
+
196
+ Makefile test targets print timestamped `[make-timing]` start, success/failure, exit status, and elapsed seconds for every top-level test step. `test-real-blackbox` is split into separate Codex, OpenCode, OpenCode mapper, and Telegram timed steps. Blackbox instruction evidence is saved to a `/tmp/agentic-instruction-evidence.*` file and the path is printed. `test-coverage` also prints timing for each traced coverage scenario before the final coverage parser. Use `make test-all` when you want the fast suite, longer deterministic checks, install/evidence blackbox, and coverage in one command.
191
197
 
192
198
  ```bash
193
199
  make test-real-blackbox
200
+ AGENTIC_REAL_BLACKBOX_LIVE=1 make test-real-blackbox
194
201
  ```
195
202
 
196
203
  ## Deprecated wrapper
@@ -33,18 +33,20 @@ When `agentic` installs the OpenCode extension, it configures optional plugins i
33
33
  ~/.config/agentic/opencode-plugins.json
34
34
  ```
35
35
 
36
- Telegram notifications and agent model mapping are opt-in. If the config is absent or a plugin is disabled, the plugin returns no hooks and OpenCode continues without that behavior.
36
+ Telegram notifications and agent model mapping are opt-in. Interactive `agentic install` and `agentic tui` ask for OpenCode plugin selection whenever `opencode` is selected; the answer rewrites this config. During manifest-based upgrade/re-install sync, existing plugin settings are kept so automated refreshes do not open prompts. If the config is absent or a plugin is disabled, the plugin returns no hooks and OpenCode continues without that behavior.
37
37
 
38
- Telegram notifications read credentials from environment variables only:
38
+ When `telegram-notification` is selected interactively, `agentic` asks for `botToken` and `chatId` and stores them in the target project's `.agentic.json`:
39
39
 
40
40
  ```text
41
- OPENCODE_TELEGRAM_BOT_TOKEN
42
- OPENCODE_TELEGRAM_CHAT_ID
41
+ settings.opencode_plugins.telegram.botToken
42
+ settings.opencode_plugins.telegram.chatId
43
43
  ```
44
44
 
45
+ The runtime plugin reads credentials from the project `.agentic.json`; it does not read Telegram credentials from environment variables. This file stores credentials in plaintext, so do not commit a Telegram-enabled `.agentic.json` to public repositories.
46
+
45
47
  Non-interactive `agentic install` defaults optional plugins to disabled when no config exists.
46
48
 
47
- `agent-model-mapper` reads roles from target `.opencode/agents/*.md` and discovers model names from `~/.config/opencode/opencode.json`, falling back to a built-in list only when that file has no model names. When enabled, interactive `agentic install`/`agentic tui` prompts for a main and fallback model per role, using `fzf` as a dropdown picker when available, and writes `.opencode/opencode.json` only after confirmation. OpenCode startup never opens `fzf` or waits for model input; the runtime plugin only reports whether install-time mapping is complete.
49
+ `agent-model-mapper` reads roles from target `.opencode/agents/*.md` and discovers model names from `~/.config/opencode/opencode.json`, then adds models from active providers in `~/.local/share/opencode/auth.json` using non-deprecated entries in `~/.cache/opencode/models.json`. When enabled, interactive `agentic install`/`agentic tui` prompts for a main and fallback model per role, using `fzf` as a dropdown picker when available, and writes `.opencode/opencode.json` only after a Confirm action. OpenCode startup never opens `fzf` or waits for model input; the runtime plugin only reports whether install-time mapping is complete.
48
50
 
49
51
  For OpenCode targets, `agentic` writes generated operating guidance to `.opencode/AGENTS.md`. If OpenCode is installed
50
52
  alongside another agent target, root `AGENTS.md` is generated as well for the non-OpenCode target.
@@ -7,6 +7,7 @@ type AgenticPluginConfig = {
7
7
  agentModelMapper?: {
8
8
  enabled?: boolean
9
9
  }
10
+ settings?: any
10
11
  }
11
12
 
12
13
  type Role = {
@@ -26,6 +27,14 @@ function readAgenticConfig(): AgenticPluginConfig {
26
27
  }
27
28
  }
28
29
 
30
+ function readProjectAgenticConfig(directory: string): AgenticPluginConfig {
31
+ try {
32
+ return JSON.parse(readFileSync(join(directory, ".agentic.json"), "utf-8")) as AgenticPluginConfig
33
+ } catch {
34
+ return {}
35
+ }
36
+ }
37
+
29
38
  function parseFrontmatter(text: string): Record<string, string> {
30
39
  if (!text.startsWith("---\n")) return {}
31
40
  const end = text.indexOf("\n---", 4)
@@ -87,8 +96,10 @@ function hasCompleteAgentModelMapping(directory: string, roles: Role[]): boolean
87
96
  }
88
97
 
89
98
  export const AgentModelMapperPlugin: Plugin = async ({ directory }) => {
90
- const config = readAgenticConfig()
91
- if (!config.agentModelMapper?.enabled) return {}
99
+ const projectConfig = readProjectAgenticConfig(directory)
100
+ const globalConfig = readAgenticConfig()
101
+ const enabled = projectConfig.settings?.opencode_plugins?.agentModelMapper?.enabled ?? globalConfig.agentModelMapper?.enabled
102
+ if (!enabled) return {}
92
103
 
93
104
  const roles = await readRoles(directory)
94
105
  if (!roles.length) {
@@ -3,9 +3,7 @@ import { readFileSync } from "node:fs"
3
3
  import { join } from "node:path"
4
4
 
5
5
  type AgenticPluginConfig = {
6
- telegram?: {
7
- enabled?: boolean
8
- }
6
+ settings?: any
9
7
  }
10
8
 
11
9
  function telegramApiBaseUrl(): string {
@@ -18,15 +16,14 @@ function telegramUrl(botToken: string, method: string): string {
18
16
 
19
17
  function redactSecret(value: unknown): string {
20
18
  const text = String(value)
21
- const token = process.env.OPENCODE_TELEGRAM_BOT_TOKEN
22
- const chatId = process.env.OPENCODE_TELEGRAM_CHAT_ID
19
+ const telegram = currentTelegramConfig
20
+ const token = telegram?.botToken
21
+ const chatId = telegram?.chatId
23
22
  return [token, chatId].filter(Boolean).reduce((output, secret) => output.split(secret as string).join("[redacted]"), text)
24
23
  }
25
24
 
26
- function readAgenticConfig(): AgenticPluginConfig {
27
- const configHome = process.env.XDG_CONFIG_HOME || join(process.env.HOME || "", ".config")
28
- const configPath = join(configHome, "agentic", "opencode-plugins.json")
29
-
25
+ function readAgenticConfig(directory: string): AgenticPluginConfig {
26
+ const configPath = join(directory, ".agentic.json")
30
27
  try {
31
28
  return JSON.parse(readFileSync(configPath, "utf-8")) as AgenticPluginConfig
32
29
  } catch {
@@ -34,11 +31,14 @@ function readAgenticConfig(): AgenticPluginConfig {
34
31
  }
35
32
  }
36
33
 
34
+ let currentTelegramConfig
35
+
37
36
  export const TelegramNotificationPlugin: Plugin = async ({ $, client, directory }) => {
38
- const config = readAgenticConfig()
39
- const telegram = config.telegram
40
- const botToken = process.env.OPENCODE_TELEGRAM_BOT_TOKEN
41
- const chatId = process.env.OPENCODE_TELEGRAM_CHAT_ID
37
+ const config = readAgenticConfig(directory)
38
+ const telegram = config.settings?.opencode_plugins?.telegram
39
+ currentTelegramConfig = telegram
40
+ const botToken = telegram?.botToken
41
+ const chatId = telegram?.chatId
42
42
 
43
43
  if (!telegram?.enabled || !botToken || !chatId) {
44
44
  return {}
@@ -96,7 +96,7 @@ export const TelegramNotificationPlugin: Plugin = async ({ $, client, directory
96
96
  headers: { "Content-Type": "application/json" },
97
97
  body: JSON.stringify({
98
98
  chat_id: chatId,
99
- text: `${messageText}\n\n📎 Полный ответ в attachment (${fullText.length} символов):\n\n${shortText}...`
99
+ text: `${messageText}\n\nПолный ответ в attachment (${fullText.length} символов):\n\n${shortText}...`
100
100
  })
101
101
  }
102
102
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetrabbits/agentic",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Agent Intelligence Configuration CLI",
5
5
  "bin": {
6
6
  "agentic": "bin/agentic.js"