coze_lab 0.1.8 → 0.1.9

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/index.js +8 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -5172,21 +5172,23 @@ async function main() {
5172
5172
  }
5173
5173
 
5174
5174
  // Step 1: Authorize.
5175
- // 云端(--cloud):token 取自环境变量 COZE_API_TOKEN,跳过 OAuth / credentials.json。
5175
+ // 云端(--cloud):token 取自 sandbox 注入的环境变量,跳过 OAuth / credentials.json。
5176
+ // 云端真实变量名是 COZELOOP_API_TOKEN(兼容历史的 COZE_API_TOKEN)。
5176
5177
  // 本地:load cached → refresh → device code。
5178
+ // 注意:workspace_id 始终用写死的 WORKSPACE_ID(团队固定上报 workspace),不读环境。
5177
5179
  let token;
5178
5180
  if (args.cloud) {
5179
- info('Step 1/5: 云端模式,从环境变量 COZE_API_TOKEN 读取 token...');
5180
- token = process.env.COZE_API_TOKEN;
5181
+ info('Step 1/5: 云端模式,从环境变量读取 COZELOOP_API_TOKEN...');
5182
+ token = process.env.COZELOOP_API_TOKEN || process.env.COZE_API_TOKEN;
5181
5183
  if (!token) {
5182
5184
  errorBox([
5183
- 'ERROR: --cloud 模式要求环境变量 COZE_API_TOKEN',
5185
+ 'ERROR: --cloud 模式要求环境变量 COZELOOP_API_TOKEN',
5184
5186
  '',
5185
- '云端 sandbox 应在进程环境中注入 COZE_API_TOKEN',
5187
+ '云端 sandbox 应在进程环境中注入 COZELOOP_API_TOKEN(或 COZE_API_TOKEN)。',
5186
5188
  '未检测到该变量,无法配置 trace 上报。',
5187
5189
  ]);
5188
5190
  }
5189
- ok('已从环境变量读取 COZE_API_TOKEN');
5191
+ ok('已从环境变量读取 COZELOOP_API_TOKEN');
5190
5192
  } else {
5191
5193
  info('Step 1/5: 检查授权状态...');
5192
5194
  token = await getValidToken();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coze_lab",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Configure local AI agents (Claude Code, Codex, OpenClaw) to report traces to CozeLoop",
5
5
  "keywords": [
6
6
  "cozeloop",