@thinkingai/ae-cli 6.1.17 → 6.1.19
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 +2 -0
- package/README.zh.md +6 -0
- package/dist/{auth-77BUFLGC.js → auth-QPEVVBKT.js} +20 -15
- package/dist/auth-UMJAA72O.js +15 -0
- package/dist/{capability-72DTW5M2.js → capability-ASI62I4A.js} +53 -15
- package/dist/{chunk-UW5UN47B.js → chunk-533JK3YX.js} +2 -0
- package/dist/{chunk-UOUS37JQ.js → chunk-6QK7SYYY.js} +5 -4
- package/dist/{chunk-TUKQZTMI.js → chunk-7K24F7T2.js} +2 -0
- package/dist/{chunk-OO6XR6LK.js → chunk-AMBFK2K3.js} +2 -0
- package/dist/{sync-DAVKYVMW.js → chunk-B5HMQAOM.js} +31 -540
- package/dist/{chunk-VR3LCBHW.js → chunk-DKEXH6Q5.js} +6 -5
- package/dist/{chunk-VTWMIC5L.js → chunk-E2JKXMVO.js} +2 -0
- package/dist/{chunk-LYVNONC4.js → chunk-FR2EDAQM.js} +36 -0
- package/dist/{chunk-ILIU36SU.js → chunk-GJXRF7Y6.js} +6 -5
- package/dist/{chunk-DWO43OIB.js → chunk-JQ3ENZZH.js} +2 -0
- package/dist/chunk-JYMGHGCE.js +191 -0
- package/dist/{chunk-GT46FPXN.js → chunk-KEWVSO64.js} +18 -8
- package/dist/chunk-KZ6ZHF5J.js +294 -0
- package/dist/chunk-O6K2ODUE.js +318 -0
- package/dist/chunk-QL6R6TSK.js +25215 -0
- package/dist/{chunk-4SGZG4XY.js → chunk-RWXIXOZG.js} +28 -13
- package/dist/{chunk-YA6SMTXG.js → chunk-S5PONFBM.js} +5 -4
- package/dist/{chunk-4NN5IWVN.js → chunk-T6OSFQZD.js} +2 -0
- package/dist/{chunk-PTE56QPL.js → chunk-TKHSULJT.js} +6 -0
- package/dist/{chunk-6EIJSNBD.js → chunk-Y74WTIKJ.js} +2 -0
- package/dist/{client-TKG4WBHN.js → client-N7NGZUNI.js} +6 -4
- package/dist/{community-report-client-FI4LNVYS.js → community-report-client-6OL6GBQW.js} +3 -3
- package/dist/{config-RE6CMGPK.js → config-XNMACCKX.js} +10 -8
- package/dist/{data-integration-XQYB4X4F.js → data-integration-4NZGZ45E.js} +2502 -272
- package/dist/index.js +137 -1245
- package/dist/{local-data-upload-client-BWHSUQQK.js → local-data-upload-client-EFHDLXFG.js} +3 -3
- package/dist/{memory-YK33G4T7.js → memory-HBJQ2GC5.js} +8 -7
- package/dist/{metadata-UILXHBWF.js → metadata-62EWBEIG.js} +12 -11
- package/dist/{model-NR3JHFSJ.js → model-BHLJ2QMT.js} +10 -9
- package/dist/personal-semantic-preference-JBVMAI7L.js +240 -0
- package/dist/project-semantic-BQ4MPUS5.js +1115 -0
- package/dist/sync-MUWPRM5I.js +522 -0
- package/dist/{te-agent-4BKBODMF.js → te-agent-WQZTMEK4.js} +12 -10
- package/dist/{te-analysis-O6DCO6BS.js → te-analysis-MNCG65LU.js} +534 -48
- package/dist/{te-community-HLC43QKH.js → te-community-BNE6KREL.js} +8 -7
- package/dist/{te-dataops-EJP56W3K.js → te-dataops-TXLKM2W6.js} +469 -68
- package/dist/{te-engage-FGBGQ4IY.js → te-engage-TPKLRVTL.js} +84 -10
- package/dist/{te-experiment-SO5MPDMJ.js → te-experiment-6BYKTCY7.js} +303 -12
- package/dist/{te-kb-SQCLHG6X.js → te-kb-BUD6N3NI.js} +312 -25
- package/dist/{te-system-YARIK4S5.js → te-system-44LZJDTQ.js} +573 -37
- package/dist/{te-team-EFKWYKMK.js → te-team-XMP47YXE.js} +10 -7
- package/dist/{update-OGPSZM5A.js → update-UODFOZ4P.js} +9 -7
- package/package.json +18 -9
- package/skills/ae-agent/SKILL.md +3 -4
- package/skills/ae-agent/references/edit-skill.md +3 -0
- package/skills/ae-agent/references/get-skill-content.md +1 -1
- package/skills/ae-agent/references/rescan-skills.md +15 -13
- package/skills/ae-agent/references/upload-skill.md +7 -4
- package/skills/ae-analysis/SKILL.md +45 -4
- package/skills/ae-analysis/metadata_resolution.md +38 -4
- package/skills/ae-analysis/references/analysis_data_retrieval.md +29 -0
- package/skills/ae-analysis/references/analysis_gateway_assets.md +1 -1
- package/skills/ae-analysis/references/asset_authentication_export.md +22 -0
- package/skills/ae-analysis/references/asset_authentication_list.md +18 -14
- package/skills/ae-analysis/references/asset_authentication_update.md +29 -14
- package/skills/ae-analysis/references/audience_models.md +18 -0
- package/skills/ae-analysis/references/command_index.md +19 -11
- package/skills/ae-analysis/references/dashboard_get.md +18 -1
- package/skills/ae-analysis/references/dashboard_update.md +3 -0
- package/skills/ae-analysis/references/personal_semantic_preference_add.md +23 -0
- package/skills/ae-analysis/references/personal_semantic_preference_delete.md +17 -0
- package/skills/ae-analysis/references/personal_semantic_preference_get.md +19 -0
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +21 -0
- package/skills/ae-analysis/references/personal_semantic_preference_update.md +19 -0
- package/skills/ae-analysis/references/project_timezone_update.md +13 -4
- package/skills/ae-analysis/references/property_create.md +2 -0
- package/skills/ae-analysis/references/super_metadata_batch_create.md +2 -0
- package/skills/ae-analysis/references/user_cluster_models.md +2 -0
- package/skills/ae-analysis/references/user_cluster_update.md +8 -4
- package/skills/ae-analysis/references/user_tag_create.md +7 -1
- package/skills/ae-analysis/references/user_tag_models.md +8 -2
- package/skills/ae-data-integration/SKILL.md +24 -4
- package/skills/ae-data-integration/references/custom-layer.md +93 -0
- package/skills/ae-data-integration/references/error-handling.md +145 -0
- package/skills/ae-data-integration/references/handoff.md +77 -18
- package/skills/ae-data-integration/references/local-analysis.md +1 -1
- package/skills/ae-data-integration/references/reuse.md +9 -5
- package/skills/ae-data-integration/references/sink-upload.md +1 -1
- package/skills/ae-data-integration/references/source-inspect.md +35 -13
- package/skills/ae-data-integration/references/tracking-plan.md +7 -5
- package/skills/ae-data-integration/references/transform.md +12 -10
- package/skills/ae-data-integration/references/ue-mapping.md +33 -11
- package/skills/ae-data-integration/references/ue-routing.md +23 -0
- package/skills/ae-dataops/SKILL.md +11 -1
- package/skills/ae-dataops/references/dataops-backfill.md +135 -0
- package/skills/ae-engage/SKILL.md +5 -0
- package/skills/ae-engage/references/build-task-save-guide.md +14 -1
- package/skills/ae-engage/references/save-flow.md +37 -1
- package/skills/ae-engage/references/save-task.md +88 -0
- package/skills/ae-experiment/SKILL.md +14 -4
- package/skills/ae-experiment/references/manage_feature_whitelist.md +66 -0
- package/skills/ae-experiment/references/manage_guardrail_metrics.md +26 -0
- package/skills/ae-experiment/references/save_experiment.md +1 -1
- package/skills/ae-experiment/references/save_metric.md +20 -8
- package/skills/ae-kb/SKILL.md +121 -10
- package/skills/ae-project-semantic/SKILL.md +193 -0
- package/skills/ae-project-semantic/references/query-routing-v5.md +165 -0
- package/skills/ae-project-semantic/references/recommendation-quality.md +68 -0
- package/skills/ae-system/SKILL.md +28 -30
- package/skills/ae-system/references/channel-management.md +303 -0
- package/dist/auth-2WTQOP77.js +0 -14
- package/dist/capability-PJHNI4GJ.js +0 -315
- package/dist/chunk-4KVPKXFX.js +0 -98
- package/dist/chunk-C4MGVGJW.js +0 -13
- package/dist/chunk-P3FGXJTU.js +0 -349
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/chunk-RGKJGKT7.js +0 -71
- package/dist/chunk-SAU3QFIQ.js +0 -556
- package/dist/chunk-VPKZ7I72.js +0 -509
- package/dist/chunk-ZZUOD757.js +0 -598
- package/dist/memory-CHRU2F7W.js +0 -893
- package/dist/metadata-XXR34N5P.js +0 -339
- package/dist/model-K3KLWIW6.js +0 -139
- package/dist/sync-FCKOVWWS.js +0 -10261
- package/dist/te-agent-HLW4VTQK.js +0 -3893
- package/dist/te-analysis-ZMNGOVNW.js +0 -8958
- package/dist/te-community-6HPBWJUZ.js +0 -1859
- package/dist/te-dataops-HDRUXY4K.js +0 -2208
- package/dist/te-engage-RAK5PESW.js +0 -4898
- package/dist/te-experiment-VZF7BT6G.js +0 -770
- package/dist/te-system-Z77IKZFN.js +0 -2213
|
@@ -1,44 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SKILL_MANIFEST_FILE,
|
|
3
|
-
assertValidMcpName,
|
|
4
|
-
assertValidSkillSlug,
|
|
5
|
-
describeSource,
|
|
6
|
-
getCurrentWorkspace,
|
|
7
|
-
readSkillManifestEntries,
|
|
8
|
-
scanMcps,
|
|
9
|
-
scanSkills,
|
|
10
|
-
splitPushableMcps,
|
|
11
|
-
writeSkillManifestEntries
|
|
12
|
-
} from "./chunk-DWO43OIB.js";
|
|
13
|
-
import {
|
|
14
|
-
MultiselectCancelled,
|
|
15
|
-
promptMultiselect,
|
|
16
|
-
promptSingleSelect
|
|
17
|
-
} from "./chunk-TUKQZTMI.js";
|
|
18
|
-
import {
|
|
19
|
-
assertSkillDocumentSize
|
|
20
|
-
} from "./chunk-4NN5IWVN.js";
|
|
21
|
-
import {
|
|
22
|
-
TeAgentApiError,
|
|
23
|
-
TeAgentCredentialsError,
|
|
24
|
-
getSandboxSyncPullCandidates,
|
|
25
|
-
postSandboxSyncPull,
|
|
26
|
-
postToMainApp,
|
|
27
|
-
uploadToMainApp
|
|
28
|
-
} from "./chunk-UOUS37JQ.js";
|
|
29
|
-
import {
|
|
30
|
-
printError
|
|
31
|
-
} from "./chunk-GT46FPXN.js";
|
|
32
|
-
import "./chunk-C4MGVGJW.js";
|
|
33
|
-
import "./chunk-4SGZG4XY.js";
|
|
34
|
-
import "./chunk-ZZUOD757.js";
|
|
35
|
-
import "./chunk-UW5UN47B.js";
|
|
36
|
-
import "./chunk-LYVNONC4.js";
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
37
2
|
import {
|
|
38
3
|
__commonJS,
|
|
39
|
-
__require
|
|
40
|
-
|
|
41
|
-
} from "./chunk-QGM4M3NI.js";
|
|
4
|
+
__require
|
|
5
|
+
} from "./chunk-FR2EDAQM.js";
|
|
42
6
|
|
|
43
7
|
// node_modules/process-nextick-args/index.js
|
|
44
8
|
var require_process_nextick_args = __commonJS({
|
|
@@ -327,7 +291,7 @@ var require_BufferList = __commonJS({
|
|
|
327
291
|
this.head = this.tail = null;
|
|
328
292
|
this.length = 0;
|
|
329
293
|
};
|
|
330
|
-
BufferList.prototype.join = function
|
|
294
|
+
BufferList.prototype.join = function join(s) {
|
|
331
295
|
if (this.length === 0) return "";
|
|
332
296
|
var p = this.head;
|
|
333
297
|
var ret = "" + p.data;
|
|
@@ -2917,8 +2881,8 @@ var require_utils = __commonJS({
|
|
|
2917
2881
|
var result = transform[inputType][outputType](input);
|
|
2918
2882
|
return result;
|
|
2919
2883
|
};
|
|
2920
|
-
exports.resolve = function(
|
|
2921
|
-
var parts =
|
|
2884
|
+
exports.resolve = function(path) {
|
|
2885
|
+
var parts = path.split("/");
|
|
2922
2886
|
var result = [];
|
|
2923
2887
|
for (var index = 0; index < parts.length; index++) {
|
|
2924
2888
|
var part = parts[index];
|
|
@@ -8771,18 +8735,18 @@ var require_object = __commonJS({
|
|
|
8771
8735
|
var object = new ZipObject(name, zipObjectContent, o);
|
|
8772
8736
|
this.files[name] = object;
|
|
8773
8737
|
};
|
|
8774
|
-
var parentFolder = function(
|
|
8775
|
-
if (
|
|
8776
|
-
|
|
8738
|
+
var parentFolder = function(path) {
|
|
8739
|
+
if (path.slice(-1) === "/") {
|
|
8740
|
+
path = path.substring(0, path.length - 1);
|
|
8777
8741
|
}
|
|
8778
|
-
var lastSlash =
|
|
8779
|
-
return lastSlash > 0 ?
|
|
8742
|
+
var lastSlash = path.lastIndexOf("/");
|
|
8743
|
+
return lastSlash > 0 ? path.substring(0, lastSlash) : "";
|
|
8780
8744
|
};
|
|
8781
|
-
var forceTrailingSlash = function(
|
|
8782
|
-
if (
|
|
8783
|
-
|
|
8745
|
+
var forceTrailingSlash = function(path) {
|
|
8746
|
+
if (path.slice(-1) !== "/") {
|
|
8747
|
+
path += "/";
|
|
8784
8748
|
}
|
|
8785
|
-
return
|
|
8749
|
+
return path;
|
|
8786
8750
|
};
|
|
8787
8751
|
var folderAdd = function(name, createFolders) {
|
|
8788
8752
|
createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
|
|
@@ -9748,9 +9712,9 @@ var require_load = __commonJS({
|
|
|
9748
9712
|
var require_lib3 = __commonJS({
|
|
9749
9713
|
"node_modules/jszip/lib/index.js"(exports, module) {
|
|
9750
9714
|
"use strict";
|
|
9751
|
-
function
|
|
9752
|
-
if (!(this instanceof
|
|
9753
|
-
return new
|
|
9715
|
+
function JSZip() {
|
|
9716
|
+
if (!(this instanceof JSZip)) {
|
|
9717
|
+
return new JSZip();
|
|
9754
9718
|
}
|
|
9755
9719
|
if (arguments.length) {
|
|
9756
9720
|
throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
|
|
@@ -9759,7 +9723,7 @@ var require_lib3 = __commonJS({
|
|
|
9759
9723
|
this.comment = null;
|
|
9760
9724
|
this.root = "";
|
|
9761
9725
|
this.clone = function() {
|
|
9762
|
-
var newObj = new
|
|
9726
|
+
var newObj = new JSZip();
|
|
9763
9727
|
for (var i in this) {
|
|
9764
9728
|
if (typeof this[i] !== "function") {
|
|
9765
9729
|
newObj[i] = this[i];
|
|
@@ -9768,494 +9732,21 @@ var require_lib3 = __commonJS({
|
|
|
9768
9732
|
return newObj;
|
|
9769
9733
|
};
|
|
9770
9734
|
}
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
return new
|
|
9735
|
+
JSZip.prototype = require_object();
|
|
9736
|
+
JSZip.prototype.loadAsync = require_load();
|
|
9737
|
+
JSZip.support = require_support();
|
|
9738
|
+
JSZip.defaults = require_defaults();
|
|
9739
|
+
JSZip.version = "3.10.1";
|
|
9740
|
+
JSZip.loadAsync = function(content, options) {
|
|
9741
|
+
return new JSZip().loadAsync(content, options);
|
|
9778
9742
|
};
|
|
9779
|
-
|
|
9780
|
-
module.exports =
|
|
9743
|
+
JSZip.external = require_external();
|
|
9744
|
+
module.exports = JSZip;
|
|
9781
9745
|
}
|
|
9782
9746
|
});
|
|
9783
9747
|
|
|
9784
|
-
// src/commands/sync/index.ts
|
|
9785
|
-
var import_jszip = __toESM(require_lib3(), 1);
|
|
9786
|
-
import Table from "cli-table3";
|
|
9787
|
-
import { lstatSync, readFileSync as readFileSync2, readdirSync } from "fs";
|
|
9788
|
-
import { join, relative } from "path";
|
|
9789
|
-
|
|
9790
|
-
// src/commands/sync/local-copy.ts
|
|
9791
|
-
import { existsSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
9792
|
-
import path from "path";
|
|
9793
|
-
var MCP_MANIFEST_FILE = ".mcp-manifest.json";
|
|
9794
|
-
function isMcpScope(value) {
|
|
9795
|
-
return value === "personal" || value === "company" || value === "system";
|
|
9796
|
-
}
|
|
9797
|
-
function uniqueMcpEntries(entries) {
|
|
9798
|
-
const seen = /* @__PURE__ */ new Set();
|
|
9799
|
-
const out = [];
|
|
9800
|
-
for (const entry of entries) {
|
|
9801
|
-
if (seen.has(entry.name)) continue;
|
|
9802
|
-
seen.add(entry.name);
|
|
9803
|
-
out.push(entry);
|
|
9804
|
-
}
|
|
9805
|
-
return out;
|
|
9806
|
-
}
|
|
9807
|
-
function readMcpManifestEntries(manifestPath) {
|
|
9808
|
-
if (!existsSync(manifestPath)) return [];
|
|
9809
|
-
let parsed;
|
|
9810
|
-
try {
|
|
9811
|
-
parsed = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
9812
|
-
} catch {
|
|
9813
|
-
return [];
|
|
9814
|
-
}
|
|
9815
|
-
if (!Array.isArray(parsed)) return [];
|
|
9816
|
-
const entries = [];
|
|
9817
|
-
for (const item of parsed) {
|
|
9818
|
-
if (!item || typeof item !== "object") continue;
|
|
9819
|
-
const entry = item;
|
|
9820
|
-
if (typeof entry.name !== "string" || !isMcpScope(entry.scope)) continue;
|
|
9821
|
-
entries.push({ name: entry.name, scope: entry.scope });
|
|
9822
|
-
}
|
|
9823
|
-
return uniqueMcpEntries(entries);
|
|
9824
|
-
}
|
|
9825
|
-
function writeMcpManifestEntries(manifestPath, entries) {
|
|
9826
|
-
writeFileSync(
|
|
9827
|
-
manifestPath,
|
|
9828
|
-
JSON.stringify(uniqueMcpEntries(entries), null, 2) + "\n",
|
|
9829
|
-
"utf8"
|
|
9830
|
-
);
|
|
9831
|
-
}
|
|
9832
|
-
function updateSkillManifestForSource(sourceDir, slug) {
|
|
9833
|
-
assertValidSkillSlug(slug);
|
|
9834
|
-
const sourceAbs = path.resolve(sourceDir);
|
|
9835
|
-
if (!statSync(sourceAbs).isDirectory()) {
|
|
9836
|
-
throw new Error(`Skill source path is not a directory: ${sourceDir}`);
|
|
9837
|
-
}
|
|
9838
|
-
const manifestPath = path.join(path.dirname(sourceAbs), SKILL_MANIFEST_FILE);
|
|
9839
|
-
const manifest = readSkillManifestEntries(manifestPath);
|
|
9840
|
-
const nextEntry = { dirName: slug, scope: "personal" };
|
|
9841
|
-
const existingIndex = manifest.findIndex((entry) => entry.dirName === slug);
|
|
9842
|
-
if (existingIndex >= 0 && manifest[existingIndex].scope === nextEntry.scope) {
|
|
9843
|
-
return { manifestPath, changed: false };
|
|
9844
|
-
}
|
|
9845
|
-
const nextManifest = manifest.slice();
|
|
9846
|
-
if (existingIndex >= 0) {
|
|
9847
|
-
nextManifest[existingIndex] = nextEntry;
|
|
9848
|
-
} else {
|
|
9849
|
-
nextManifest.push(nextEntry);
|
|
9850
|
-
}
|
|
9851
|
-
writeSkillManifestEntries(manifestPath, nextManifest);
|
|
9852
|
-
return { manifestPath, changed: true };
|
|
9853
|
-
}
|
|
9854
|
-
function updateMcpManifestForProjectSource(workspaceDir, name) {
|
|
9855
|
-
assertValidMcpName(name);
|
|
9856
|
-
const workspaceAbs = path.resolve(workspaceDir);
|
|
9857
|
-
if (!statSync(workspaceAbs).isDirectory()) {
|
|
9858
|
-
throw new Error(`MCP workspace path is not a directory: ${workspaceDir}`);
|
|
9859
|
-
}
|
|
9860
|
-
const manifestPath = path.join(workspaceAbs, MCP_MANIFEST_FILE);
|
|
9861
|
-
const manifest = readMcpManifestEntries(manifestPath);
|
|
9862
|
-
const nextEntry = { name, scope: "personal" };
|
|
9863
|
-
const existingIndex = manifest.findIndex((entry) => entry.name === name);
|
|
9864
|
-
if (existingIndex >= 0 && manifest[existingIndex].scope === nextEntry.scope) {
|
|
9865
|
-
return { manifestPath, changed: false };
|
|
9866
|
-
}
|
|
9867
|
-
const nextManifest = manifest.slice();
|
|
9868
|
-
if (existingIndex >= 0) {
|
|
9869
|
-
nextManifest[existingIndex] = nextEntry;
|
|
9870
|
-
} else {
|
|
9871
|
-
nextManifest.push(nextEntry);
|
|
9872
|
-
}
|
|
9873
|
-
writeMcpManifestEntries(manifestPath, nextManifest);
|
|
9874
|
-
return { manifestPath, changed: true };
|
|
9875
|
-
}
|
|
9876
|
-
|
|
9877
|
-
// src/commands/sync/index.ts
|
|
9878
|
-
function redactEnv(env) {
|
|
9879
|
-
if (!env) return void 0;
|
|
9880
|
-
const out = {};
|
|
9881
|
-
for (const [k, v] of Object.entries(env)) {
|
|
9882
|
-
if (/TOKEN|SECRET|KEY|PASSWORD/i.test(k)) {
|
|
9883
|
-
out[k] = "***";
|
|
9884
|
-
} else {
|
|
9885
|
-
out[k] = v;
|
|
9886
|
-
}
|
|
9887
|
-
}
|
|
9888
|
-
return out;
|
|
9889
|
-
}
|
|
9890
|
-
var SOURCE_ORDER = {
|
|
9891
|
-
global: 0,
|
|
9892
|
-
workspace: 1,
|
|
9893
|
-
project: 0,
|
|
9894
|
-
local: 1,
|
|
9895
|
-
user: 2
|
|
9896
|
-
};
|
|
9897
|
-
function skillToItem(s) {
|
|
9898
|
-
return {
|
|
9899
|
-
kind: "skill",
|
|
9900
|
-
slug: s.slug,
|
|
9901
|
-
scope: "personal",
|
|
9902
|
-
source: s.source,
|
|
9903
|
-
workspacePath: s.workspacePath,
|
|
9904
|
-
event: "upsert",
|
|
9905
|
-
dirPath: s.dirPath,
|
|
9906
|
-
content: s.content,
|
|
9907
|
-
checksum: s.checksum,
|
|
9908
|
-
mtime: s.mtime
|
|
9909
|
-
};
|
|
9910
|
-
}
|
|
9911
|
-
function mcpToItem(m, includeSecrets) {
|
|
9912
|
-
return {
|
|
9913
|
-
kind: "mcp",
|
|
9914
|
-
slug: m.slug,
|
|
9915
|
-
scope: "personal",
|
|
9916
|
-
source: m.source,
|
|
9917
|
-
workspacePath: m.workspacePath,
|
|
9918
|
-
workspaceDir: m.workspaceDir,
|
|
9919
|
-
event: "upsert",
|
|
9920
|
-
transport: m.transport,
|
|
9921
|
-
url: m.url,
|
|
9922
|
-
command: m.command,
|
|
9923
|
-
args: m.args,
|
|
9924
|
-
env: includeSecrets ? m.env : redactEnv(m.env),
|
|
9925
|
-
headers: m.headers
|
|
9926
|
-
};
|
|
9927
|
-
}
|
|
9928
|
-
async function selectSkills() {
|
|
9929
|
-
const all = scanSkills();
|
|
9930
|
-
if (all.length === 0) {
|
|
9931
|
-
process.stderr.write("No Skills found (scanned current workspace .claude/skills)\n");
|
|
9932
|
-
return [];
|
|
9933
|
-
}
|
|
9934
|
-
all.sort((a, b) => {
|
|
9935
|
-
if (a.source !== b.source) return SOURCE_ORDER[a.source] - SOURCE_ORDER[b.source];
|
|
9936
|
-
return a.slug.localeCompare(b.slug);
|
|
9937
|
-
});
|
|
9938
|
-
const items = all.map((s) => ({
|
|
9939
|
-
value: s,
|
|
9940
|
-
label: s.slug,
|
|
9941
|
-
group: describeSource(s),
|
|
9942
|
-
hint: s.isSymlink ? "(symlink)" : void 0
|
|
9943
|
-
}));
|
|
9944
|
-
const picked = await promptMultiselect({
|
|
9945
|
-
title: "Select Skills to push to the main app",
|
|
9946
|
-
items
|
|
9947
|
-
});
|
|
9948
|
-
return picked.map(skillToItem);
|
|
9949
|
-
}
|
|
9950
|
-
async function selectMcps(includeSecrets) {
|
|
9951
|
-
const all = scanMcps();
|
|
9952
|
-
if (all.length === 0) {
|
|
9953
|
-
process.stderr.write(
|
|
9954
|
-
"No MCPs found (scanned current workspace .mcp.json / .claude/.claude.json and global ~/.claude.json)\n"
|
|
9955
|
-
);
|
|
9956
|
-
return [];
|
|
9957
|
-
}
|
|
9958
|
-
const { supported, unsupportedStdio } = splitPushableMcps(all);
|
|
9959
|
-
if (unsupportedStdio.length > 0) {
|
|
9960
|
-
const names = unsupportedStdio.map((m) => m.slug).sort().join(", ");
|
|
9961
|
-
process.stderr.write(`ae-cli sync push only supports http/sse MCPs; skipped stdio MCPs: ${names}
|
|
9962
|
-
`);
|
|
9963
|
-
}
|
|
9964
|
-
if (supported.length === 0) {
|
|
9965
|
-
process.stderr.write("No syncable MCPs found. ae-cli sync push only supports http/sse.\n");
|
|
9966
|
-
return [];
|
|
9967
|
-
}
|
|
9968
|
-
supported.sort((a, b) => {
|
|
9969
|
-
if (a.source !== b.source) return SOURCE_ORDER[a.source] - SOURCE_ORDER[b.source];
|
|
9970
|
-
return a.slug.localeCompare(b.slug);
|
|
9971
|
-
});
|
|
9972
|
-
const items = supported.map((m) => ({
|
|
9973
|
-
value: m,
|
|
9974
|
-
label: m.slug,
|
|
9975
|
-
group: describeSource(m),
|
|
9976
|
-
hint: m.hasSecrets && !includeSecrets ? "(env redacted)" : void 0
|
|
9977
|
-
}));
|
|
9978
|
-
const picked = await promptMultiselect({
|
|
9979
|
-
title: "Select MCPs to push to the main app",
|
|
9980
|
-
items
|
|
9981
|
-
});
|
|
9982
|
-
return picked.map((m) => mcpToItem(m, includeSecrets));
|
|
9983
|
-
}
|
|
9984
|
-
function renderResults(results) {
|
|
9985
|
-
const table = new Table({
|
|
9986
|
-
head: ["kind", "slug", "status", "message"],
|
|
9987
|
-
wordWrap: true
|
|
9988
|
-
});
|
|
9989
|
-
for (const r of results) {
|
|
9990
|
-
table.push([r.kind, r.slug, r.status, r.message ?? ""]);
|
|
9991
|
-
}
|
|
9992
|
-
process.stdout.write(table.toString() + "\n");
|
|
9993
|
-
const failed = results.filter((r) => r.status === "failed").length;
|
|
9994
|
-
if (failed > 0) {
|
|
9995
|
-
process.stderr.write(`
|
|
9996
|
-
\u2717 ${failed} item(s) failed
|
|
9997
|
-
`);
|
|
9998
|
-
}
|
|
9999
|
-
}
|
|
10000
|
-
async function selectPullResources(args) {
|
|
10001
|
-
const all = args.candidates.filter((candidate) => candidate.selected).sort((a, b) => {
|
|
10002
|
-
const scopeOrder = {
|
|
10003
|
-
system: 0,
|
|
10004
|
-
company: 1,
|
|
10005
|
-
personal: 2
|
|
10006
|
-
};
|
|
10007
|
-
const scopeDiff = scopeOrder[a.scope] - scopeOrder[b.scope];
|
|
10008
|
-
return scopeDiff !== 0 ? scopeDiff : a.name.localeCompare(b.name);
|
|
10009
|
-
});
|
|
10010
|
-
if (all.length === 0) {
|
|
10011
|
-
process.stderr.write(`${args.title}: no candidates available to sync
|
|
10012
|
-
`);
|
|
10013
|
-
return [];
|
|
10014
|
-
}
|
|
10015
|
-
const items = all.map((candidate) => ({
|
|
10016
|
-
value: candidate,
|
|
10017
|
-
label: `${candidate.name} ${candidate.scope}`,
|
|
10018
|
-
preselected: true
|
|
10019
|
-
}));
|
|
10020
|
-
return promptMultiselect({ title: args.title, items });
|
|
10021
|
-
}
|
|
10022
|
-
function toHttpItems(items) {
|
|
10023
|
-
return items.map((item) => {
|
|
10024
|
-
if (item.kind === "skill") {
|
|
10025
|
-
const { kind: _kind2, dirPath: _dirPath, ...rest2 } = item;
|
|
10026
|
-
return rest2;
|
|
10027
|
-
}
|
|
10028
|
-
const { kind: _kind, workspaceDir: _workspaceDir, ...rest } = item;
|
|
10029
|
-
return rest;
|
|
10030
|
-
});
|
|
10031
|
-
}
|
|
10032
|
-
async function pushItems(kind, items) {
|
|
10033
|
-
if (items.length === 0) return { results: [] };
|
|
10034
|
-
try {
|
|
10035
|
-
const resp = await postToMainApp("/api/sandbox/sync/push", {
|
|
10036
|
-
kind,
|
|
10037
|
-
items: toHttpItems(items)
|
|
10038
|
-
});
|
|
10039
|
-
return { results: resp.results ?? [] };
|
|
10040
|
-
} catch (err) {
|
|
10041
|
-
if (err instanceof TeAgentApiError) {
|
|
10042
|
-
return {
|
|
10043
|
-
results: items.map((it) => ({
|
|
10044
|
-
kind: it.kind,
|
|
10045
|
-
slug: it.slug,
|
|
10046
|
-
status: "failed",
|
|
10047
|
-
message: `${err.code ?? err.status} ${err.message}`
|
|
10048
|
-
}))
|
|
10049
|
-
};
|
|
10050
|
-
}
|
|
10051
|
-
throw err;
|
|
10052
|
-
}
|
|
10053
|
-
}
|
|
10054
|
-
function readSkillVersion(content) {
|
|
10055
|
-
const frontmatter = /^---\r?\n([\s\S]*?)\r?\n---/.exec(content)?.[1];
|
|
10056
|
-
if (!frontmatter) return void 0;
|
|
10057
|
-
const matches = [...frontmatter.matchAll(/^version\s*:\s*(.+?)\s*(?:#.*)?$/gm)];
|
|
10058
|
-
if (matches.length !== 1) return void 0;
|
|
10059
|
-
const value = matches[0][1].trim().replace(/^(['"])(.*)\1$/, "$2");
|
|
10060
|
-
return /^(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(value) ? value : void 0;
|
|
10061
|
-
}
|
|
10062
|
-
async function buildSkillZip(dirPath) {
|
|
10063
|
-
const zip = new import_jszip.default();
|
|
10064
|
-
const visit = (dir) => {
|
|
10065
|
-
for (const name of readdirSync(dir)) {
|
|
10066
|
-
if (name === ".DS_Store") continue;
|
|
10067
|
-
const absolute = join(dir, name);
|
|
10068
|
-
const stat = lstatSync(absolute);
|
|
10069
|
-
if (stat.isSymbolicLink()) {
|
|
10070
|
-
throw new Error(`Skill package contains a symlink: ${relative(dirPath, absolute)}`);
|
|
10071
|
-
}
|
|
10072
|
-
if (stat.isDirectory()) visit(absolute);
|
|
10073
|
-
else if (stat.isFile()) {
|
|
10074
|
-
const content = readFileSync2(absolute);
|
|
10075
|
-
if (relative(dirPath, absolute).replaceAll("\\", "/") === "SKILL.md") {
|
|
10076
|
-
assertSkillDocumentSize(content);
|
|
10077
|
-
}
|
|
10078
|
-
zip.file(relative(dirPath, absolute).replaceAll("\\", "/"), content);
|
|
10079
|
-
}
|
|
10080
|
-
}
|
|
10081
|
-
};
|
|
10082
|
-
visit(dirPath);
|
|
10083
|
-
return zip.generateAsync({ type: "nodebuffer", compression: "DEFLATE" });
|
|
10084
|
-
}
|
|
10085
|
-
var defaultPushSkillDependencies = {
|
|
10086
|
-
upload: (path2, formData) => uploadToMainApp(path2, formData),
|
|
10087
|
-
updateManifest: updateSkillManifestForSource
|
|
10088
|
-
};
|
|
10089
|
-
async function pushSkillItems(items, dependencies = defaultPushSkillDependencies) {
|
|
10090
|
-
const results = [];
|
|
10091
|
-
for (const item of items) {
|
|
10092
|
-
try {
|
|
10093
|
-
const buffer = await buildSkillZip(item.dirPath);
|
|
10094
|
-
const formData = new FormData();
|
|
10095
|
-
formData.append("file", new Blob([new Uint8Array(buffer)], { type: "application/zip" }), `${item.slug}.zip`);
|
|
10096
|
-
formData.append("slug", item.slug);
|
|
10097
|
-
formData.append("source", item.source);
|
|
10098
|
-
if (item.workspacePath) formData.append("workspacePath", item.workspacePath);
|
|
10099
|
-
const version = readSkillVersion(item.content);
|
|
10100
|
-
if (version) formData.append("version", version);
|
|
10101
|
-
const response = await dependencies.upload("/api/sandbox/sync/push/skill", formData);
|
|
10102
|
-
dependencies.updateManifest(item.dirPath, item.slug);
|
|
10103
|
-
results.push({
|
|
10104
|
-
kind: "skill",
|
|
10105
|
-
slug: item.slug,
|
|
10106
|
-
status: "synced",
|
|
10107
|
-
...!response.workspaceEnabled && item.source === "workspace" ? {
|
|
10108
|
-
message: "Skill synced, but it was not enabled in the current workspace"
|
|
10109
|
-
} : {}
|
|
10110
|
-
});
|
|
10111
|
-
} catch (err) {
|
|
10112
|
-
const message = err instanceof TeAgentApiError ? `${err.code ?? err.status} ${err.message}` : err?.message ?? String(err);
|
|
10113
|
-
results.push({
|
|
10114
|
-
kind: "skill",
|
|
10115
|
-
slug: item.slug,
|
|
10116
|
-
status: "failed",
|
|
10117
|
-
message
|
|
10118
|
-
});
|
|
10119
|
-
}
|
|
10120
|
-
}
|
|
10121
|
-
return { results };
|
|
10122
|
-
}
|
|
10123
|
-
function updateSyncedProjectMcpManifest(mcpItems, resp) {
|
|
10124
|
-
if (mcpItems.length === 0) return;
|
|
10125
|
-
const bySlug = new Map(mcpItems.map((item) => [item.slug, item]));
|
|
10126
|
-
for (const result of resp.results) {
|
|
10127
|
-
if (result.kind !== "mcp" || result.status !== "synced") continue;
|
|
10128
|
-
const item = bySlug.get(result.slug);
|
|
10129
|
-
if (!item || item.source !== "project") continue;
|
|
10130
|
-
if (!item.workspaceDir) {
|
|
10131
|
-
result.status = "failed";
|
|
10132
|
-
result.message = "Main app synced the MCP, but local MCP manifest update failed: missing workspaceDir";
|
|
10133
|
-
continue;
|
|
10134
|
-
}
|
|
10135
|
-
try {
|
|
10136
|
-
updateMcpManifestForProjectSource(item.workspaceDir, item.slug);
|
|
10137
|
-
} catch (err) {
|
|
10138
|
-
result.status = "failed";
|
|
10139
|
-
result.message = `Main app synced the MCP, but local MCP manifest update failed: ${err?.message ?? String(err)}`;
|
|
10140
|
-
}
|
|
10141
|
-
}
|
|
10142
|
-
}
|
|
10143
|
-
async function selectDirection(optsDirection) {
|
|
10144
|
-
if (optsDirection === "push" || optsDirection === "pull") return optsDirection;
|
|
10145
|
-
if (optsDirection) {
|
|
10146
|
-
throw new Error("--direction must be push or pull");
|
|
10147
|
-
}
|
|
10148
|
-
return promptSingleSelect({
|
|
10149
|
-
title: "Sync direction?",
|
|
10150
|
-
items: [
|
|
10151
|
-
{ value: "push", label: "Workspace -> Main app" },
|
|
10152
|
-
{ value: "pull", label: "Main app -> Workspace" }
|
|
10153
|
-
]
|
|
10154
|
-
});
|
|
10155
|
-
}
|
|
10156
|
-
async function selectKind(optsKind) {
|
|
10157
|
-
if (optsKind === "skill" || optsKind === "mcp" || optsKind === "both") return optsKind;
|
|
10158
|
-
if (optsKind) {
|
|
10159
|
-
throw new Error("--kind must be skill, mcp, or both");
|
|
10160
|
-
}
|
|
10161
|
-
return promptSingleSelect({
|
|
10162
|
-
title: "Which resource type to sync?",
|
|
10163
|
-
items: [
|
|
10164
|
-
{ value: "skill", label: "Skills" },
|
|
10165
|
-
{ value: "mcp", label: "MCPs" },
|
|
10166
|
-
{ value: "both", label: "Skills + MCPs" }
|
|
10167
|
-
]
|
|
10168
|
-
});
|
|
10169
|
-
}
|
|
10170
|
-
async function runPush(kind, includeSecrets) {
|
|
10171
|
-
const skillItems = kind !== "mcp" ? await selectSkills() : [];
|
|
10172
|
-
const mcpItems = kind !== "skill" ? await selectMcps(includeSecrets) : [];
|
|
10173
|
-
if (skillItems.length === 0 && mcpItems.length === 0) {
|
|
10174
|
-
process.stderr.write("Nothing selected, exiting\n");
|
|
10175
|
-
return;
|
|
10176
|
-
}
|
|
10177
|
-
process.stderr.write(`Pushing ${skillItems.length} Skill(s) / ${mcpItems.length} MCP(s) ...
|
|
10178
|
-
`);
|
|
10179
|
-
const allResults = [];
|
|
10180
|
-
if (skillItems.length > 0) {
|
|
10181
|
-
const skillResp = await pushSkillItems(skillItems);
|
|
10182
|
-
allResults.push(...skillResp.results);
|
|
10183
|
-
}
|
|
10184
|
-
if (mcpItems.length > 0) {
|
|
10185
|
-
const mcpResp = await pushItems("mcp", mcpItems);
|
|
10186
|
-
updateSyncedProjectMcpManifest(mcpItems, mcpResp);
|
|
10187
|
-
allResults.push(...mcpResp.results);
|
|
10188
|
-
}
|
|
10189
|
-
renderResults(allResults);
|
|
10190
|
-
}
|
|
10191
|
-
function pullResultRows(resp) {
|
|
10192
|
-
return (resp.results ?? []).map((result) => ({
|
|
10193
|
-
kind: result.kind,
|
|
10194
|
-
slug: result.name,
|
|
10195
|
-
status: result.status,
|
|
10196
|
-
message: result.message
|
|
10197
|
-
}));
|
|
10198
|
-
}
|
|
10199
|
-
async function runPull(kind) {
|
|
10200
|
-
const workspace = getCurrentWorkspace();
|
|
10201
|
-
if (!workspace) {
|
|
10202
|
-
throw new Error("Current workspace not recognized; please run from within /home/ta/workspaces/<workspace>");
|
|
10203
|
-
}
|
|
10204
|
-
const candidates = await getSandboxSyncPullCandidates({
|
|
10205
|
-
workspacePath: workspace.name,
|
|
10206
|
-
kind
|
|
10207
|
-
});
|
|
10208
|
-
const skillItems = kind !== "mcp" ? await selectPullResources({
|
|
10209
|
-
title: "Select Skills to sync to workspace",
|
|
10210
|
-
candidates: (candidates.skills ?? []).filter((candidate) => candidate.scope !== "system")
|
|
10211
|
-
}) : [];
|
|
10212
|
-
const mcpItems = kind !== "skill" ? await selectPullResources({
|
|
10213
|
-
title: "Select MCPs to sync to workspace",
|
|
10214
|
-
candidates: candidates.mcp ?? []
|
|
10215
|
-
}) : [];
|
|
10216
|
-
if (skillItems.length === 0 && mcpItems.length === 0) {
|
|
10217
|
-
process.stderr.write("Nothing selected, exiting\n");
|
|
10218
|
-
return;
|
|
10219
|
-
}
|
|
10220
|
-
process.stderr.write(`Syncing to workspace: ${skillItems.length} Skill(s) / ${mcpItems.length} MCP(s) ...
|
|
10221
|
-
`);
|
|
10222
|
-
const resp = await postSandboxSyncPull({
|
|
10223
|
-
workspacePath: workspace.name,
|
|
10224
|
-
kind,
|
|
10225
|
-
skills: skillItems.map((item) => item.id),
|
|
10226
|
-
mcp: mcpItems.map((item) => item.id)
|
|
10227
|
-
});
|
|
10228
|
-
renderResults(pullResultRows(resp));
|
|
10229
|
-
}
|
|
10230
|
-
function registerSync(program) {
|
|
10231
|
-
program.command("sync").description("Sync Skills / MCPs between current workspace and te-claude main app").option("--direction <direction>", "push | pull (skip interactive direction picker)").option("--include-secrets", "Include MCP env secrets (TOKEN/SECRET/KEY) in push", false).option("--kind <kind>", "skill | mcp | both (skip interactive picker)").action(async (opts) => {
|
|
10232
|
-
try {
|
|
10233
|
-
const direction = await selectDirection(opts.direction);
|
|
10234
|
-
const kind = await selectKind(opts.kind);
|
|
10235
|
-
if (direction === "push") await runPush(kind, !!opts.includeSecrets);
|
|
10236
|
-
else await runPull(kind);
|
|
10237
|
-
} catch (err) {
|
|
10238
|
-
if (err instanceof MultiselectCancelled) {
|
|
10239
|
-
process.stderr.write("Cancelled\n");
|
|
10240
|
-
return;
|
|
10241
|
-
}
|
|
10242
|
-
if (err instanceof TeAgentCredentialsError) {
|
|
10243
|
-
printError("config", err.message, err.hint);
|
|
10244
|
-
process.exit(1);
|
|
10245
|
-
}
|
|
10246
|
-
if (err instanceof TeAgentApiError) {
|
|
10247
|
-
printError("api", err.message, err.code);
|
|
10248
|
-
process.exit(1);
|
|
10249
|
-
}
|
|
10250
|
-
const e = err;
|
|
10251
|
-
printError("api", e?.message ?? String(err));
|
|
10252
|
-
process.exit(1);
|
|
10253
|
-
}
|
|
10254
|
-
});
|
|
10255
|
-
}
|
|
10256
9748
|
export {
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
registerSync
|
|
9749
|
+
require_inherits,
|
|
9750
|
+
require_node,
|
|
9751
|
+
require_lib3 as require_lib
|
|
10261
9752
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
resolveGatewayDomain
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TKHSULJT.js";
|
|
4
5
|
import {
|
|
5
6
|
withOutputMetadata
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KEWVSO64.js";
|
|
7
8
|
import {
|
|
8
9
|
dryRunCapability,
|
|
9
10
|
executeCapabilityWithEnvelope,
|
|
10
11
|
validateCapability
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GJXRF7Y6.js";
|
|
12
13
|
|
|
13
14
|
// src/core/capability-command.ts
|
|
14
15
|
import { randomBytes } from "crypto";
|
|
@@ -28,13 +29,13 @@ function createCapabilityCommand(config) {
|
|
|
28
29
|
validateInput: async (ctx) => {
|
|
29
30
|
const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
|
|
30
31
|
const requestHost = config.requestHost ?? ctx.host();
|
|
31
|
-
const input = config.buildInput(ctx);
|
|
32
|
+
const input = withLifecycleRequestId(config, config.buildInput(ctx));
|
|
32
33
|
return validateCapability(requestHost, gatewayDomain, config.capabilityId, input);
|
|
33
34
|
},
|
|
34
35
|
dryRun: async (ctx) => {
|
|
35
36
|
const gatewayDomain = resolveGatewayDomain(config.cliService, config.gatewayDomain);
|
|
36
37
|
const requestHost = config.requestHost ?? ctx.host();
|
|
37
|
-
const input = config.buildInput(ctx);
|
|
38
|
+
const input = withLifecycleRequestId(config, config.buildInput(ctx));
|
|
38
39
|
return dryRunCapability(requestHost, gatewayDomain, config.capabilityId, input);
|
|
39
40
|
},
|
|
40
41
|
execute: async (ctx) => {
|