@gencode/console 0.3.16 → 0.3.18

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 (2) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,81 @@
1
1
  # @gencode/console
2
2
 
3
+ ## 0.3.18
4
+
5
+ ### Patch Changes
6
+
7
+ - 2f6ada8: 修复 CLI 启动时崩溃的问题:`aimax`(以及任何加载 `@gencode/agents` 的入口)在 Node ESM 下启动会立即抛出 `ERR_PACKAGE_PATH_NOT_EXPORTED`,导致命令一执行就报错退出。
8
+
9
+ - **现象**:运行 `aimax -V`、`aimax --version` 或任意子命令时,进程在加载阶段失败,报 `Package subpath './dist/utils/sanitize-unicode.js' is not defined by "exports" in .../pi-ai/package.json`。
10
+ - **根因**:`@gencode/agents` 的 OpenAI-compatible provider 直接 deep-import 了 `@earendil-works/pi-ai` 的内部 `dist/` 子路径(`sanitize-unicode`、`simple-options`、`transform-messages`、`github-copilot-headers`),而这些路径并未被该包的 `exports` 暴露。构建产物保留了这些 import,Node 在运行时强制校验 `exports` 即报错。
11
+ - **修复**:把必需的三个叶子工具(`sanitizeSurrogates`、`buildBaseOptions`、`transformMessages`,均为零依赖纯函数)就近内联到 agents 内部;移除未使用的 `clampReasoning` 导入;移除不再需要的 GitHub Copilot 动态请求头注入(`buildCopilotDynamicHeaders` / `hasCopilotVisionInput`)。运行时不再触碰 pi-ai 的内部子路径,CLI 可正常启动并返回版本号。
12
+ - **用户感知**:此前任何 `aimax` 调用都会立即崩溃;修复后 CLI 恢复可用。openai-completions 兼容 provider 的既有消息处理行为不变。
13
+
14
+ - Updated dependencies [2f6ada8]
15
+ - Updated dependencies [a9f87b5]
16
+ - @gencode/cli@0.10.0
17
+
18
+ ## 0.3.17
19
+
20
+ ### Patch Changes
21
+
22
+ - d5d9531: Add `onLog` callback to `runAgent` for intercepting agent log output. When set, logs are routed to the callback instead of `process.stderr`; file logging via log4js is unaffected. The callback is bound to the async context via `AsyncLocalStorage`, so all internal modules (including plugin loggers) are covered.
23
+ - 75731b8: `aimax run` and `aimax resume` now accept an explicit thinking/reasoning level via `--thinking <level>` (`minimal`, `low`, `medium`, `high`, `xhigh`) or the `AIMAX_THINKING` environment variable (CLI flag takes precedence). When set, AIMax enables thinking for compatible OpenAI-style models such as GLM-5.1 by sending `thinking: { type: "enabled" }` and `reasoning_effort` in the request payload. When omitted, existing provider defaults are unchanged (for example DeepSeek behavior is preserved; GLM is not auto-enabled by model name alone).
24
+ - 75731b8: Improves `/goal` first-turn execution guidance. During the initial clarify workflow, plain `exec` remains blocked, but the error now directs command work to `goal_record_exec`, which executes bounded commands and records workflow evidence. Goal steering also tells agents to use `goal_record_exec` by default for command execution inside goal workflows, reducing blocked `exec` retries while preserving evidence tracking.
25
+ - 75731b8: `/goal` 在首轮执行时现在会加载当前 workflow context:当自然语言目标先进入 `clarify plan and acceptance` 阶段时,模型会先看到当前任务、验收项和 clarify 规则。该阶段首轮会阻止直接调用 `write_file`、`edit_file`、`apply_patch`、`exec` 等交付型工具,要求先通过 `goal_plan_update`、`goal_add_task` 或 `goal_task_done` 补齐任务计划后再继续执行,避免长目标被直接跳过规划阶段。
26
+ - 75731b8: Renames the `/goal` command-evidence tool from `goal_record_command` to `goal_record_exec` to better signal that it executes a bounded command and registers its result as goal evidence. Use `goal_record_exec` when command output should serve as acceptance evidence; it still returns a `command:<id>` evidenceRef and exitCode. Plain `exec` remains unregistered. This is a pre-launch rename with no alias.
27
+ - 75731b8: Improves `/goal` V2-lite self-healing when models misuse evidence refs or task start. Unregistered refs in `goal_task_done` / `goal_complete` now return a structured `repairPlan` suggesting `goal_record_note`, `goal_record_exec`, or `goal_record_snapshot`. Missing `source` on manual notes returns `retryWith` without writing the registry. `goal_task_start` is idempotent when the current task is already `doing`.
28
+ - 75731b8: Improves `/goal` V2-lite evidence guidance when completing tasks or goals. If a model passes an unregistered evidence reference such as a natural-language description or file path, the workflow now explains that evidence must first be registered with `goal_record_note`, `goal_record_exec`, or `goal_record_snapshot`, then retried with the returned `evidenceRef`. Workflow steering also clarifies that command output intended for acceptance evidence should use `goal_record_exec`; ordinary `exec` output is not registered in `goal/artifacts/registry.jsonl`.
29
+ - 75731b8: Goal workflow mutations in the same process/session are now serialized with a per-store lock and unique temporary files for atomic writes, preventing concurrent `goal_add_task` calls from corrupting `goal/state.json`. When `goal/state.json` is unreadable, tools return a structured `workflow_corrupt` error and `goal_repair_workflow_state` (confirm:true) can safely reinitialize from the saved objective without opening arbitrary writes under `.aimax`. The first-turn clarify gate stays active for corrupt workflows but always allows the repair tool, and `goal_add_task.kind` now accepts only `execution`.
30
+ - 75731b8: Improve compatibility for deprecated `after_tool_call` audit hooks. The hook remains a read-only notification, but now includes `durationMs`, reports `error` for failed tools when available, and also fires when a `before_tool_call` hook blocks a tool. Plugins that need to modify tool results should continue migrating to `tool_result`.
31
+ - 75731b8: AIMax now supports loading and running pi-coding-agent extensions via the built-in `PiExtensionHost`. Extensions written for pi (factory-style `export default function(pi)` modules) can be loaded from any directory by adding paths to `plugins.load.paths` in the configuration.
32
+
33
+ **What users get:**
34
+
35
+ - 9 new hooks aligned with the pi extension event model: `tool_result`, `turn_start`, `turn_end`, `agent_start`, `before_agent_start`, `input`, `resources_discover`, `context`, and `before_provider_request`.
36
+ - Extensions can register tools, flags, and slash commands that appear alongside AIMax built-in commands.
37
+ - Tool interception now uses agent-core's built-in hooks (`beforeToolCall` / `afterToolCall`) as the single authority, eliminating double-dispatch between AIMax wrapper and pi interceptors.
38
+ - `getFlag(name)` allows extensions to query runtime flags at runtime, with fallback to the plugin's `config` entry in `plugins.json`.
39
+ - `ctx.ui.setStatus(text)` is available for extensions that need to display status information; it is surfaced through the CLI progress diagnostics channel.
40
+ - Container-friendly cold-start: call `preloadExtensions(["/path/to/extensions"])` before starting the server to pre-compile extensions, so the first user request sees zero loading delay.
41
+ - `pi.exec` for subprocess execution; `ctx.sessionManager` read-only transcript adapter; `ui.select` / `ui.confirm` with optional `dialogBridge`; `ctx.hasUI` when a dialog bridge is present; `session_before_switch` / `session_before_fork` session guard hooks.
42
+
43
+ **Configuration:**
44
+
45
+ - Add extension paths via `plugins.load.paths` in `~/.aimax/plugins.json` or workspace-level `.aimax/plugins.json`.
46
+ - Pre-compile large extensions (for example pi-lens) with `tsc` in your Docker image; the loader automatically prefers compiled `.js` over `.ts` source for faster cold starts (2.2s vs 6.6s).
47
+ - Use `preloadExtensions()` in your container entrypoint to warm the extension cache before accepting requests.
48
+
49
+ **pi-agent-core upgrade:**
50
+ The underlying agent runtime has been upgraded from `@mariozechner/pi-agent-core@0.55.3` to `@earendil-works/pi-agent-core@0.78.0`, and `@mariozechner/pi-ai@0.55.3` to `@earendil-works/pi-ai@0.78.0`. This includes:
51
+
52
+ - Async `Agent.subscribe()` with `AbortSignal` support.
53
+ - Parallel tool execution by default (can be set to sequential via `toolExecution: "sequential"` if needed).
54
+ - `AgentState.errorMessage` replaces the mutable `error` field.
55
+ - Node.js 22.19+ is now required.
56
+
57
+ - 75731b8: Thread goals now use the V2-lite workflow layout for newly created goals. New goals are stored under the session `goal/` directory (`goal/goal.json`, `goal/objective.md`, `goal/events.jsonl`, `goal/state.json`, `goal/plan.md`, and `goal/artifacts/`) and legacy root-level goal files are not read or migrated.
58
+
59
+ When users create or replace a goal, AIMax initializes a lightweight task plan with acceptance criteria. Goal workflow tools such as `goal_task_done`, `goal_task_blocked`, `goal_record_note`, `goal_record_exec`, `goal_record_snapshot`, and `goal_complete` now require registered evidence refs before tasks or goals can be marked complete. `get_goal` returns the workflow summary, `/goal get` shows workflow status/current task/blockers, and `update_goal(status="complete")` no longer bypasses the V2-lite evidence gate.
60
+
61
+ Goal continuation now injects the current workflow task, acceptance criteria, blocked reason, and open questions from `goal/state.json` on each continuation turn, so resumed work follows the persisted workflow state instead of relying on conversation memory alone.
62
+
63
+ - Updated dependencies [d5d9531]
64
+ - Updated dependencies [75731b8]
65
+ - Updated dependencies [75731b8]
66
+ - Updated dependencies [75731b8]
67
+ - Updated dependencies [75731b8]
68
+ - Updated dependencies [75731b8]
69
+ - Updated dependencies [75731b8]
70
+ - Updated dependencies [75731b8]
71
+ - Updated dependencies [75731b8]
72
+ - Updated dependencies [674c296]
73
+ - Updated dependencies [75731b8]
74
+ - Updated dependencies [75731b8]
75
+ - Updated dependencies [75731b8]
76
+ - @gencode/cli@0.9.0
77
+ - @gencode/shared@0.2.2
78
+
3
79
  ## 0.3.16
4
80
 
5
81
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gencode/console",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "aimax-console": "./dist/server/index.js"
@@ -26,8 +26,8 @@
26
26
  "react": "^18.3.1",
27
27
  "react-dom": "^18.3.1",
28
28
  "ws": "^8.18.0",
29
- "@gencode/cli": "0.8.16",
30
- "@gencode/shared": "0.2.1"
29
+ "@gencode/cli": "0.10.0",
30
+ "@gencode/shared": "0.2.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@playwright/test": "^1.60.0",