work-ally 0.2.0-alpha.2 → 0.2.0-alpha.3

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 CHANGED
@@ -60,6 +60,7 @@
60
60
  - bridge 主干在 `bridge/src/`
61
61
  - 产品级 Skill 包在 `skills/`
62
62
  - 默认安装与升级走 npm(install-first)
63
+ - 安装后可先执行 `ally prepare` 做 Codex CLI 预检查
63
64
  - 官方 Codex runtime 包装在 `runtime/`
64
65
  - assistant 长期资产在 `~/.work-ally/assistants/<name>/`
65
66
  - 运行期状态、日志、会话都在 assistant desk 的 `.system/`
package/ally.sh CHANGED
@@ -85,6 +85,7 @@ usage() {
85
85
  Usage: $CMD_NAME <command> [args]
86
86
 
87
87
  Commands:
88
+ prepare [machine scope] Preflight Codex CLI prerequisites
88
89
  setup [assistant scope] Create or bind an assistant to a project path
89
90
  assistant <subcmd> [global scope] Manage named assistant profiles
90
91
  start [assistant scope] Start a named assistant from anywhere
@@ -18,6 +18,12 @@ npm i -g work-ally@alpha
18
18
  ally help
19
19
  ```
20
20
 
21
+ 安装后先做一次预检查:
22
+
23
+ ```bash
24
+ ally prepare
25
+ ```
26
+
21
27
  ## 三步启动
22
28
 
23
29
  ```bash
@@ -54,6 +60,7 @@ WORK_ALLY_SOURCE_DIR=/path/to/work-ally ally status --assistant <assistant-name>
54
60
  ```
55
61
 
56
62
  - 当前不支持用户侧定时任务能力;默认不会在无触发时自行执行任务
63
+ - Codex CLI 是必需依赖;未安装时请先按官方指南安装:<https://openrouter.ai/docs/guides/guides/codex-cli>
57
64
 
58
65
  ## 导出日志包(给支持同学)
59
66
 
@@ -12,6 +12,7 @@ usage() {
12
12
  Usage: $cmd_name <command> [args]
13
13
 
14
14
  Commands:
15
+ prepare # machine scope; preflight checks for Codex CLI prerequisites
15
16
  setup # assistant scope; requires --workspace <path>
16
17
  assistant <add|ensure|bind|remove|rename|list|show> [args] # global profile management
17
18
  start # assistant scope; use --assistant <name> when needed
@@ -51,6 +52,9 @@ work_ally_init_context
51
52
  work_ally_ensure_state_dirs
52
53
 
53
54
  case "$CMD" in
55
+ prepare)
56
+ exec "$SCRIPT_DIR/modules/runtime/prepare.sh" "$@"
57
+ ;;
54
58
  setup)
55
59
  exec "$SCRIPT_DIR/modules/bootstrap/setup.sh" "$@"
56
60
  ;;
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
5
+ # shellcheck disable=SC1091
6
+ . "$SCRIPT_DIR/../../lib/common.sh"
7
+
8
+ work_ally_init_context
9
+ work_ally_ensure_state_dirs
10
+
11
+ check_ok=1
12
+
13
+ work_ally_note "Running preflight checks for official Codex CLI integration"
14
+
15
+ if command -v codex >/dev/null 2>&1; then
16
+ codex_bin=$(command -v codex)
17
+ codex_version=$(codex --version 2>/dev/null | head -n 1 || true)
18
+ work_ally_ok "codex found: ${codex_bin}${codex_version:+ ($codex_version)}"
19
+ else
20
+ work_ally_warn "codex command not found"
21
+ check_ok=0
22
+ fi
23
+
24
+ global_codex_config="$HOME/.codex/config.toml"
25
+ if [ -f "$global_codex_config" ]; then
26
+ work_ally_ok "global Codex config found: $global_codex_config"
27
+ else
28
+ work_ally_warn "global Codex config missing: $global_codex_config"
29
+ check_ok=0
30
+ fi
31
+
32
+ if [ -n "${WORK_ALLY_ASSISTANT_NAME:-}" ] && work_ally_registry_has_assistant "$WORK_ALLY_ASSISTANT_NAME"; then
33
+ assistant_codex_home=$(work_ally_assistant_registered_codex_home "$WORK_ALLY_ASSISTANT_NAME")
34
+ if [ -n "$assistant_codex_home" ] && [ -d "$assistant_codex_home" ]; then
35
+ work_ally_ok "assistant codex home ready: $assistant_codex_home"
36
+ else
37
+ work_ally_warn "assistant codex home not ready for ${WORK_ALLY_ASSISTANT_NAME:-unknown}"
38
+ fi
39
+ fi
40
+
41
+ if [ "$check_ok" -eq 0 ]; then
42
+ cat <<'EOF2'
43
+
44
+ Codex CLI is required before using work-ally runtime features.
45
+ Install and configure Codex CLI first:
46
+ https://openrouter.ai/docs/guides/guides/codex-cli
47
+ EOF2
48
+ work_ally_die "Preflight failed"
49
+ fi
50
+
51
+ cat <<'EOF2'
52
+
53
+ Preflight passed.
54
+ You can continue with:
55
+ ally setup <assistant-name> --workspace <path>
56
+ ally start --assistant <assistant-name>
57
+ EOF2
58
+
59
+ work_ally_ok "Prepare checks passed"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "work-ally",
3
- "version": "0.2.0-alpha.2",
3
+ "version": "0.2.0-alpha.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  "test:full": "npm test",
26
26
  "test:fast": "node --test \"tests/unit/**/*.test.mjs\" \"tests/integration/**/*.test.mjs\"",
27
27
  "test:maintainer": "bash dev/run-regression-suite.sh",
28
- "test:shell": "bash tests/shell/smoke.sh && bash tests/shell/assistant.sh && bash tests/shell/assistant-remove.sh && bash tests/shell/assistant-rename.sh && bash tests/shell/assistant-lock.sh && bash tests/shell/global-entrypoint.sh && bash tests/shell/global-manage.sh && bash tests/shell/security.sh && bash tests/shell/ops.sh && bash tests/shell/lifecycle.sh && bash tests/shell/channel-lock.sh && bash tests/shell/mcp.sh && bash tests/shell/routines.sh && bash tests/shell/recovery.sh && bash tests/shell/service-mode.sh && bash tests/shell/bridge-health-fallback.sh && bash tests/shell/startup-delivery-gate.sh && bash tests/shell/status-health.sh && bash tests/shell/codex-runtime.sh && bash tests/shell/codex-handoff.sh && bash tests/shell/supervised-start-boundary.sh && bash tests/shell/log-export.sh",
28
+ "test:shell": "bash tests/shell/smoke.sh && bash tests/shell/assistant.sh && bash tests/shell/assistant-remove.sh && bash tests/shell/assistant-rename.sh && bash tests/shell/assistant-lock.sh && bash tests/shell/global-entrypoint.sh && bash tests/shell/global-manage.sh && bash tests/shell/security.sh && bash tests/shell/ops.sh && bash tests/shell/lifecycle.sh && bash tests/shell/channel-lock.sh && bash tests/shell/mcp.sh && bash tests/shell/routines.sh && bash tests/shell/recovery.sh && bash tests/shell/service-mode.sh && bash tests/shell/bridge-health-fallback.sh && bash tests/shell/startup-delivery-gate.sh && bash tests/shell/status-health.sh && bash tests/shell/codex-runtime.sh && bash tests/shell/codex-handoff.sh && bash tests/shell/supervised-start-boundary.sh && bash tests/shell/log-export.sh && bash tests/shell/prepare.sh",
29
29
  "test:bridge": "node --test \"tests/unit/**/*.test.mjs\" \"tests/integration/**/*.test.mjs\"",
30
30
  "dev:debug-workspace": "bash dev/prepare-debug-workspace.sh",
31
31
  "bridge:start": "node bridge/src/server.ts",