coze_lab 0.1.3 → 0.1.4

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/index.js CHANGED
@@ -3,7 +3,9 @@
3
3
 
4
4
  // ─── 0. Constants ─────────────────────────────────────────────────────────────
5
5
  const CLIENT_ID = '46371084383473718052118955183420.app.coze';
6
- const WORKSPACE_ID = '7645949103524380682';
6
+ const WORKSPACE_ID = '7644910356078837760';
7
+ // TEMP(test): 临时写死 token,跳过 OAuth。测试结束后请删除并恢复 getValidToken() 流程。
8
+ const HARDCODED_TOKEN = 'sat_KwzIM1cOhtgrKUAbxCbPTjmwxEktM61BVtkekkLD6DZldTv6keCtbzJHOzWaFynu';
7
9
  const COZE_API = 'https://api.coze.cn';
8
10
  const CREDS_PATH = require('path').join(require('os').homedir(), '.cozeloop', 'credentials.json');
9
11
  // Refresh when less than 10 minutes remain
@@ -4914,25 +4916,13 @@ async function main() {
4914
4916
 
4915
4917
  const { agent } = args;
4916
4918
 
4917
- // Step 1: Authorize (load cached refresh → device code)
4918
- // Step 2: Verify token works — if 401, refresh/re-auth and retry once
4919
- info('Step 1/5: 检查授权状态...');
4920
- let token = await getValidToken();
4919
+ // Step 1: Authorize — TEMP(test): 跳过 OAuth,直接使用写死 token
4920
+ // Step 2: Verify token works — TEMP(test): 一并跳过
4921
+ info('Step 1/5: 使用写死 token(已跳过 OAuth)...');
4922
+ let token = HARDCODED_TOKEN;
4921
4923
  console.log('');
4922
4924
 
4923
- info('Step 2/5: 验证工作空间权限...');
4924
- let verified = await verifyWorkspace(token);
4925
- if (verified === null) {
4926
- // Token rejected by API — clear cached creds and re-authorize
4927
- warn('Token 已失效,正在重新授权...');
4928
- deleteCredentials();
4929
- console.log('');
4930
- token = await deviceCodeAuth().then(c => c.access_token);
4931
- verified = await verifyWorkspace(token);
4932
- if (verified === null) {
4933
- errorBox(['ERROR: 重新授权后 Token 仍无效,请联系管理员。']);
4934
- }
4935
- }
4925
+ info('Step 2/5: 跳过工作空间权限验证(测试模式)...');
4936
4926
  console.log('');
4937
4927
 
4938
4928
  // Step 3: Detect agent binary
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coze_lab",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Configure local AI agents (Claude Code, Codex, OpenClaw) to report traces to CozeLoop",
5
5
  "keywords": [
6
6
  "cozeloop",
@@ -45,7 +45,7 @@ DEBUG = os.environ.get("CC_COZELOOP_DEBUG", "").lower() == "true"
45
45
  _COZELOOP_CLIENT_ID = "46371084383473718052118955183420.app.coze"
46
46
  _COZE_API = "https://api.coze.cn"
47
47
  _REFRESH_THRESHOLD = 10 * 60 # refresh when < 10 minutes remain
48
- _DEFAULT_WORKSPACE_ID = "7645949103524380682" # hardcoded spaceID fallback
48
+ _DEFAULT_WORKSPACE_ID = "7644910356078837760" # hardcoded spaceID fallback
49
49
 
50
50
 
51
51
  # --- coze-context parsing -------------------------------------------------
@@ -45,7 +45,7 @@ from typing import Optional, List, Dict, Any
45
45
  _COZELOOP_CLIENT_ID = "46371084383473718052118955183420.app.coze"
46
46
  _COZE_API = "https://api.coze.cn"
47
47
  _REFRESH_THRESHOLD = 10 * 60
48
- _DEFAULT_WORKSPACE_ID = "7645949103524380682" # hardcoded spaceID fallback
48
+ _DEFAULT_WORKSPACE_ID = "7644910356078837760" # hardcoded spaceID fallback
49
49
 
50
50
 
51
51
  # --- coze-context parsing -------------------------------------------------