opc-agent 4.1.16 → 4.1.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.
package/install.ps1 CHANGED
@@ -74,6 +74,12 @@ Write-Step "⚙️ 初始化 OPC Agent / Initializing"
74
74
  Write-Info "运行 opc init --yes ..."
75
75
  try { opc init --yes; Write-Ok "初始化完成 / initialized" } catch { Write-Warn "初始化跳过(可能已初始化)/ init skipped" }
76
76
 
77
+ # ── 进入项目目录后再检查 ──────────────────────────────────────
78
+ if (Test-Path "my-agent") {
79
+ Set-Location "my-agent"
80
+ Write-Info "已进入 my-agent/ 目录 / Entered my-agent/ directory"
81
+ }
82
+
77
83
  # ── 环境检查 ──────────────────────────────────────────────────
78
84
  Write-Step "🩺 环境检查 / Running Doctor"
79
85
  Write-Info "运行 opc doctor ..."
package/install.sh CHANGED
@@ -83,8 +83,14 @@ fi
83
83
 
84
84
  # ── 安装 OPC Agent ────────────────────────────────────────────
85
85
  step "🚀 安装 OPC Agent / Installing OPC Agent"
86
+ # Try without sudo first; if EACCES, retry with sudo
86
87
  info "运行 npm install -g opc-agent ..."
87
- npm install -g opc-agent
88
+ if npm install -g opc-agent 2>/dev/null; then
89
+ : # success
90
+ else
91
+ warn "权限不足,尝试 sudo / Permission denied, retrying with sudo..."
92
+ sudo npm install -g opc-agent
93
+ fi
88
94
 
89
95
  OPC_VER=$(opc --version 2>/dev/null || echo "unknown")
90
96
  ok "OPC Agent v${OPC_VER} 安装成功 / installed successfully"
@@ -94,6 +100,13 @@ step "⚙️ 初始化 OPC Agent / Initializing"
94
100
  info "运行 opc init --yes ..."
95
101
  opc init --yes && ok "初始化完成 / initialized" || warn "初始化跳过(可能已初始化)/ init skipped (may already exist)"
96
102
 
103
+ # ── 进入项目目录后再检查 ──────────────────────────────────────
104
+ # opc init creates my-agent/ by default; cd into it for doctor
105
+ if [ -d "my-agent" ]; then
106
+ cd my-agent
107
+ info "已进入 my-agent/ 目录 / Entered my-agent/ directory"
108
+ fi
109
+
97
110
  # ── 环境检查 ──────────────────────────────────────────────────
98
111
  step "🩺 环境检查 / Running Doctor"
99
112
  info "运行 opc doctor ..."
@@ -121,16 +134,19 @@ echo -e "${GREEN}┌────────────────────
121
134
  echo -e "${GREEN}│ │${NC}"
122
135
  echo -e "${GREEN}│ 🎊 OPC Agent 已就绪!/ OPC Agent is ready! │${NC}"
123
136
  echo -e "${GREEN}│ │${NC}"
124
- echo -e "${GREEN}│ 快速开始 / Quick Start: │${NC}"
137
+ echo -e "${GREEN}│ 👉 现在开始 / Get started NOW: │${NC}"
125
138
  echo -e "${GREEN}│ │${NC}"
126
- echo -e "${GREEN}│ opc chat 💬 开始对话 / Start chat │${NC}"
127
- echo -e "${GREEN}│ opc init my-agent 📁 创建新 Agent │${NC}"
128
- echo -e "${GREEN}│ opc studio 🖥️ 打开面板 / Dashboard │${NC}"
129
- echo -e "${GREEN}│ opc --help 📖 查看帮助 / Help │${NC}"
139
+ echo -e "${GREEN}│ cd my-agent 📂 进入项目目录 │${NC}"
140
+ echo -e "${GREEN}│ opc run 🚀 启动 Agent │${NC}"
141
+ echo -e "${GREEN}│ │${NC}"
142
+ echo -e "${GREEN}│ 启动后访问 / After start: │${NC}"
143
+ echo -e "${GREEN}│ http://localhost:3000 💬 Web 聊天 / Chat │${NC}"
144
+ echo -e "${GREEN}│ http://localhost:4000 🎨 Studio 管理面板 │${NC}"
130
145
  echo -e "${GREEN}│ │${NC}"
131
- echo -e "${GREEN}│ 无需全局安装也可使用 / Without global install: │${NC}"
132
- echo -e "${GREEN}│ npx opc-agent chat │${NC}"
133
- echo -e "${GREEN}│ npx opc-agent init my-agent │${NC}"
146
+ echo -e "${GREEN}│ 更多命令 / More commands: │${NC}"
147
+ echo -e "${GREEN}│ opc chat 💬 终端聊天 / Terminal chat │${NC}"
148
+ echo -e "${GREEN}│ opc doctor 🩺 环境检查 / Health check │${NC}"
149
+ echo -e "${GREEN}│ opc --help 📖 查看帮助 / Help │${NC}"
134
150
  echo -e "${GREEN}│ │${NC}"
135
151
  echo -e "${GREEN}│ 文档 / Docs: https://github.com/Deepleaper/opc-agent│${NC}"
136
152
  echo -e "${GREEN}│ │${NC}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opc-agent",
3
- "version": "4.1.16",
3
+ "version": "4.1.18",
4
4
  "description": "Open Agent Framework — Build, test, and run AI Agents for business workstations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",