@thinkingai/ae-cli 6.0.48-customer.1 → 6.0.48-workbuddy
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 +93 -36
- package/README.zh.md +93 -36
- package/assets/workbuddy-host-page/thinkingai.png +0 -0
- package/assets/workbuddy-host-page/workbuddy.png +0 -0
- package/bin/ae-cli-workbuddy.js +7 -0
- package/dist/auth-HJG2L6DR.js +910 -0
- package/dist/{capability-RUSV77CO.js → capability-JHYVQNQ4.js} +47 -34
- package/dist/chunk-2BDQB42E.js +15 -0
- package/dist/{chunk-GJXRF7Y6.js → chunk-6MXFJVNP.js} +47 -78
- package/dist/chunk-6ZIQV5GW.js +26 -0
- package/dist/{chunk-KZ6ZHF5J.js → chunk-ARTIHWVD.js} +27 -25
- package/dist/{chunk-6QK7SYYY.js → chunk-DU5MZQFQ.js} +29 -37
- package/dist/{chunk-BVDST5YT.js → chunk-JFOGWBAT.js} +8 -8
- package/dist/{chunk-JYMGHGCE.js → chunk-KSQGGXGA.js} +24 -13
- package/dist/{chunk-FR2EDAQM.js → chunk-NXRKDG6E.js} +89 -3
- package/dist/{chunk-NSIVXKJH.js → chunk-QSO4SA6C.js} +5 -5
- package/dist/{chunk-BE73PUFX.js → chunk-QYJ252CT.js} +2 -2
- package/dist/{chunk-B5HMQAOM.js → chunk-UL6SJDYE.js} +1 -1
- package/dist/chunk-Y3S2KNNR.js +623 -0
- package/dist/{chunk-KEWVSO64.js → chunk-ZCM47ROU.js} +5 -16
- package/dist/{community-report-client-6OL6GBQW.js → community-report-client-QE4RC2XG.js} +2 -4
- package/dist/{config-XNMACCKX.js → config-XMRP5NDA.js} +8 -9
- package/dist/{data-integration-FZQQC3KW.js → data-integration-SGRITHJS.js} +9 -12
- package/dist/index.js +53 -80
- package/dist/{local-data-upload-client-EFHDLXFG.js → local-data-upload-client-LMVS7YAR.js} +2 -4
- package/dist/{memory-HBJQ2GC5.js → memory-5ZC73XBC.js} +4 -6
- package/dist/{metadata-PGDJE5RQ.js → metadata-LBX6O24P.js} +7 -9
- package/dist/{model-BHLJ2QMT.js → model-CRDIVYN5.js} +4 -6
- package/dist/{personal-semantic-preference-E5NZ56DN.js → personal-semantic-preference-7FVUTJZF.js} +6 -8
- package/dist/{sync-MUWPRM5I.js → sync-VVNDHU7R.js} +9 -11
- package/dist/{te-agent-WQZTMEK4.js → te-agent-4T5TFHD6.js} +393 -90
- package/dist/{te-analysis-YWCSSLYL.js → te-analysis-TPYFOIFD.js} +97 -31
- package/dist/{te-community-BNE6KREL.js → te-community-PWOTHSEC.js} +9 -32
- package/dist/{te-dataops-TXLKM2W6.js → te-dataops-ZJV5QVJU.js} +19 -20
- package/dist/{te-engage-VEW4CJHK.js → te-engage-WVHBZAXH.js} +11 -13
- package/dist/{te-kb-BUD6N3NI.js → te-kb-PNM2ZKBP.js} +595 -85
- package/dist/{te-system-44LZJDTQ.js → te-system-MRCMLAWW.js} +6 -8
- package/dist/{te-team-XMP47YXE.js → te-team-Y36TG6AQ.js} +6 -8
- package/dist/{update-UODFOZ4P.js → update-UNKCZ5U5.js} +7 -8
- package/package.json +15 -10
- package/skills/ae-agent/SKILL.md +30 -13
- package/skills/ae-agent/references/agent-distribution.md +94 -0
- package/skills/ae-agent/references/approval-request.md +4 -0
- package/skills/ae-agent/references/command_index.md +9 -2
- package/skills/ae-agent/references/create-automation.md +20 -2
- package/skills/ae-agent/references/get-agent-context.md +70 -0
- package/skills/ae-agent/references/list-automations.md +18 -3
- package/skills/ae-agent/references/list-mcp-credentials.md +1 -1
- package/skills/ae-agent/references/mcp-token.md +3 -3
- package/skills/ae-agent/references/set-mcp-credential.md +0 -1
- package/skills/ae-agent/references/update-automation.md +18 -0
- package/skills/ae-analysis/SKILL.md +11 -2
- package/skills/ae-analysis/references/adhoc_run.md +2 -0
- package/skills/ae-analysis/references/ai_models.md +23 -3
- package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -2
- package/skills/ae-analysis/references/command_index.md +7 -7
- package/skills/ae-analysis/references/cross_source_config.md +84 -0
- package/skills/ae-analysis/references/dashboard_update.md +1 -1
- package/skills/ae-analysis/references/user_tag_create.md +23 -1
- package/skills/ae-analysis/references/user_tag_models.md +9 -1
- package/skills/ae-analysis/references/user_tag_update.md +14 -2
- package/skills/ae-data-integration/SKILL.md +2 -1
- package/skills/ae-data-integration/references/dimension-routing.md +36 -0
- package/skills/ae-data-integration/references/local-analysis.md +2 -0
- package/skills/ae-data-integration/references/source-inspect.md +1 -1
- package/skills/ae-data-integration/references/ue-routing.md +17 -1
- package/skills/ae-generate-tracking-plan/SKILL.md +16 -5
- package/skills/ae-kb/SKILL.md +107 -36
- package/skills/ae-kb/references/query-workflow.md +59 -29
- package/skills/ae-kb/references/versions.md +46 -0
- package/skills/ae-system/SKILL.md +1 -1
- package/skills/ae-use-agent/SKILL.md +42 -0
- package/skills/ae-use-agent/references/local-agent.md +114 -0
- package/dist/auth-QPEVVBKT.js +0 -465
- package/dist/auth-UMJAA72O.js +0 -15
- package/dist/chunk-533JK3YX.js +0 -72
- package/dist/chunk-O6K2ODUE.js +0 -318
- package/dist/chunk-RWXIXOZG.js +0 -326
- package/dist/client-N7NGZUNI.js +0 -204
- package/skills/ae-agent/references/auto-provision-mcp-credentials.md +0 -57
package/dist/client-N7NGZUNI.js
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
SecureStoreAuthError,
|
|
4
|
-
getToken,
|
|
5
|
-
invalidateAccessTokenForRetry,
|
|
6
|
-
resolveHost
|
|
7
|
-
} from "./chunk-O6K2ODUE.js";
|
|
8
|
-
import {
|
|
9
|
-
safeJsonParse
|
|
10
|
-
} from "./chunk-KZ6ZHF5J.js";
|
|
11
|
-
import {
|
|
12
|
-
logger
|
|
13
|
-
} from "./chunk-FR2EDAQM.js";
|
|
14
|
-
|
|
15
|
-
// src/core/client.ts
|
|
16
|
-
import WebSocket from "ws";
|
|
17
|
-
import { randomBytes } from "crypto";
|
|
18
|
-
function genRequestId(prefix) {
|
|
19
|
-
const rand = randomBytes(4).toString("base64url").slice(0, 8);
|
|
20
|
-
return `${prefix}@@${rand}`;
|
|
21
|
-
}
|
|
22
|
-
function buildUrl(baseUrl, modulePath, params = {}) {
|
|
23
|
-
const base = baseUrl.replace(/\/$/, "");
|
|
24
|
-
const p = modulePath.startsWith("/") ? modulePath : `/${modulePath}`;
|
|
25
|
-
const url = new URL(`${base}${p}`);
|
|
26
|
-
for (const [k, v] of Object.entries(params)) {
|
|
27
|
-
if (v !== void 0 && v !== null) url.searchParams.set(k, String(v));
|
|
28
|
-
}
|
|
29
|
-
return url.toString();
|
|
30
|
-
}
|
|
31
|
-
function buildWsUrl(baseUrl, token) {
|
|
32
|
-
const base = baseUrl.replace(/\/$/, "");
|
|
33
|
-
const wsBase = base.replace(/^https:\/\//, "wss://").replace(/^http:\/\//, "ws://");
|
|
34
|
-
return `${wsBase}/v1/ta-websocket/query/${token}`;
|
|
35
|
-
}
|
|
36
|
-
async function request(method, modulePath, params = {}, body = null, retry = true, hostUrl) {
|
|
37
|
-
const resolvedHost = resolveHost(hostUrl);
|
|
38
|
-
const token = await getToken(resolvedHost);
|
|
39
|
-
const url = buildUrl(resolvedHost, modulePath, params);
|
|
40
|
-
const headers = {
|
|
41
|
-
"Authorization": `bearer ${token}`,
|
|
42
|
-
"Content-Type": "application/json"
|
|
43
|
-
};
|
|
44
|
-
const options = { method, headers };
|
|
45
|
-
if (body && method !== "GET") options.body = JSON.stringify(body);
|
|
46
|
-
const resp = await fetch(url, options);
|
|
47
|
-
const text = await resp.text();
|
|
48
|
-
const data = safeJsonParse(text);
|
|
49
|
-
logger.api(method, url, resp.status, body, data);
|
|
50
|
-
if (resp.status === 401) {
|
|
51
|
-
if (retry) {
|
|
52
|
-
invalidateAccessTokenForRetry(resolvedHost);
|
|
53
|
-
return request(method, modulePath, params, body, false, resolvedHost);
|
|
54
|
-
}
|
|
55
|
-
throw new SecureStoreAuthError(`Session expired or unauthorized for ${resolvedHost}. Please run: ae-cli auth login`);
|
|
56
|
-
}
|
|
57
|
-
if (resp.status === 403) {
|
|
58
|
-
const m = data && typeof data === "object" && typeof data.error === "string" ? data.error : "Permission denied";
|
|
59
|
-
throw new Error(m);
|
|
60
|
-
}
|
|
61
|
-
if (data.return_code === -1001 && retry) {
|
|
62
|
-
invalidateAccessTokenForRetry(resolvedHost);
|
|
63
|
-
return request(method, modulePath, params, body, false, resolvedHost);
|
|
64
|
-
}
|
|
65
|
-
if (data.return_code !== 0 && data.return_code !== void 0) {
|
|
66
|
-
throw new Error(`AE API error: ${data.return_message || "unknown"} (code: ${data.return_code})`);
|
|
67
|
-
}
|
|
68
|
-
return data.data !== void 0 ? data.data : data;
|
|
69
|
-
}
|
|
70
|
-
async function httpGet(modulePath, params = {}, hostUrl) {
|
|
71
|
-
return request("GET", modulePath, params, null, true, hostUrl);
|
|
72
|
-
}
|
|
73
|
-
async function httpPost(modulePath, params = {}, body, hostUrl) {
|
|
74
|
-
return request("POST", modulePath, params, body ?? {}, true, hostUrl);
|
|
75
|
-
}
|
|
76
|
-
async function httpRequest(method, modulePath, params = {}, body, hostUrl) {
|
|
77
|
-
return request(method.toUpperCase(), modulePath, params, body ?? {}, true, hostUrl);
|
|
78
|
-
}
|
|
79
|
-
async function httpDelete(modulePath, params = {}, body, hostUrl) {
|
|
80
|
-
return request("DELETE", modulePath, params, body ?? null, true, hostUrl);
|
|
81
|
-
}
|
|
82
|
-
async function uploadRequest(modulePath, form, params = {}, retry = true, hostUrl) {
|
|
83
|
-
const resolvedHost = resolveHost(hostUrl);
|
|
84
|
-
const token = await getToken(resolvedHost);
|
|
85
|
-
const url = buildUrl(resolvedHost, modulePath, params);
|
|
86
|
-
const headers = {
|
|
87
|
-
"Authorization": `bearer ${token}`
|
|
88
|
-
};
|
|
89
|
-
const resp = await fetch(url, { method: "POST", headers, body: form });
|
|
90
|
-
const text = await resp.text();
|
|
91
|
-
const data = safeJsonParse(text);
|
|
92
|
-
logger.api("POST", url, resp.status, { upload: true }, data);
|
|
93
|
-
if (resp.status === 401) {
|
|
94
|
-
if (retry) {
|
|
95
|
-
invalidateAccessTokenForRetry(resolvedHost);
|
|
96
|
-
return uploadRequest(modulePath, form, params, false, resolvedHost);
|
|
97
|
-
}
|
|
98
|
-
throw new SecureStoreAuthError(`Session expired or unauthorized for ${resolvedHost}. Please run: ae-cli auth login`);
|
|
99
|
-
}
|
|
100
|
-
if (resp.status === 403) {
|
|
101
|
-
const m = data && typeof data === "object" && typeof data.error === "string" ? data.error : "Permission denied";
|
|
102
|
-
throw new Error(m);
|
|
103
|
-
}
|
|
104
|
-
if (data.return_code === -1001 && retry) {
|
|
105
|
-
invalidateAccessTokenForRetry(resolvedHost);
|
|
106
|
-
return uploadRequest(modulePath, form, params, false, resolvedHost);
|
|
107
|
-
}
|
|
108
|
-
if (data.return_code !== 0 && data.return_code !== void 0) {
|
|
109
|
-
throw new Error(`AE API error: ${data.return_message || "unknown"} (code: ${data.return_code})`);
|
|
110
|
-
}
|
|
111
|
-
return data.data !== void 0 ? data.data : data;
|
|
112
|
-
}
|
|
113
|
-
async function httpUpload(modulePath, form, params = {}, hostUrl) {
|
|
114
|
-
return uploadRequest(modulePath, form, params, true, hostUrl);
|
|
115
|
-
}
|
|
116
|
-
async function wsQueryOnce(projectId, requestId, qp, eventModel, options = {}, token, hostUrl, timeoutMs = 3e4) {
|
|
117
|
-
const wsUrl = buildWsUrl(hostUrl, token);
|
|
118
|
-
return new Promise((resolve, reject) => {
|
|
119
|
-
const ws = new WebSocket(wsUrl);
|
|
120
|
-
const timer = setTimeout(() => {
|
|
121
|
-
ws.close();
|
|
122
|
-
reject(new Error(`WebSocket query timed out after ${timeoutMs}ms`));
|
|
123
|
-
}, timeoutMs);
|
|
124
|
-
ws.on("open", () => {
|
|
125
|
-
const payload = {
|
|
126
|
-
requestId,
|
|
127
|
-
projectId,
|
|
128
|
-
eventModel,
|
|
129
|
-
qp: typeof qp === "string" ? qp : JSON.stringify(qp),
|
|
130
|
-
searchSource: options.searchSource || "reportQuery",
|
|
131
|
-
querySource: options.querySource || "single_report",
|
|
132
|
-
contentTranslate: options.contentTranslate !== false,
|
|
133
|
-
...options.extra || {}
|
|
134
|
-
};
|
|
135
|
-
ws.send(JSON.stringify(["data", payload, { channel: "ta" }]));
|
|
136
|
-
});
|
|
137
|
-
ws.on("message", (raw) => {
|
|
138
|
-
try {
|
|
139
|
-
const msg = safeJsonParse(raw.toString());
|
|
140
|
-
if (Array.isArray(msg) && msg.length >= 2) {
|
|
141
|
-
const data = msg[1];
|
|
142
|
-
if (data.requestId === requestId && data.progress === 100) {
|
|
143
|
-
clearTimeout(timer);
|
|
144
|
-
ws.close();
|
|
145
|
-
resolve(data);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
} catch {
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
ws.on("error", (err) => {
|
|
152
|
-
clearTimeout(timer);
|
|
153
|
-
reject(err);
|
|
154
|
-
});
|
|
155
|
-
ws.on("close", () => {
|
|
156
|
-
clearTimeout(timer);
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
async function wsQuery(projectId, requestId, qp, eventModel, options = {}, hostUrl) {
|
|
161
|
-
const resolvedHost = resolveHost(hostUrl);
|
|
162
|
-
const token = await getToken(resolvedHost);
|
|
163
|
-
try {
|
|
164
|
-
return await wsQueryOnce(projectId, requestId, qp, eventModel, options, token, resolvedHost);
|
|
165
|
-
} catch (err) {
|
|
166
|
-
const msg = err.message || "";
|
|
167
|
-
if (msg.includes("401") || msg.includes("403") || msg.includes("auth")) {
|
|
168
|
-
invalidateAccessTokenForRetry(resolvedHost);
|
|
169
|
-
const newToken = await getToken(resolvedHost);
|
|
170
|
-
return wsQueryOnce(projectId, requestId, qp, eventModel, options, newToken, resolvedHost);
|
|
171
|
-
}
|
|
172
|
-
throw err;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
async function querySql(projectId, sql, hostUrl) {
|
|
176
|
-
const requestId = genRequestId("sqlIde");
|
|
177
|
-
const qp = {
|
|
178
|
-
events: { sql },
|
|
179
|
-
eventView: { sqlViewParams: [] }
|
|
180
|
-
};
|
|
181
|
-
return wsQuery(projectId, requestId, qp, 10, {
|
|
182
|
-
searchSource: "sqlIde",
|
|
183
|
-
querySource: "sqlIde"
|
|
184
|
-
}, hostUrl);
|
|
185
|
-
}
|
|
186
|
-
async function queryReportData(projectId, reportId, qp, eventModel, options = {}, hostUrl) {
|
|
187
|
-
const dashboardId = options.dashboardId || 0;
|
|
188
|
-
const requestId = genRequestId(`${projectId}_${dashboardId}_${reportId}`);
|
|
189
|
-
return wsQuery(projectId, requestId, qp, eventModel, {
|
|
190
|
-
searchSource: options.searchSource || "model_search",
|
|
191
|
-
querySource: options.querySource || "module",
|
|
192
|
-
...options
|
|
193
|
-
}, hostUrl);
|
|
194
|
-
}
|
|
195
|
-
export {
|
|
196
|
-
httpDelete,
|
|
197
|
-
httpGet,
|
|
198
|
-
httpPost,
|
|
199
|
-
httpRequest,
|
|
200
|
-
httpUpload,
|
|
201
|
-
queryReportData,
|
|
202
|
-
querySql,
|
|
203
|
-
wsQuery
|
|
204
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# agent +auto-provision-mcp-credentials (Auto-Provision MCP Credentials)
|
|
2
|
-
|
|
3
|
-
> **Prerequisite:** Follow the Global AE CLI Rules in [`../SKILL.md`](../SKILL.md).
|
|
4
|
-
|
|
5
|
-
Domain: **MCP Credentials / write**
|
|
6
|
-
|
|
7
|
-
## Use Cases
|
|
8
|
-
- Auto-provision per-user credentials for all system-scope MCP servers in one call.
|
|
9
|
-
- Endpoint: `POST /api/sandbox/agent/mcp-credentials/auto-provision`.
|
|
10
|
-
- Uses the current user's access token to mint MCP tokens via the central token-generation endpoint.
|
|
11
|
-
- For `useMcpToken=true` system servers, a shared MCP token is generated and stored; for OAuth system servers, the access token is stored as the credential.
|
|
12
|
-
|
|
13
|
-
## Mandatory Rules (MUST)
|
|
14
|
-
- `--access-token` is optional; when omitted, the current session token is used automatically (via `ctx.token()`).
|
|
15
|
-
- The access token must be valid — an invalid/expired token causes the MCP token generation to fail (reported via `mcpTokenFailed: true` in the response).
|
|
16
|
-
- This is an ordinary `write` operation and does not require CLI confirmation.
|
|
17
|
-
- This is a bulk operation — it upserts credentials for ALL system MCP servers visible to the current user.
|
|
18
|
-
|
|
19
|
-
## Command
|
|
20
|
-
```bash
|
|
21
|
-
# Auto-provision using the current session token (recommended)
|
|
22
|
-
ae-cli agent +auto-provision-mcp-credentials
|
|
23
|
-
|
|
24
|
-
# Explicitly pass an access token
|
|
25
|
-
ae-cli agent +auto-provision-mcp-credentials --access-token "eyJhbGci..."
|
|
26
|
-
|
|
27
|
-
# Dry-run to inspect the request
|
|
28
|
-
ae-cli agent +auto-provision-mcp-credentials --dry-run
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Parameters
|
|
32
|
-
| Parameter | Required | Description |
|
|
33
|
-
|---|---|---|
|
|
34
|
-
| `--access-token` | No | Access token (defaults to the current session token) |
|
|
35
|
-
|
|
36
|
-
## Decision Rules
|
|
37
|
-
- If the user wants to set up all system MCP credentials in one step, use this command.
|
|
38
|
-
- Prefer running without `--access-token` — the CLI automatically sources the current session token.
|
|
39
|
-
- The response reports `count` (total system servers processed), `mcpTokenCount` (servers that got a shared MCP token), and `mcpTokenFailed` (whether the MCP token generation failed).
|
|
40
|
-
- If `mcpTokenFailed` is `true`, the MCP token endpoint may be down or the access token invalid — check the access token and retry.
|
|
41
|
-
- For individual credential control, use `+set-mcp-credential` instead.
|
|
42
|
-
|
|
43
|
-
## Response Shape
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"count": 3,
|
|
47
|
-
"mcpTokenCount": 1,
|
|
48
|
-
"mcpTokenFailed": false
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Next Steps on Failure
|
|
53
|
-
- `401` / auth expired: run `ae-cli auth login`, then retry.
|
|
54
|
-
- `mcpTokenFailed: true`: the MCP token generation failed — verify the access token is valid and the MCP token endpoint is configured.
|
|
55
|
-
|
|
56
|
-
## Recommended Chaining
|
|
57
|
-
- `ae-cli auth login` → `+auto-provision-mcp-credentials` → `+list-mcp-credentials` (verify) → `+mcp-token` (get shared token)
|