@thinkingai/ae-cli 6.0.38 → 6.0.39
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 +25 -3
- package/README.zh.md +25 -3
- package/dist/{auth-56Z45UVR.js → auth-GDV3H5I4.js} +18 -8
- package/dist/{auth-ENM3FE6L.js → auth-NN55553T.js} +3 -3
- package/dist/{capability-2H6PAOA3.js → capability-TPORIKRQ.js} +19 -15
- package/dist/{capability-YPOQX6PL.js → capability-VQNC5CF7.js} +19 -15
- package/dist/chunk-4NN5IWVN.js +26 -0
- package/dist/{chunk-DB4Q3ANU.js → chunk-6A2FUCIS.js} +3 -3
- package/dist/{chunk-PVBYJWC2.js → chunk-7KQWSBSL.js} +4 -4
- package/dist/{chunk-24BAVOX3.js → chunk-AXDXJTPC.js} +3 -1
- package/dist/{chunk-CPVTECJ3.js → chunk-DT6Y3TD7.js} +5 -5
- package/dist/{chunk-EGEIXA2Z.js → chunk-DWO43OIB.js} +0 -248
- package/dist/{chunk-V6FR6WTW.js → chunk-GJJA4CQZ.js} +34 -2
- package/dist/{chunk-RGXCNC4N.js → chunk-GS2P7LFD.js} +50 -17
- package/dist/{chunk-LYVNONC4.js → chunk-JHENBQ5B.js} +35 -0
- package/dist/{chunk-3P3562ZX.js → chunk-MVDZ7DBQ.js} +5 -5
- package/dist/{chunk-LCXU3AAT.js → chunk-NBPKWKRA.js} +2 -2
- package/dist/{chunk-HQ2A7ITL.js → chunk-RBNKI5ZW.js} +50 -17
- package/dist/{chunk-LHVM35J4.js → chunk-TS6BUGUY.js} +4 -4
- package/dist/chunk-TUKQZTMI.js +250 -0
- package/dist/{chunk-J7MZHDHQ.js → chunk-VKD5WQKN.js} +5 -5
- package/dist/{chunk-3KI3RRXX.js → chunk-VTXHDCBW.js} +3 -3
- package/dist/{chunk-KTYR3U6D.js → chunk-YTG6Q75E.js} +10 -6
- package/dist/{chunk-IR4ZLVPW.js → chunk-YV52FB5G.js} +25 -3
- package/dist/{chunk-E7UXXHO3.js → chunk-Z3OXWCIA.js} +3 -3
- package/dist/{cli-token-4SBMXAUK.js → cli-token-GL5MS5FK.js} +4 -4
- package/dist/{client-PP5FETMW.js → client-DAIPF7XN.js} +4 -4
- package/dist/{community-report-client-KK2QBANO.js → community-report-client-M2RW4MXD.js} +2 -2
- package/dist/config-4VZNLBKF.js +489 -0
- package/dist/index.js +96 -37
- package/dist/memory-RWJW4XFO.js +892 -0
- package/dist/memory-VO2ZJCRT.js +892 -0
- package/dist/{metadata-JIQ77HFY.js → metadata-YGTHR2XJ.js} +8 -8
- package/dist/{metadata-AN3YFZEV.js → metadata-ZRN2GHPN.js} +8 -8
- package/dist/{model-JASQVOFD.js → model-CLUIK3K5.js} +7 -5
- package/dist/{raw-XJCAT3HX.js → raw-52B4UKO4.js} +8 -7
- package/dist/sync-3REDHGY6.js +10259 -0
- package/dist/{te-agent-JHUG6DVV.js → te-agent-XNPELAKX.js} +580 -84
- package/dist/{te-analysis-ITKTO6JS.js → te-analysis-GJI5FZUL.js} +1152 -13
- package/dist/{te-analysis-RAC67YYD.js → te-analysis-N2BRDJZ5.js} +1152 -13
- package/dist/{te-community-QOYIYEJI.js → te-community-SQXKE5OO.js} +7 -7
- package/dist/{te-community-UFKI6ONP.js → te-community-TYSNU3NQ.js} +7 -7
- package/dist/{te-dataops-PZQ5NQLY.js → te-dataops-5TM7WZDI.js} +370 -189
- package/dist/{te-dataops-XTWVTJCA.js → te-dataops-OWIADNSM.js} +370 -189
- package/dist/{te-engage-NLZUPSBK.js → te-engage-F7V55KVW.js} +333 -105
- package/dist/{te-engage-E7F4HTXU.js → te-engage-FMYAYCNV.js} +333 -105
- package/dist/{te-kb-E7NSCBRB.js → te-kb-VRMEY3D4.js} +6 -6
- package/dist/{te-meta-GBDTMPEL.js → te-meta-53BVXPFI.js} +7 -7
- package/dist/{te-meta-ZTLTSHXC.js → te-meta-TOCBPBXI.js} +7 -7
- package/dist/{te-system-AH7DMCAQ.js → te-system-XGS5EQIQ.js} +4 -4
- package/dist/{te-team-BQ3SKSZV.js → te-team-BZRDV2CM.js} +7 -7
- package/dist/{update-DKG6UXEM.js → update-HEDXGOJH.js} +8 -6
- package/package.json +4 -1
- package/skills/ae-agent/SKILL.md +178 -16
- package/skills/ae-agent/references/add-skill.md +22 -10
- package/skills/ae-agent/references/edit-skill.md +24 -14
- package/skills/ae-agent/references/find-archived-conversations.md +82 -0
- package/skills/ae-agent/references/restore-conversation.md +54 -0
- package/skills/ae-agent/references/upload-skill.md +24 -14
- package/skills/ae-analysis/SKILL.md +1 -1
- package/skills/ae-analysis/references/command_index.md +104 -42
- package/skills/ae-analysis/references/entity_id_import_options.md +1 -1
- package/skills/ae-analysis/references/project_access_detail_get.md +3 -3
- package/skills/ae-analysis/references/project_data_power_delete.md +3 -3
- package/skills/ae-analysis/references/project_data_power_get.md +3 -3
- package/skills/ae-analysis/references/project_data_power_list.md +3 -3
- package/skills/ae-analysis/references/project_data_power_upsert.md +3 -3
- package/skills/ae-analysis/references/project_entity_create.md +3 -3
- package/skills/ae-analysis/references/project_entity_delete.md +3 -3
- package/skills/ae-analysis/references/project_entity_event_list.md +3 -3
- package/skills/ae-analysis/references/project_entity_get.md +3 -3
- package/skills/ae-analysis/references/project_entity_list.md +3 -3
- package/skills/ae-analysis/references/project_entity_update.md +3 -3
- package/skills/ae-analysis/references/project_function_list.md +3 -3
- package/skills/ae-analysis/references/project_info_create.md +25 -0
- package/skills/ae-analysis/references/project_info_delete.md +24 -0
- package/skills/ae-analysis/references/project_info_get.md +3 -3
- package/skills/ae-analysis/references/project_info_list.md +3 -3
- package/skills/ae-analysis/references/project_info_update.md +3 -3
- package/skills/ae-analysis/references/project_mark_time_create.md +3 -3
- package/skills/ae-analysis/references/project_mark_time_delete.md +3 -3
- package/skills/ae-analysis/references/project_mark_time_list.md +3 -3
- package/skills/ae-analysis/references/project_mark_time_update.md +3 -3
- package/skills/ae-analysis/references/project_member_add.md +3 -3
- package/skills/ae-analysis/references/project_member_batch_update.md +3 -3
- package/skills/ae-analysis/references/project_member_candidate_list.md +3 -3
- package/skills/ae-analysis/references/project_member_handover_export.md +3 -3
- package/skills/ae-analysis/references/project_member_handover_run.md +3 -3
- package/skills/ae-analysis/references/project_member_import.md +3 -3
- package/skills/ae-analysis/references/project_member_list.md +3 -3
- package/skills/ae-analysis/references/project_member_receiver_list.md +3 -3
- package/skills/ae-analysis/references/project_member_remove.md +3 -3
- package/skills/ae-analysis/references/project_member_update.md +3 -3
- package/skills/ae-analysis/references/project_owner_update.md +3 -3
- package/skills/ae-analysis/references/project_permission_binding_list.md +3 -3
- package/skills/ae-analysis/references/project_receive_status_update.md +3 -3
- package/skills/ae-analysis/references/project_role_delete.md +3 -3
- package/skills/ae-analysis/references/project_role_function_list.md +3 -3
- package/skills/ae-analysis/references/project_role_get.md +3 -3
- package/skills/ae-analysis/references/project_role_list.md +3 -3
- package/skills/ae-analysis/references/project_role_upsert.md +3 -3
- package/skills/ae-analysis/references/project_role_user_list.md +3 -3
- package/skills/ae-analysis/references/project_space_list.md +1 -1
- package/skills/ae-analysis/references/project_timezone_get.md +3 -3
- package/skills/ae-analysis/references/project_timezone_overview.md +3 -3
- package/skills/ae-analysis/references/project_timezone_update.md +3 -3
- package/skills/ae-analysis/references/project_user_id_items_update.md +3 -3
- package/skills/ae-analysis/references/system_admin_function_list.md +22 -0
- package/skills/ae-analysis/references/system_admin_function_update.md +26 -0
- package/skills/ae-analysis/references/system_admin_list.md +21 -0
- package/skills/ae-analysis/references/system_admin_remove.md +25 -0
- package/skills/ae-analysis/references/system_admin_upsert.md +25 -0
- package/skills/ae-analysis/references/system_function_list.md +21 -0
- package/skills/ae-analysis/references/system_member_add.md +25 -0
- package/skills/ae-analysis/references/system_member_candidate_list.md +22 -0
- package/skills/ae-analysis/references/system_member_delete.md +25 -0
- package/skills/ae-analysis/references/system_member_list.md +24 -0
- package/skills/ae-analysis/references/system_member_mfa_unbind.md +25 -0
- package/skills/ae-analysis/references/system_member_password_reset.md +32 -0
- package/skills/ae-analysis/references/system_member_project_batch_update.md +27 -0
- package/skills/ae-analysis/references/system_member_status_update.md +26 -0
- package/skills/ae-analysis/references/system_member_update.md +23 -0
- package/skills/ae-analysis/references/system_mfa_get.md +21 -0
- package/skills/ae-analysis/references/system_mfa_update.md +25 -0
- package/skills/ae-analysis/references/system_node_monitor_list.md +24 -0
- package/skills/ae-analysis/references/system_oauth2_update.md +22 -0
- package/skills/ae-analysis/references/system_ops_alert_contact_delete.md +25 -0
- package/skills/ae-analysis/references/system_ops_alert_contact_list.md +23 -0
- package/skills/ae-analysis/references/system_ops_alert_contact_test.md +29 -0
- package/skills/ae-analysis/references/system_ops_alert_contact_upsert.md +39 -0
- package/skills/ae-analysis/references/system_preference_get.md +21 -0
- package/skills/ae-analysis/references/system_preference_update.md +22 -0
- package/skills/ae-analysis/references/system_project_usage_list.md +28 -0
- package/skills/ae-analysis/references/system_query_alert_rule_list.md +21 -0
- package/skills/ae-analysis/references/system_query_alert_rule_update.md +26 -0
- package/skills/ae-analysis/references/system_query_monitor_overview.md +26 -0
- package/skills/ae-analysis/references/system_query_task_cancel.md +25 -0
- package/skills/ae-analysis/references/system_query_task_export.md +49 -0
- package/skills/ae-analysis/references/system_query_task_get.md +23 -0
- package/skills/ae-analysis/references/system_query_task_list.md +35 -0
- package/skills/ae-analysis/references/system_query_task_options.md +27 -0
- package/skills/ae-analysis/references/system_receiver_address_delete.md +26 -0
- package/skills/ae-analysis/references/system_receiver_address_overview.md +21 -0
- package/skills/ae-analysis/references/system_receiver_address_project_list.md +21 -0
- package/skills/ae-analysis/references/system_receiver_address_promote.md +24 -0
- package/skills/ae-analysis/references/system_receiver_address_upsert.md +27 -0
- package/skills/ae-analysis/references/system_receiver_detection_get.md +22 -0
- package/skills/ae-analysis/references/system_receiver_detection_run.md +22 -0
- package/skills/ae-analysis/references/system_receiver_detection_update.md +25 -0
- package/skills/ae-analysis/references/system_role_delete.md +26 -0
- package/skills/ae-analysis/references/system_role_function_list.md +22 -0
- package/skills/ae-analysis/references/system_role_get.md +22 -0
- package/skills/ae-analysis/references/system_role_list.md +24 -0
- package/skills/ae-analysis/references/system_role_upsert.md +27 -0
- package/skills/ae-analysis/references/system_role_user_list.md +22 -0
- package/skills/ae-analysis/references/system_seat_list.md +25 -0
- package/skills/ae-analysis/references/system_seat_update.md +26 -0
- package/skills/ae-analysis/references/system_smtp_delete.md +24 -0
- package/skills/ae-analysis/references/system_smtp_get.md +21 -0
- package/skills/ae-analysis/references/system_smtp_test.md +22 -0
- package/skills/ae-analysis/references/system_smtp_upsert.md +31 -0
- package/skills/ae-analysis/references/system_third_party_login_disable.md +25 -0
- package/skills/ae-analysis/references/system_third_party_login_list.md +21 -0
- package/skills/ae-analysis/references/system_third_party_login_upsert.md +33 -0
- package/skills/ae-analysis/references/system_usage_overview.md +21 -0
- package/skills/ae-analysis/references/system_usage_trend_export.md +44 -0
- package/skills/ae-analysis/references/system_usage_trend_query.md +28 -0
- package/skills/ae-dataops/SKILL.md +1 -1
- package/skills/ae-dataops/references/dataops-flow-create.md +51 -16
- package/skills/ae-engage/SKILL.md +56 -26
- package/skills/ae-engage/references/activity-activity.md +3 -0
- package/skills/ae-engage/references/activity-approval.md +12 -4
- package/skills/ae-engage/references/activity-task.md +21 -6
- package/skills/ae-engage/references/activity-topic.md +31 -13
- package/skills/ae-engage/references/add-channel.md +170 -41
- package/skills/ae-engage/references/build-task-save-guide.md +40 -27
- package/skills/ae-engage/references/channel-update-config.md +3 -2
- package/skills/ae-engage/references/common-metric.md +48 -120
- package/skills/ae-engage/references/flow-detail.md +13 -0
- package/skills/ae-engage/references/preset-event.md +12 -32
- package/skills/ae-engage/references/save-flow.md +127 -64
- package/skills/ae-engage/references/save-task.md +197 -59
- package/skills/ae-engage/references/scene-config-metric.md +3 -0
- package/skills/ae-engage/references/scene-preset-metric.md +8 -37
- package/skills/ae-engage/references/scene-strategy-audience.md +51 -643
- package/skills/ae-engage/references/scene-strategy.md +6 -6
- package/skills/ae-engage/references/task-detail.md +10 -0
- package/skills/ae-engage/references/task-submit-approval.md +45 -0
- package/skills/ae-engage/references/validate-flow-node-config.md +1 -1
- package/skills/ae-generate-tracking-code/SKILL.md +2 -2
- package/skills/ae-metadata/SKILL.md +1 -1
- package/dist/config-BSSALXEN.js +0 -128
- package/dist/sync-QFP4XFN3.js +0 -485
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertValidSkillVersion
|
|
3
|
+
} from "./chunk-4NN5IWVN.js";
|
|
1
4
|
import {
|
|
2
5
|
deleteFromMainApp,
|
|
3
6
|
getBufferFromMainApp,
|
|
@@ -6,9 +9,9 @@ import {
|
|
|
6
9
|
postToMainApp,
|
|
7
10
|
putToMainApp,
|
|
8
11
|
uploadToMainApp
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-VKD5WQKN.js";
|
|
13
|
+
import "./chunk-GJJA4CQZ.js";
|
|
14
|
+
import "./chunk-JHENBQ5B.js";
|
|
12
15
|
|
|
13
16
|
// src/commands/te-agent/agents.ts
|
|
14
17
|
var BASE_PATH = "/api/sandbox/agent/agents";
|
|
@@ -1121,7 +1124,12 @@ var listSkills = {
|
|
|
1121
1124
|
command: "+list-skills",
|
|
1122
1125
|
description: "List Skills visible to current user",
|
|
1123
1126
|
flags: [
|
|
1124
|
-
{
|
|
1127
|
+
{
|
|
1128
|
+
name: "scope",
|
|
1129
|
+
type: "string",
|
|
1130
|
+
required: false,
|
|
1131
|
+
desc: "Filter by scope: personal | company | system"
|
|
1132
|
+
}
|
|
1125
1133
|
],
|
|
1126
1134
|
risk: "read",
|
|
1127
1135
|
validate: (ctx) => {
|
|
@@ -1146,14 +1154,61 @@ var addSkill = {
|
|
|
1146
1154
|
command: "+add-skill",
|
|
1147
1155
|
description: "Create a custom Skill (personal or company scope)",
|
|
1148
1156
|
flags: [
|
|
1149
|
-
{
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
{
|
|
1156
|
-
|
|
1157
|
+
{
|
|
1158
|
+
name: "name",
|
|
1159
|
+
type: "string",
|
|
1160
|
+
required: true,
|
|
1161
|
+
desc: "Skill name (1-80 chars)"
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
name: "description",
|
|
1165
|
+
type: "string",
|
|
1166
|
+
required: true,
|
|
1167
|
+
desc: "Skill description"
|
|
1168
|
+
},
|
|
1169
|
+
{
|
|
1170
|
+
name: "instructions",
|
|
1171
|
+
type: "string",
|
|
1172
|
+
required: true,
|
|
1173
|
+
desc: "Skill instructions (use @- to read from stdin)"
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
name: "display-name",
|
|
1177
|
+
type: "string",
|
|
1178
|
+
required: false,
|
|
1179
|
+
desc: "Display name (max 100)"
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
name: "category",
|
|
1183
|
+
type: "string",
|
|
1184
|
+
required: false,
|
|
1185
|
+
desc: `Market category key: ${MARKET_CATEGORIES.join(" | ")}`
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
name: "icon-emoji",
|
|
1189
|
+
type: "string",
|
|
1190
|
+
required: false,
|
|
1191
|
+
desc: "Market icon emoji (e.g. robot)"
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
name: "icon-color",
|
|
1195
|
+
type: "string",
|
|
1196
|
+
required: false,
|
|
1197
|
+
desc: "Market icon color (e.g. #1E76F0)"
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
name: "scope",
|
|
1201
|
+
type: "string",
|
|
1202
|
+
required: false,
|
|
1203
|
+
default: "personal",
|
|
1204
|
+
desc: "Target scope: personal | company"
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
name: "version",
|
|
1208
|
+
type: "string",
|
|
1209
|
+
required: false,
|
|
1210
|
+
desc: "Initial content version (major.minor; default 1.0)"
|
|
1211
|
+
}
|
|
1157
1212
|
],
|
|
1158
1213
|
risk: "write",
|
|
1159
1214
|
validate: (ctx) => {
|
|
@@ -1169,6 +1224,8 @@ var addSkill = {
|
|
|
1169
1224
|
if (scope && !["personal", "company"].includes(scope)) {
|
|
1170
1225
|
throw new Error("--scope must be personal or company");
|
|
1171
1226
|
}
|
|
1227
|
+
const version = ctx.str("version");
|
|
1228
|
+
if (version) assertValidSkillVersion(version);
|
|
1172
1229
|
},
|
|
1173
1230
|
dryRun: (ctx) => {
|
|
1174
1231
|
const body = {
|
|
@@ -1176,7 +1233,8 @@ var addSkill = {
|
|
|
1176
1233
|
description: ctx.str("description"),
|
|
1177
1234
|
instructions: ctx.str("instructions") === "@-" ? "(from stdin)" : ctx.str("instructions"),
|
|
1178
1235
|
displayName: ctx.str("displayName") || void 0,
|
|
1179
|
-
scope: ctx.str("scope") || "personal"
|
|
1236
|
+
scope: ctx.str("scope") || "personal",
|
|
1237
|
+
version: ctx.str("version") || void 0
|
|
1180
1238
|
};
|
|
1181
1239
|
const meta = buildMetaBody2(ctx);
|
|
1182
1240
|
if (meta) body._meta = meta;
|
|
@@ -1189,7 +1247,8 @@ var addSkill = {
|
|
|
1189
1247
|
description: ctx.str("description"),
|
|
1190
1248
|
instructions,
|
|
1191
1249
|
displayName: ctx.str("displayName") || void 0,
|
|
1192
|
-
scope: ctx.str("scope") || "personal"
|
|
1250
|
+
scope: ctx.str("scope") || "personal",
|
|
1251
|
+
version: ctx.str("version") || void 0
|
|
1193
1252
|
});
|
|
1194
1253
|
const id = created?.item?.id;
|
|
1195
1254
|
const meta = buildMetaBody2(ctx);
|
|
@@ -1209,7 +1268,12 @@ var delSkill = {
|
|
|
1209
1268
|
command: "+del-skill",
|
|
1210
1269
|
description: "Delete a personal Skill (physical delete)",
|
|
1211
1270
|
flags: [
|
|
1212
|
-
{
|
|
1271
|
+
{
|
|
1272
|
+
name: "id",
|
|
1273
|
+
type: "string",
|
|
1274
|
+
required: true,
|
|
1275
|
+
desc: "Skill record ID (CUID)"
|
|
1276
|
+
}
|
|
1213
1277
|
],
|
|
1214
1278
|
risk: "high-risk-write",
|
|
1215
1279
|
dryRun: (ctx) => ({
|
|
@@ -1225,8 +1289,18 @@ var toggleSkill = {
|
|
|
1225
1289
|
command: "+toggle-skill",
|
|
1226
1290
|
description: "Enable or disable a Skill",
|
|
1227
1291
|
flags: [
|
|
1228
|
-
{
|
|
1229
|
-
|
|
1292
|
+
{
|
|
1293
|
+
name: "id",
|
|
1294
|
+
type: "string",
|
|
1295
|
+
required: true,
|
|
1296
|
+
desc: "Skill record ID (CUID)"
|
|
1297
|
+
},
|
|
1298
|
+
{
|
|
1299
|
+
name: "enabled",
|
|
1300
|
+
type: "boolean",
|
|
1301
|
+
required: true,
|
|
1302
|
+
desc: "true to enable, false to disable"
|
|
1303
|
+
}
|
|
1230
1304
|
],
|
|
1231
1305
|
risk: "write",
|
|
1232
1306
|
dryRun: (ctx) => ({
|
|
@@ -1246,12 +1320,46 @@ var listSkillMarket = {
|
|
|
1246
1320
|
command: "+list-skill-market",
|
|
1247
1321
|
description: "List Skills from the market (only approved items; system/company/personal)",
|
|
1248
1322
|
flags: [
|
|
1249
|
-
{
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1323
|
+
{
|
|
1324
|
+
name: "scope",
|
|
1325
|
+
type: "string",
|
|
1326
|
+
required: false,
|
|
1327
|
+
default: "all",
|
|
1328
|
+
desc: `Market scope: ${MARKET_SCOPES.join(" | ")} (custom = personal)`
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
name: "category",
|
|
1332
|
+
type: "string",
|
|
1333
|
+
required: false,
|
|
1334
|
+
desc: `Category key: ${MARKET_CATEGORIES.join(" | ")}`
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
name: "search",
|
|
1338
|
+
type: "string",
|
|
1339
|
+
required: false,
|
|
1340
|
+
desc: "Fuzzy search on name/displayName/description"
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
name: "sort",
|
|
1344
|
+
type: "string",
|
|
1345
|
+
required: false,
|
|
1346
|
+
default: "newest",
|
|
1347
|
+
desc: `Sort: ${MARKET_SORTS.join(" | ")} (calls = downloads)`
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
name: "limit",
|
|
1351
|
+
type: "number",
|
|
1352
|
+
required: false,
|
|
1353
|
+
default: 50,
|
|
1354
|
+
desc: "Page size (1-100, default 50)"
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
name: "offset",
|
|
1358
|
+
type: "number",
|
|
1359
|
+
required: false,
|
|
1360
|
+
default: 0,
|
|
1361
|
+
desc: "Page offset (>=0, default 0)"
|
|
1362
|
+
}
|
|
1255
1363
|
],
|
|
1256
1364
|
risk: "read",
|
|
1257
1365
|
validate: (ctx) => {
|
|
@@ -1281,10 +1389,30 @@ var setSkillMeta = {
|
|
|
1281
1389
|
command: "+set-skill-meta",
|
|
1282
1390
|
description: "Update a Skill market meta (category / icon). Company scope requires root; system is read-only.",
|
|
1283
1391
|
flags: [
|
|
1284
|
-
{
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1392
|
+
{
|
|
1393
|
+
name: "id",
|
|
1394
|
+
type: "string",
|
|
1395
|
+
required: true,
|
|
1396
|
+
desc: "Skill record ID (CUID)"
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
name: "category",
|
|
1400
|
+
type: "string",
|
|
1401
|
+
required: false,
|
|
1402
|
+
desc: `Category key: ${MARKET_CATEGORIES.join(" | ")}`
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
name: "icon-emoji",
|
|
1406
|
+
type: "string",
|
|
1407
|
+
required: false,
|
|
1408
|
+
desc: "Market icon emoji (e.g. robot)"
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
name: "icon-color",
|
|
1412
|
+
type: "string",
|
|
1413
|
+
required: false,
|
|
1414
|
+
desc: "Market icon color (e.g. #1E76F0)"
|
|
1415
|
+
}
|
|
1288
1416
|
],
|
|
1289
1417
|
risk: "write",
|
|
1290
1418
|
validate: (ctx) => {
|
|
@@ -1302,10 +1430,7 @@ var setSkillMeta = {
|
|
|
1302
1430
|
body: buildMetaBody2(ctx)
|
|
1303
1431
|
}),
|
|
1304
1432
|
execute: async (ctx) => {
|
|
1305
|
-
return patchToMainApp(
|
|
1306
|
-
`${MARKET_BASE_PATH2}/${encodeURIComponent(ctx.str("id"))}/meta`,
|
|
1307
|
-
buildMetaBody2(ctx)
|
|
1308
|
-
);
|
|
1433
|
+
return patchToMainApp(`${MARKET_BASE_PATH2}/${encodeURIComponent(ctx.str("id"))}/meta`, buildMetaBody2(ctx));
|
|
1309
1434
|
}
|
|
1310
1435
|
};
|
|
1311
1436
|
var copySkill = {
|
|
@@ -1313,10 +1438,30 @@ var copySkill = {
|
|
|
1313
1438
|
command: "+copy-skill",
|
|
1314
1439
|
description: "Copy a system/company Skill to a personal copy (independent duplicate)",
|
|
1315
1440
|
flags: [
|
|
1316
|
-
{
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1441
|
+
{
|
|
1442
|
+
name: "id",
|
|
1443
|
+
type: "string",
|
|
1444
|
+
required: true,
|
|
1445
|
+
desc: "Source Skill record ID (CUID, system or company scope)"
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
name: "category",
|
|
1449
|
+
type: "string",
|
|
1450
|
+
required: false,
|
|
1451
|
+
desc: `Market category key for the copy: ${MARKET_CATEGORIES.join(" | ")}`
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
name: "icon-emoji",
|
|
1455
|
+
type: "string",
|
|
1456
|
+
required: false,
|
|
1457
|
+
desc: "Override market icon emoji (e.g. robot)"
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
name: "icon-color",
|
|
1461
|
+
type: "string",
|
|
1462
|
+
required: false,
|
|
1463
|
+
desc: "Override market icon color (e.g. #1E76F0)"
|
|
1464
|
+
}
|
|
1320
1465
|
],
|
|
1321
1466
|
risk: "write",
|
|
1322
1467
|
validate: (ctx) => {
|
|
@@ -1331,10 +1476,7 @@ var copySkill = {
|
|
|
1331
1476
|
body: buildMetaBody2(ctx) ?? {}
|
|
1332
1477
|
}),
|
|
1333
1478
|
execute: async (ctx) => {
|
|
1334
|
-
return postToMainApp(
|
|
1335
|
-
`${MARKET_BASE_PATH2}/${encodeURIComponent(ctx.str("id"))}/copy`,
|
|
1336
|
-
buildMetaBody2(ctx) ?? {}
|
|
1337
|
-
);
|
|
1479
|
+
return postToMainApp(`${MARKET_BASE_PATH2}/${encodeURIComponent(ctx.str("id"))}/copy`, buildMetaBody2(ctx) ?? {});
|
|
1338
1480
|
}
|
|
1339
1481
|
};
|
|
1340
1482
|
|
|
@@ -1403,7 +1545,12 @@ function makeAssetListCommand(commandName, description, dirName) {
|
|
|
1403
1545
|
command: commandName,
|
|
1404
1546
|
description,
|
|
1405
1547
|
flags: [
|
|
1406
|
-
{
|
|
1548
|
+
{
|
|
1549
|
+
name: "id",
|
|
1550
|
+
type: "string",
|
|
1551
|
+
required: true,
|
|
1552
|
+
desc: "Skill record ID (CUID)"
|
|
1553
|
+
}
|
|
1407
1554
|
],
|
|
1408
1555
|
risk: "read",
|
|
1409
1556
|
dryRun: (ctx) => ({
|
|
@@ -1411,9 +1558,7 @@ function makeAssetListCommand(commandName, description, dirName) {
|
|
|
1411
1558
|
url: `${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/${dirName}`
|
|
1412
1559
|
}),
|
|
1413
1560
|
execute: async (ctx) => {
|
|
1414
|
-
return getFromMainApp(
|
|
1415
|
-
`${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/${dirName}`
|
|
1416
|
-
);
|
|
1561
|
+
return getFromMainApp(`${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/${dirName}`);
|
|
1417
1562
|
}
|
|
1418
1563
|
};
|
|
1419
1564
|
}
|
|
@@ -1432,9 +1577,24 @@ function makeAssetUploadCommand(commandName, description, dirName, mdOnly) {
|
|
|
1432
1577
|
command: commandName,
|
|
1433
1578
|
description,
|
|
1434
1579
|
flags: [
|
|
1435
|
-
{
|
|
1436
|
-
|
|
1437
|
-
|
|
1580
|
+
{
|
|
1581
|
+
name: "id",
|
|
1582
|
+
type: "string",
|
|
1583
|
+
required: true,
|
|
1584
|
+
desc: "Skill record ID (CUID)"
|
|
1585
|
+
},
|
|
1586
|
+
{
|
|
1587
|
+
name: "file",
|
|
1588
|
+
type: "string",
|
|
1589
|
+
required: true,
|
|
1590
|
+
desc: mdOnly ? "Local .md file path to upload" : "Local file path to upload (max 1MB)"
|
|
1591
|
+
},
|
|
1592
|
+
{
|
|
1593
|
+
name: "sub-path",
|
|
1594
|
+
type: "string",
|
|
1595
|
+
required: false,
|
|
1596
|
+
desc: 'Sub-directory under the target dir (e.g. "sub/")'
|
|
1597
|
+
}
|
|
1438
1598
|
],
|
|
1439
1599
|
risk: "write",
|
|
1440
1600
|
validate,
|
|
@@ -1445,10 +1605,7 @@ function makeAssetUploadCommand(commandName, description, dirName, mdOnly) {
|
|
|
1445
1605
|
}),
|
|
1446
1606
|
execute: async (ctx) => {
|
|
1447
1607
|
const fd = buildAssetFormData(ctx.str("file"), ctx.str("subPath") || void 0);
|
|
1448
|
-
return uploadToMainApp(
|
|
1449
|
-
`${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/${dirName}`,
|
|
1450
|
-
fd
|
|
1451
|
-
);
|
|
1608
|
+
return uploadToMainApp(`${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/${dirName}`, fd);
|
|
1452
1609
|
}
|
|
1453
1610
|
};
|
|
1454
1611
|
}
|
|
@@ -1458,9 +1615,24 @@ function makeAssetReadCommand(commandName, description, dirName) {
|
|
|
1458
1615
|
command: commandName,
|
|
1459
1616
|
description,
|
|
1460
1617
|
flags: [
|
|
1461
|
-
{
|
|
1462
|
-
|
|
1463
|
-
|
|
1618
|
+
{
|
|
1619
|
+
name: "id",
|
|
1620
|
+
type: "string",
|
|
1621
|
+
required: true,
|
|
1622
|
+
desc: "Skill record ID (CUID)"
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
name: "path",
|
|
1626
|
+
type: "string",
|
|
1627
|
+
required: true,
|
|
1628
|
+
desc: 'Relative file path within the directory (e.g. "guide.md" or "sub/icon.png")'
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
name: "output",
|
|
1632
|
+
type: "string",
|
|
1633
|
+
required: false,
|
|
1634
|
+
desc: "Write binary content to a local file (preserves binary data)"
|
|
1635
|
+
}
|
|
1464
1636
|
],
|
|
1465
1637
|
risk: "read",
|
|
1466
1638
|
dryRun: (ctx) => ({
|
|
@@ -1489,8 +1661,18 @@ function makeAssetDelCommand(commandName, description, dirName) {
|
|
|
1489
1661
|
command: commandName,
|
|
1490
1662
|
description,
|
|
1491
1663
|
flags: [
|
|
1492
|
-
{
|
|
1493
|
-
|
|
1664
|
+
{
|
|
1665
|
+
name: "id",
|
|
1666
|
+
type: "string",
|
|
1667
|
+
required: true,
|
|
1668
|
+
desc: "Skill record ID (CUID)"
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
name: "path",
|
|
1672
|
+
type: "string",
|
|
1673
|
+
required: true,
|
|
1674
|
+
desc: "Relative file path within the directory to delete"
|
|
1675
|
+
}
|
|
1494
1676
|
],
|
|
1495
1677
|
risk: "high-risk-write",
|
|
1496
1678
|
dryRun: (ctx) => ({
|
|
@@ -1500,9 +1682,7 @@ function makeAssetDelCommand(commandName, description, dirName) {
|
|
|
1500
1682
|
execute: async (ctx) => {
|
|
1501
1683
|
const filePath = ctx.str("path");
|
|
1502
1684
|
const encodedPath = filePath.split("/").map((seg) => encodeURIComponent(seg)).join("/");
|
|
1503
|
-
return deleteFromMainApp(
|
|
1504
|
-
`${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/${dirName}/${encodedPath}`
|
|
1505
|
-
);
|
|
1685
|
+
return deleteFromMainApp(`${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/${dirName}/${encodedPath}`);
|
|
1506
1686
|
}
|
|
1507
1687
|
};
|
|
1508
1688
|
}
|
|
@@ -1511,14 +1691,60 @@ var editSkill = {
|
|
|
1511
1691
|
command: "+edit-skill",
|
|
1512
1692
|
description: "Edit a personal Skill content (name / description / instructions / icon)",
|
|
1513
1693
|
flags: [
|
|
1514
|
-
{
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
{
|
|
1521
|
-
|
|
1694
|
+
{
|
|
1695
|
+
name: "id",
|
|
1696
|
+
type: "string",
|
|
1697
|
+
required: true,
|
|
1698
|
+
desc: "Skill record ID (CUID)"
|
|
1699
|
+
},
|
|
1700
|
+
{
|
|
1701
|
+
name: "name",
|
|
1702
|
+
type: "string",
|
|
1703
|
+
required: false,
|
|
1704
|
+
desc: "New Skill name (1-80 chars)"
|
|
1705
|
+
},
|
|
1706
|
+
{
|
|
1707
|
+
name: "description",
|
|
1708
|
+
type: "string",
|
|
1709
|
+
required: false,
|
|
1710
|
+
desc: "New Skill description"
|
|
1711
|
+
},
|
|
1712
|
+
{
|
|
1713
|
+
name: "instructions",
|
|
1714
|
+
type: "string",
|
|
1715
|
+
required: false,
|
|
1716
|
+
desc: "New instructions (use @- to read from stdin)"
|
|
1717
|
+
},
|
|
1718
|
+
{
|
|
1719
|
+
name: "display-name",
|
|
1720
|
+
type: "string",
|
|
1721
|
+
required: false,
|
|
1722
|
+
desc: "New display name (max 100)"
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
name: "category",
|
|
1726
|
+
type: "string",
|
|
1727
|
+
required: false,
|
|
1728
|
+
desc: `Market category key: ${MARKET_CATEGORIES.join(" | ")}`
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
name: "icon-emoji",
|
|
1732
|
+
type: "string",
|
|
1733
|
+
required: false,
|
|
1734
|
+
desc: "Market icon emoji (e.g. robot)"
|
|
1735
|
+
},
|
|
1736
|
+
{
|
|
1737
|
+
name: "icon-color",
|
|
1738
|
+
type: "string",
|
|
1739
|
+
required: false,
|
|
1740
|
+
desc: "Market icon color (e.g. #1E76F0)"
|
|
1741
|
+
},
|
|
1742
|
+
{
|
|
1743
|
+
name: "version",
|
|
1744
|
+
type: "string",
|
|
1745
|
+
required: false,
|
|
1746
|
+
desc: "New content version (major.minor; required for content changes)"
|
|
1747
|
+
}
|
|
1522
1748
|
],
|
|
1523
1749
|
risk: "write",
|
|
1524
1750
|
validate: (ctx) => {
|
|
@@ -1532,7 +1758,15 @@ var editSkill = {
|
|
|
1532
1758
|
}
|
|
1533
1759
|
const hasAny = ctx.str("name") || ctx.str("description") || ctx.str("instructions") || ctx.str("displayName") || ctx.str("category") || ctx.str("iconEmoji") || ctx.str("iconColor");
|
|
1534
1760
|
if (!hasAny) {
|
|
1535
|
-
throw new Error(
|
|
1761
|
+
throw new Error(
|
|
1762
|
+
"Provide at least one of --name / --description / --instructions / --display-name / --category / --icon-emoji / --icon-color"
|
|
1763
|
+
);
|
|
1764
|
+
}
|
|
1765
|
+
const version = ctx.str("version");
|
|
1766
|
+
if (version) assertValidSkillVersion(version);
|
|
1767
|
+
const changesContent = Boolean(ctx.str("name")) || Boolean(ctx.str("description")) || Boolean(ctx.str("instructions"));
|
|
1768
|
+
if (changesContent && !version) {
|
|
1769
|
+
throw new Error("--version is required when editing Skill content");
|
|
1536
1770
|
}
|
|
1537
1771
|
},
|
|
1538
1772
|
dryRun: (ctx) => {
|
|
@@ -1544,6 +1778,7 @@ var editSkill = {
|
|
|
1544
1778
|
if (ctx.str("category")) body.category = ctx.str("category");
|
|
1545
1779
|
if (ctx.str("iconEmoji")) body.iconEmoji = ctx.str("iconEmoji");
|
|
1546
1780
|
if (ctx.str("iconColor")) body.iconColor = ctx.str("iconColor");
|
|
1781
|
+
if (ctx.str("version")) body.version = ctx.str("version");
|
|
1547
1782
|
return {
|
|
1548
1783
|
method: "PUT",
|
|
1549
1784
|
url: `${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}`,
|
|
@@ -1561,6 +1796,7 @@ var editSkill = {
|
|
|
1561
1796
|
if (ctx.str("category")) body.category = ctx.str("category");
|
|
1562
1797
|
if (ctx.str("iconEmoji")) body.iconEmoji = ctx.str("iconEmoji");
|
|
1563
1798
|
if (ctx.str("iconColor")) body.iconColor = ctx.str("iconColor");
|
|
1799
|
+
if (ctx.str("version")) body.version = ctx.str("version");
|
|
1564
1800
|
return putToMainApp(`${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}`, body);
|
|
1565
1801
|
}
|
|
1566
1802
|
};
|
|
@@ -1569,7 +1805,12 @@ var getSkillContent = {
|
|
|
1569
1805
|
command: "+get-skill-content",
|
|
1570
1806
|
description: "Read a Skill SKILL.md text content",
|
|
1571
1807
|
flags: [
|
|
1572
|
-
{
|
|
1808
|
+
{
|
|
1809
|
+
name: "id",
|
|
1810
|
+
type: "string",
|
|
1811
|
+
required: true,
|
|
1812
|
+
desc: "Skill record ID (CUID)"
|
|
1813
|
+
}
|
|
1573
1814
|
],
|
|
1574
1815
|
risk: "read",
|
|
1575
1816
|
dryRun: (ctx) => ({
|
|
@@ -1577,9 +1818,7 @@ var getSkillContent = {
|
|
|
1577
1818
|
url: `${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/content`
|
|
1578
1819
|
}),
|
|
1579
1820
|
execute: async (ctx) => {
|
|
1580
|
-
return getFromMainApp(
|
|
1581
|
-
`${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/content`
|
|
1582
|
-
);
|
|
1821
|
+
return getFromMainApp(`${BASE_PATH5}/${encodeURIComponent(ctx.str("id"))}/content`);
|
|
1583
1822
|
}
|
|
1584
1823
|
};
|
|
1585
1824
|
var listSkillAssets = makeAssetListCommand(
|
|
@@ -1650,17 +1889,79 @@ var uploadSkill = {
|
|
|
1650
1889
|
command: "+upload-skill",
|
|
1651
1890
|
description: "Upload a ZIP-format Skill (parses SKILL.md + extracts to target dir)",
|
|
1652
1891
|
flags: [
|
|
1653
|
-
{
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
{
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1892
|
+
{
|
|
1893
|
+
name: "file",
|
|
1894
|
+
type: "string",
|
|
1895
|
+
required: true,
|
|
1896
|
+
desc: "Local .zip file path"
|
|
1897
|
+
},
|
|
1898
|
+
{
|
|
1899
|
+
name: "scope",
|
|
1900
|
+
type: "string",
|
|
1901
|
+
required: false,
|
|
1902
|
+
default: "personal",
|
|
1903
|
+
desc: "Target scope: personal | company"
|
|
1904
|
+
},
|
|
1905
|
+
{
|
|
1906
|
+
name: "auto-rename",
|
|
1907
|
+
type: "boolean",
|
|
1908
|
+
required: false,
|
|
1909
|
+
desc: "Auto-rename on name conflict"
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
name: "replace-skill-id",
|
|
1913
|
+
type: "string",
|
|
1914
|
+
required: false,
|
|
1915
|
+
desc: "Replace an existing Skill (CUID) instead of creating a new one"
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
name: "category",
|
|
1919
|
+
type: "string",
|
|
1920
|
+
required: false,
|
|
1921
|
+
desc: `Market category key: ${MARKET_CATEGORIES.join(" | ")}`
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
name: "name",
|
|
1925
|
+
type: "string",
|
|
1926
|
+
required: false,
|
|
1927
|
+
desc: "Override Skill name (from ZIP SKILL.md if omitted)"
|
|
1928
|
+
},
|
|
1929
|
+
{
|
|
1930
|
+
name: "display-name",
|
|
1931
|
+
type: "string",
|
|
1932
|
+
required: false,
|
|
1933
|
+
desc: "Override display name"
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
name: "description",
|
|
1937
|
+
type: "string",
|
|
1938
|
+
required: false,
|
|
1939
|
+
desc: "Override description"
|
|
1940
|
+
},
|
|
1941
|
+
{
|
|
1942
|
+
name: "instructions",
|
|
1943
|
+
type: "string",
|
|
1944
|
+
required: false,
|
|
1945
|
+
desc: "Override instructions (use @- to read from stdin)"
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
name: "icon-emoji",
|
|
1949
|
+
type: "string",
|
|
1950
|
+
required: false,
|
|
1951
|
+
desc: "Market icon emoji (e.g. robot)"
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
name: "icon-color",
|
|
1955
|
+
type: "string",
|
|
1956
|
+
required: false,
|
|
1957
|
+
desc: "Market icon color (e.g. #1E76F0)"
|
|
1958
|
+
},
|
|
1959
|
+
{
|
|
1960
|
+
name: "version",
|
|
1961
|
+
type: "string",
|
|
1962
|
+
required: false,
|
|
1963
|
+
desc: "Content version (major.minor; required with --replace-skill-id)"
|
|
1964
|
+
}
|
|
1664
1965
|
],
|
|
1665
1966
|
risk: "write",
|
|
1666
1967
|
validate: (ctx) => {
|
|
@@ -1678,6 +1979,11 @@ var uploadSkill = {
|
|
|
1678
1979
|
if (category && !isValidMarketCategory(category)) {
|
|
1679
1980
|
throw new Error(`--category must be one of: ${MARKET_CATEGORIES.join(", ")}`);
|
|
1680
1981
|
}
|
|
1982
|
+
const version = ctx.str("version");
|
|
1983
|
+
if (version) assertValidSkillVersion(version);
|
|
1984
|
+
if (ctx.str("replaceSkillId") && !version) {
|
|
1985
|
+
throw new Error("--version is required with --replace-skill-id");
|
|
1986
|
+
}
|
|
1681
1987
|
},
|
|
1682
1988
|
dryRun: (ctx) => {
|
|
1683
1989
|
const body = {
|
|
@@ -1690,9 +1996,11 @@ var uploadSkill = {
|
|
|
1690
1996
|
if (ctx.str("name")) body.name = ctx.str("name");
|
|
1691
1997
|
if (ctx.str("displayName")) body.displayName = ctx.str("displayName");
|
|
1692
1998
|
if (ctx.str("description")) body.description = ctx.str("description");
|
|
1693
|
-
if (ctx.str("instructions"))
|
|
1999
|
+
if (ctx.str("instructions"))
|
|
2000
|
+
body.instructions = ctx.str("instructions") === "@-" ? "(from stdin)" : ctx.str("instructions");
|
|
1694
2001
|
if (ctx.str("iconEmoji")) body.iconEmoji = ctx.str("iconEmoji");
|
|
1695
2002
|
if (ctx.str("iconColor")) body.iconColor = ctx.str("iconColor");
|
|
2003
|
+
if (ctx.str("version")) body.version = ctx.str("version");
|
|
1696
2004
|
return {
|
|
1697
2005
|
method: "POST",
|
|
1698
2006
|
url: `${BASE_PATH5}/upload`,
|
|
@@ -1705,7 +2013,9 @@ var uploadSkill = {
|
|
|
1705
2013
|
const buffer = readFileSync(resolved);
|
|
1706
2014
|
const fileName = basename(resolved);
|
|
1707
2015
|
const fd = new FormData();
|
|
1708
|
-
const blob = new Blob([new Uint8Array(buffer)], {
|
|
2016
|
+
const blob = new Blob([new Uint8Array(buffer)], {
|
|
2017
|
+
type: "application/zip"
|
|
2018
|
+
});
|
|
1709
2019
|
fd.append("file", blob, fileName);
|
|
1710
2020
|
const scope = ctx.str("scope") || "personal";
|
|
1711
2021
|
fd.append("scope", scope);
|
|
@@ -1721,6 +2031,7 @@ var uploadSkill = {
|
|
|
1721
2031
|
}
|
|
1722
2032
|
if (ctx.str("iconEmoji")) fd.append("iconEmoji", ctx.str("iconEmoji"));
|
|
1723
2033
|
if (ctx.str("iconColor")) fd.append("iconColor", ctx.str("iconColor"));
|
|
2034
|
+
if (ctx.str("version")) fd.append("version", ctx.str("version"));
|
|
1724
2035
|
return uploadToMainApp(`${BASE_PATH5}/upload`, fd);
|
|
1725
2036
|
}
|
|
1726
2037
|
};
|
|
@@ -2689,6 +3000,188 @@ var listSandboxTools = {
|
|
|
2689
3000
|
execute: async (ctx) => scanSandboxTools({ status: ctx.str("status") })
|
|
2690
3001
|
};
|
|
2691
3002
|
|
|
3003
|
+
// src/commands/te-agent/conversations.ts
|
|
3004
|
+
var CONVERSATION_PATH = "/api/sandbox/agent/conversations";
|
|
3005
|
+
var ARCHIVE_SEARCH_PATH = `${CONVERSATION_PATH}/archived`;
|
|
3006
|
+
var DEFAULT_LIMIT = 20;
|
|
3007
|
+
var DEFAULT_TIME_ZONE = "Asia/Shanghai";
|
|
3008
|
+
function optional2(value) {
|
|
3009
|
+
const trimmed = value.trim();
|
|
3010
|
+
return trimmed ? trimmed : void 0;
|
|
3011
|
+
}
|
|
3012
|
+
function envOptional2(name) {
|
|
3013
|
+
return optional2(process.env[name] ?? "");
|
|
3014
|
+
}
|
|
3015
|
+
function readAll(ctx) {
|
|
3016
|
+
return ctx.str("all") === "true";
|
|
3017
|
+
}
|
|
3018
|
+
function readTimeZone(ctx) {
|
|
3019
|
+
return optional2(ctx.str("timeZone")) ?? DEFAULT_TIME_ZONE;
|
|
3020
|
+
}
|
|
3021
|
+
function isValidTimeZone(timeZone) {
|
|
3022
|
+
try {
|
|
3023
|
+
new Intl.DateTimeFormat("en-US", { timeZone }).format();
|
|
3024
|
+
return true;
|
|
3025
|
+
} catch {
|
|
3026
|
+
return false;
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
function formatTimestampInTimeZone(timestamp, timeZone) {
|
|
3030
|
+
const parts = new Intl.DateTimeFormat("en-CA", {
|
|
3031
|
+
timeZone,
|
|
3032
|
+
calendar: "gregory",
|
|
3033
|
+
numberingSystem: "latn",
|
|
3034
|
+
year: "numeric",
|
|
3035
|
+
month: "2-digit",
|
|
3036
|
+
day: "2-digit",
|
|
3037
|
+
hour: "2-digit",
|
|
3038
|
+
minute: "2-digit",
|
|
3039
|
+
second: "2-digit",
|
|
3040
|
+
hourCycle: "h23"
|
|
3041
|
+
}).formatToParts(new Date(timestamp));
|
|
3042
|
+
const values = Object.fromEntries(
|
|
3043
|
+
parts.map(({ type, value }) => [type, value])
|
|
3044
|
+
);
|
|
3045
|
+
return `${values.year}-${values.month}-${values.day} ${values.hour}:${values.minute}:${values.second}`;
|
|
3046
|
+
}
|
|
3047
|
+
function validateFind(ctx) {
|
|
3048
|
+
const rawAll = ctx.str("all");
|
|
3049
|
+
if (rawAll && rawAll !== "true" && rawAll !== "false") return;
|
|
3050
|
+
const agentId = optional2(ctx.str("agentId"));
|
|
3051
|
+
const all = readAll(ctx);
|
|
3052
|
+
if (agentId && all) {
|
|
3053
|
+
throw new Error("--agent-id and --all true cannot be used together");
|
|
3054
|
+
}
|
|
3055
|
+
if (!agentId && !all && !envOptional2("TE_AGENT_CURRENT_AGENT_ID")) {
|
|
3056
|
+
throw new Error(
|
|
3057
|
+
"Archive scope is required. Provide --agent-id or --all true, or run inside an Agent sandbox."
|
|
3058
|
+
);
|
|
3059
|
+
}
|
|
3060
|
+
const limit = optional2(ctx.str("limit")) ? ctx.num("limit") : DEFAULT_LIMIT;
|
|
3061
|
+
if (!Number.isInteger(limit) || limit < 1 || limit > 100) {
|
|
3062
|
+
throw new Error("--limit must be an integer between 1 and 100");
|
|
3063
|
+
}
|
|
3064
|
+
if (!isValidTimeZone(readTimeZone(ctx))) {
|
|
3065
|
+
throw new Error("--time-zone must be a valid IANA time zone");
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
function buildArchivedConversationSearchPath(ctx) {
|
|
3069
|
+
const params = new URLSearchParams();
|
|
3070
|
+
const q = optional2(ctx.str("q"));
|
|
3071
|
+
const explicitAgentId = optional2(ctx.str("agentId"));
|
|
3072
|
+
const all = readAll(ctx);
|
|
3073
|
+
const agentId = explicitAgentId ?? envOptional2("TE_AGENT_CURRENT_AGENT_ID");
|
|
3074
|
+
const limit = optional2(ctx.str("limit")) ? ctx.num("limit") : DEFAULT_LIMIT;
|
|
3075
|
+
if (q) params.set("q", q);
|
|
3076
|
+
if (all) params.set("all", "true");
|
|
3077
|
+
else if (agentId) params.set("agentId", agentId);
|
|
3078
|
+
params.set("limit", String(limit));
|
|
3079
|
+
return `${ARCHIVE_SEARCH_PATH}?${params.toString()}`;
|
|
3080
|
+
}
|
|
3081
|
+
function toArchivedConversationOutput(item, timeZone) {
|
|
3082
|
+
return {
|
|
3083
|
+
conversation_id: item.id,
|
|
3084
|
+
title: item.title,
|
|
3085
|
+
last_preview: item.lastPreview,
|
|
3086
|
+
archived_at: item.archivedAt,
|
|
3087
|
+
archived_at_local: formatTimestampInTimeZone(item.archivedAt, timeZone),
|
|
3088
|
+
updated_at: item.updatedAt,
|
|
3089
|
+
updated_at_local: formatTimestampInTimeZone(item.updatedAt, timeZone),
|
|
3090
|
+
time_zone: timeZone,
|
|
3091
|
+
agent: item.agent ? {
|
|
3092
|
+
agent_id: item.agent.id,
|
|
3093
|
+
name: item.agent.name,
|
|
3094
|
+
avatar_url: item.agent.avatarUrl,
|
|
3095
|
+
scope: item.agent.scope
|
|
3096
|
+
} : null
|
|
3097
|
+
};
|
|
3098
|
+
}
|
|
3099
|
+
var findArchivedConversations = {
|
|
3100
|
+
service: "agent",
|
|
3101
|
+
command: "+find-archived-conversations",
|
|
3102
|
+
description: "Find archived conversations for one Agent or all Agents",
|
|
3103
|
+
flags: [
|
|
3104
|
+
{
|
|
3105
|
+
name: "q",
|
|
3106
|
+
type: "string",
|
|
3107
|
+
required: false,
|
|
3108
|
+
desc: "Optional keyword matched against conversation titles and message previews"
|
|
3109
|
+
},
|
|
3110
|
+
{
|
|
3111
|
+
name: "agent-id",
|
|
3112
|
+
type: "string",
|
|
3113
|
+
required: false,
|
|
3114
|
+
desc: "Agent ID; defaults to TE_AGENT_CURRENT_AGENT_ID inside an Agent sandbox"
|
|
3115
|
+
},
|
|
3116
|
+
{
|
|
3117
|
+
name: "all",
|
|
3118
|
+
type: "boolean",
|
|
3119
|
+
required: false,
|
|
3120
|
+
desc: "Set true to search archived conversations across all Agents"
|
|
3121
|
+
},
|
|
3122
|
+
{
|
|
3123
|
+
name: "limit",
|
|
3124
|
+
type: "number",
|
|
3125
|
+
required: false,
|
|
3126
|
+
default: DEFAULT_LIMIT,
|
|
3127
|
+
min: 1,
|
|
3128
|
+
max: 100,
|
|
3129
|
+
desc: "Maximum number of archived conversations to return, 1-100; default 20"
|
|
3130
|
+
},
|
|
3131
|
+
{
|
|
3132
|
+
name: "time-zone",
|
|
3133
|
+
type: "string",
|
|
3134
|
+
required: false,
|
|
3135
|
+
default: DEFAULT_TIME_ZONE,
|
|
3136
|
+
desc: "IANA time zone used for local timestamp fields; default Asia/Shanghai"
|
|
3137
|
+
}
|
|
3138
|
+
],
|
|
3139
|
+
risk: "read",
|
|
3140
|
+
validate: validateFind,
|
|
3141
|
+
dryRun: (ctx) => ({
|
|
3142
|
+
method: "GET",
|
|
3143
|
+
url: buildArchivedConversationSearchPath(ctx)
|
|
3144
|
+
}),
|
|
3145
|
+
execute: async (ctx) => {
|
|
3146
|
+
const timeZone = readTimeZone(ctx);
|
|
3147
|
+
const result = await getFromMainApp(
|
|
3148
|
+
buildArchivedConversationSearchPath(ctx)
|
|
3149
|
+
);
|
|
3150
|
+
return {
|
|
3151
|
+
items: result.items.map(
|
|
3152
|
+
(item) => toArchivedConversationOutput(item, timeZone)
|
|
3153
|
+
),
|
|
3154
|
+
has_more: result.hasMore
|
|
3155
|
+
};
|
|
3156
|
+
}
|
|
3157
|
+
};
|
|
3158
|
+
var restoreConversation = {
|
|
3159
|
+
service: "agent",
|
|
3160
|
+
command: "+restore-conversation",
|
|
3161
|
+
description: "Restore an archived conversation by conversation ID",
|
|
3162
|
+
flags: [
|
|
3163
|
+
{
|
|
3164
|
+
name: "conversation-id",
|
|
3165
|
+
type: "string",
|
|
3166
|
+
required: true,
|
|
3167
|
+
desc: "Conversation ID returned by +find-archived-conversations"
|
|
3168
|
+
}
|
|
3169
|
+
],
|
|
3170
|
+
risk: "write",
|
|
3171
|
+
dryRun: (ctx) => ({
|
|
3172
|
+
method: "POST",
|
|
3173
|
+
url: `${CONVERSATION_PATH}/${encodeURIComponent(ctx.str("conversationId"))}/restore`,
|
|
3174
|
+
body: {}
|
|
3175
|
+
}),
|
|
3176
|
+
execute: async (ctx) => {
|
|
3177
|
+
const result = await postToMainApp(
|
|
3178
|
+
`${CONVERSATION_PATH}/${encodeURIComponent(ctx.str("conversationId"))}/restore`,
|
|
3179
|
+
{}
|
|
3180
|
+
);
|
|
3181
|
+
return { changed: result.changed, conversation_id: result.conversationId };
|
|
3182
|
+
}
|
|
3183
|
+
};
|
|
3184
|
+
|
|
2692
3185
|
// src/commands/te-agent/index.ts
|
|
2693
3186
|
var commands = [
|
|
2694
3187
|
// Agent CRUD
|
|
@@ -2766,6 +3259,9 @@ var commands = [
|
|
|
2766
3259
|
listAutomations,
|
|
2767
3260
|
createAutomation,
|
|
2768
3261
|
updateAutomation,
|
|
3262
|
+
// Archived conversations
|
|
3263
|
+
findArchivedConversations,
|
|
3264
|
+
restoreConversation,
|
|
2769
3265
|
// Sandbox tools (local scan of /home/ta/.local/bin managed shims)
|
|
2770
3266
|
listSandboxTools
|
|
2771
3267
|
];
|