@thinkingai/ae-cli 6.1.10 → 6.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +25 -3
  2. package/README.zh.md +25 -3
  3. package/dist/{auth-56Z45UVR.js → auth-GDV3H5I4.js} +18 -8
  4. package/dist/{auth-ENM3FE6L.js → auth-NN55553T.js} +3 -3
  5. package/dist/{capability-2H6PAOA3.js → capability-TPORIKRQ.js} +19 -15
  6. package/dist/{capability-YPOQX6PL.js → capability-VQNC5CF7.js} +19 -15
  7. package/dist/chunk-4NN5IWVN.js +26 -0
  8. package/dist/{chunk-DB4Q3ANU.js → chunk-6A2FUCIS.js} +3 -3
  9. package/dist/{chunk-PVBYJWC2.js → chunk-7KQWSBSL.js} +4 -4
  10. package/dist/{chunk-24BAVOX3.js → chunk-AXDXJTPC.js} +3 -1
  11. package/dist/{chunk-CPVTECJ3.js → chunk-DT6Y3TD7.js} +5 -5
  12. package/dist/{chunk-EGEIXA2Z.js → chunk-DWO43OIB.js} +0 -248
  13. package/dist/{chunk-V6FR6WTW.js → chunk-GJJA4CQZ.js} +34 -2
  14. package/dist/{chunk-RGXCNC4N.js → chunk-GS2P7LFD.js} +50 -17
  15. package/dist/{chunk-LYVNONC4.js → chunk-JHENBQ5B.js} +35 -0
  16. package/dist/{chunk-3P3562ZX.js → chunk-MVDZ7DBQ.js} +5 -5
  17. package/dist/{chunk-LCXU3AAT.js → chunk-NBPKWKRA.js} +2 -2
  18. package/dist/{chunk-HQ2A7ITL.js → chunk-RBNKI5ZW.js} +50 -17
  19. package/dist/{chunk-LHVM35J4.js → chunk-TS6BUGUY.js} +4 -4
  20. package/dist/chunk-TUKQZTMI.js +250 -0
  21. package/dist/{chunk-J7MZHDHQ.js → chunk-VKD5WQKN.js} +5 -5
  22. package/dist/{chunk-3KI3RRXX.js → chunk-VTXHDCBW.js} +3 -3
  23. package/dist/{chunk-KTYR3U6D.js → chunk-YTG6Q75E.js} +10 -6
  24. package/dist/{chunk-IR4ZLVPW.js → chunk-YV52FB5G.js} +25 -3
  25. package/dist/{chunk-E7UXXHO3.js → chunk-Z3OXWCIA.js} +3 -3
  26. package/dist/{cli-token-4SBMXAUK.js → cli-token-GL5MS5FK.js} +4 -4
  27. package/dist/{client-PP5FETMW.js → client-DAIPF7XN.js} +4 -4
  28. package/dist/{community-report-client-KK2QBANO.js → community-report-client-M2RW4MXD.js} +2 -2
  29. package/dist/config-4VZNLBKF.js +489 -0
  30. package/dist/index.js +94 -35
  31. package/dist/memory-RWJW4XFO.js +892 -0
  32. package/dist/memory-VO2ZJCRT.js +892 -0
  33. package/dist/{metadata-JIQ77HFY.js → metadata-YGTHR2XJ.js} +8 -8
  34. package/dist/{metadata-AN3YFZEV.js → metadata-ZRN2GHPN.js} +8 -8
  35. package/dist/{model-JASQVOFD.js → model-CLUIK3K5.js} +7 -5
  36. package/dist/{raw-XJCAT3HX.js → raw-52B4UKO4.js} +8 -7
  37. package/dist/sync-3REDHGY6.js +10259 -0
  38. package/dist/{te-agent-JHUG6DVV.js → te-agent-XNPELAKX.js} +580 -84
  39. package/dist/{te-analysis-ITKTO6JS.js → te-analysis-GJI5FZUL.js} +1152 -13
  40. package/dist/{te-analysis-RAC67YYD.js → te-analysis-N2BRDJZ5.js} +1152 -13
  41. package/dist/{te-community-QOYIYEJI.js → te-community-SQXKE5OO.js} +7 -7
  42. package/dist/{te-community-UFKI6ONP.js → te-community-TYSNU3NQ.js} +7 -7
  43. package/dist/{te-dataops-PZQ5NQLY.js → te-dataops-5TM7WZDI.js} +370 -189
  44. package/dist/{te-dataops-XTWVTJCA.js → te-dataops-OWIADNSM.js} +370 -189
  45. package/dist/{te-engage-NLZUPSBK.js → te-engage-F7V55KVW.js} +333 -105
  46. package/dist/{te-engage-E7F4HTXU.js → te-engage-FMYAYCNV.js} +333 -105
  47. package/dist/{te-experiment-N63WF7XA.js → te-experiment-JWXOYJ3W.js} +83 -10
  48. package/dist/{te-experiment-D32TB6ZB.js → te-experiment-UPDMHCAJ.js} +83 -10
  49. package/dist/{te-kb-E7NSCBRB.js → te-kb-VRMEY3D4.js} +6 -6
  50. package/dist/{te-meta-GBDTMPEL.js → te-meta-53BVXPFI.js} +7 -7
  51. package/dist/{te-meta-ZTLTSHXC.js → te-meta-TOCBPBXI.js} +7 -7
  52. package/dist/{te-system-AH7DMCAQ.js → te-system-XGS5EQIQ.js} +4 -4
  53. package/dist/{te-team-BQ3SKSZV.js → te-team-BZRDV2CM.js} +7 -7
  54. package/dist/{update-DKG6UXEM.js → update-HEDXGOJH.js} +8 -6
  55. package/package.json +4 -1
  56. package/skills/ae-agent/SKILL.md +178 -16
  57. package/skills/ae-agent/references/add-skill.md +22 -10
  58. package/skills/ae-agent/references/edit-skill.md +24 -14
  59. package/skills/ae-agent/references/find-archived-conversations.md +82 -0
  60. package/skills/ae-agent/references/restore-conversation.md +54 -0
  61. package/skills/ae-agent/references/upload-skill.md +24 -14
  62. package/skills/ae-analysis/SKILL.md +1 -1
  63. package/skills/ae-analysis/references/command_index.md +104 -42
  64. package/skills/ae-analysis/references/entity_id_import_options.md +1 -1
  65. package/skills/ae-analysis/references/project_access_detail_get.md +3 -3
  66. package/skills/ae-analysis/references/project_data_power_delete.md +3 -3
  67. package/skills/ae-analysis/references/project_data_power_get.md +3 -3
  68. package/skills/ae-analysis/references/project_data_power_list.md +3 -3
  69. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -3
  70. package/skills/ae-analysis/references/project_entity_create.md +3 -3
  71. package/skills/ae-analysis/references/project_entity_delete.md +3 -3
  72. package/skills/ae-analysis/references/project_entity_event_list.md +3 -3
  73. package/skills/ae-analysis/references/project_entity_get.md +3 -3
  74. package/skills/ae-analysis/references/project_entity_list.md +3 -3
  75. package/skills/ae-analysis/references/project_entity_update.md +3 -3
  76. package/skills/ae-analysis/references/project_function_list.md +3 -3
  77. package/skills/ae-analysis/references/project_info_create.md +25 -0
  78. package/skills/ae-analysis/references/project_info_delete.md +24 -0
  79. package/skills/ae-analysis/references/project_info_get.md +3 -3
  80. package/skills/ae-analysis/references/project_info_list.md +3 -3
  81. package/skills/ae-analysis/references/project_info_update.md +3 -3
  82. package/skills/ae-analysis/references/project_mark_time_create.md +3 -3
  83. package/skills/ae-analysis/references/project_mark_time_delete.md +3 -3
  84. package/skills/ae-analysis/references/project_mark_time_list.md +3 -3
  85. package/skills/ae-analysis/references/project_mark_time_update.md +3 -3
  86. package/skills/ae-analysis/references/project_member_add.md +3 -3
  87. package/skills/ae-analysis/references/project_member_batch_update.md +3 -3
  88. package/skills/ae-analysis/references/project_member_candidate_list.md +3 -3
  89. package/skills/ae-analysis/references/project_member_handover_export.md +3 -3
  90. package/skills/ae-analysis/references/project_member_handover_run.md +3 -3
  91. package/skills/ae-analysis/references/project_member_import.md +3 -3
  92. package/skills/ae-analysis/references/project_member_list.md +3 -3
  93. package/skills/ae-analysis/references/project_member_receiver_list.md +3 -3
  94. package/skills/ae-analysis/references/project_member_remove.md +3 -3
  95. package/skills/ae-analysis/references/project_member_update.md +3 -3
  96. package/skills/ae-analysis/references/project_owner_update.md +3 -3
  97. package/skills/ae-analysis/references/project_permission_binding_list.md +3 -3
  98. package/skills/ae-analysis/references/project_receive_status_update.md +3 -3
  99. package/skills/ae-analysis/references/project_role_delete.md +3 -3
  100. package/skills/ae-analysis/references/project_role_function_list.md +3 -3
  101. package/skills/ae-analysis/references/project_role_get.md +3 -3
  102. package/skills/ae-analysis/references/project_role_list.md +3 -3
  103. package/skills/ae-analysis/references/project_role_upsert.md +3 -3
  104. package/skills/ae-analysis/references/project_role_user_list.md +3 -3
  105. package/skills/ae-analysis/references/project_space_list.md +1 -1
  106. package/skills/ae-analysis/references/project_timezone_get.md +3 -3
  107. package/skills/ae-analysis/references/project_timezone_overview.md +3 -3
  108. package/skills/ae-analysis/references/project_timezone_update.md +3 -3
  109. package/skills/ae-analysis/references/project_user_id_items_update.md +3 -3
  110. package/skills/ae-analysis/references/system_admin_function_list.md +22 -0
  111. package/skills/ae-analysis/references/system_admin_function_update.md +26 -0
  112. package/skills/ae-analysis/references/system_admin_list.md +21 -0
  113. package/skills/ae-analysis/references/system_admin_remove.md +25 -0
  114. package/skills/ae-analysis/references/system_admin_upsert.md +25 -0
  115. package/skills/ae-analysis/references/system_function_list.md +21 -0
  116. package/skills/ae-analysis/references/system_member_add.md +25 -0
  117. package/skills/ae-analysis/references/system_member_candidate_list.md +22 -0
  118. package/skills/ae-analysis/references/system_member_delete.md +25 -0
  119. package/skills/ae-analysis/references/system_member_list.md +24 -0
  120. package/skills/ae-analysis/references/system_member_mfa_unbind.md +25 -0
  121. package/skills/ae-analysis/references/system_member_password_reset.md +32 -0
  122. package/skills/ae-analysis/references/system_member_project_batch_update.md +27 -0
  123. package/skills/ae-analysis/references/system_member_status_update.md +26 -0
  124. package/skills/ae-analysis/references/system_member_update.md +23 -0
  125. package/skills/ae-analysis/references/system_mfa_get.md +21 -0
  126. package/skills/ae-analysis/references/system_mfa_update.md +25 -0
  127. package/skills/ae-analysis/references/system_node_monitor_list.md +24 -0
  128. package/skills/ae-analysis/references/system_oauth2_update.md +22 -0
  129. package/skills/ae-analysis/references/system_ops_alert_contact_delete.md +25 -0
  130. package/skills/ae-analysis/references/system_ops_alert_contact_list.md +23 -0
  131. package/skills/ae-analysis/references/system_ops_alert_contact_test.md +29 -0
  132. package/skills/ae-analysis/references/system_ops_alert_contact_upsert.md +39 -0
  133. package/skills/ae-analysis/references/system_preference_get.md +21 -0
  134. package/skills/ae-analysis/references/system_preference_update.md +22 -0
  135. package/skills/ae-analysis/references/system_project_usage_list.md +28 -0
  136. package/skills/ae-analysis/references/system_query_alert_rule_list.md +21 -0
  137. package/skills/ae-analysis/references/system_query_alert_rule_update.md +26 -0
  138. package/skills/ae-analysis/references/system_query_monitor_overview.md +26 -0
  139. package/skills/ae-analysis/references/system_query_task_cancel.md +25 -0
  140. package/skills/ae-analysis/references/system_query_task_export.md +49 -0
  141. package/skills/ae-analysis/references/system_query_task_get.md +23 -0
  142. package/skills/ae-analysis/references/system_query_task_list.md +35 -0
  143. package/skills/ae-analysis/references/system_query_task_options.md +27 -0
  144. package/skills/ae-analysis/references/system_receiver_address_delete.md +26 -0
  145. package/skills/ae-analysis/references/system_receiver_address_overview.md +21 -0
  146. package/skills/ae-analysis/references/system_receiver_address_project_list.md +21 -0
  147. package/skills/ae-analysis/references/system_receiver_address_promote.md +24 -0
  148. package/skills/ae-analysis/references/system_receiver_address_upsert.md +27 -0
  149. package/skills/ae-analysis/references/system_receiver_detection_get.md +22 -0
  150. package/skills/ae-analysis/references/system_receiver_detection_run.md +22 -0
  151. package/skills/ae-analysis/references/system_receiver_detection_update.md +25 -0
  152. package/skills/ae-analysis/references/system_role_delete.md +26 -0
  153. package/skills/ae-analysis/references/system_role_function_list.md +22 -0
  154. package/skills/ae-analysis/references/system_role_get.md +22 -0
  155. package/skills/ae-analysis/references/system_role_list.md +24 -0
  156. package/skills/ae-analysis/references/system_role_upsert.md +27 -0
  157. package/skills/ae-analysis/references/system_role_user_list.md +22 -0
  158. package/skills/ae-analysis/references/system_seat_list.md +25 -0
  159. package/skills/ae-analysis/references/system_seat_update.md +26 -0
  160. package/skills/ae-analysis/references/system_smtp_delete.md +24 -0
  161. package/skills/ae-analysis/references/system_smtp_get.md +21 -0
  162. package/skills/ae-analysis/references/system_smtp_test.md +22 -0
  163. package/skills/ae-analysis/references/system_smtp_upsert.md +31 -0
  164. package/skills/ae-analysis/references/system_third_party_login_disable.md +25 -0
  165. package/skills/ae-analysis/references/system_third_party_login_list.md +21 -0
  166. package/skills/ae-analysis/references/system_third_party_login_upsert.md +33 -0
  167. package/skills/ae-analysis/references/system_usage_overview.md +21 -0
  168. package/skills/ae-analysis/references/system_usage_trend_export.md +44 -0
  169. package/skills/ae-analysis/references/system_usage_trend_query.md +28 -0
  170. package/skills/ae-dataops/SKILL.md +1 -1
  171. package/skills/ae-dataops/references/dataops-flow-create.md +51 -16
  172. package/skills/ae-engage/SKILL.md +56 -26
  173. package/skills/ae-engage/references/activity-activity.md +3 -0
  174. package/skills/ae-engage/references/activity-approval.md +12 -4
  175. package/skills/ae-engage/references/activity-task.md +21 -6
  176. package/skills/ae-engage/references/activity-topic.md +31 -13
  177. package/skills/ae-engage/references/add-channel.md +170 -41
  178. package/skills/ae-engage/references/build-task-save-guide.md +40 -27
  179. package/skills/ae-engage/references/channel-update-config.md +3 -2
  180. package/skills/ae-engage/references/common-metric.md +48 -120
  181. package/skills/ae-engage/references/flow-detail.md +13 -0
  182. package/skills/ae-engage/references/preset-event.md +12 -32
  183. package/skills/ae-engage/references/save-flow.md +127 -64
  184. package/skills/ae-engage/references/save-task.md +197 -59
  185. package/skills/ae-engage/references/scene-config-metric.md +3 -0
  186. package/skills/ae-engage/references/scene-preset-metric.md +8 -37
  187. package/skills/ae-engage/references/scene-strategy-audience.md +51 -643
  188. package/skills/ae-engage/references/scene-strategy.md +6 -6
  189. package/skills/ae-engage/references/task-detail.md +10 -0
  190. package/skills/ae-engage/references/task-submit-approval.md +45 -0
  191. package/skills/ae-engage/references/validate-flow-node-config.md +1 -1
  192. package/skills/ae-experiment/SKILL.md +21 -1
  193. package/skills/ae-experiment/references/check_experiment_ready.md +2 -0
  194. package/skills/ae-experiment/references/query_experiment_detail.md +6 -0
  195. package/skills/ae-experiment/references/query_experiment_list.md +4 -0
  196. package/skills/ae-experiment/references/query_experiment_list_archived.md +3 -0
  197. package/skills/ae-experiment/references/query_metric_detail.md +5 -0
  198. package/skills/ae-experiment/references/query_metric_list.md +3 -0
  199. package/skills/ae-experiment/references/save_experiment.md +46 -3
  200. package/skills/ae-experiment/references/save_metric.md +62 -0
  201. package/skills/ae-experiment/references/save_submit_experiment.md +3 -0
  202. package/skills/ae-experiment-design/SKILL.md +149 -0
  203. package/skills/ae-experiment-design/agents/openai.yaml +4 -0
  204. package/skills/ae-experiment-design/references/client-experiment-sdk.md +147 -0
  205. package/skills/ae-experiment-design/references/experiment-creation.md +108 -0
  206. package/skills/ae-experiment-design/references/experiment-sdk-contract.md +100 -0
  207. package/skills/ae-experiment-design/references/exposure-contract.md +91 -0
  208. package/skills/ae-experiment-design/references/hybrid-experiment-sdk.md +74 -0
  209. package/skills/ae-experiment-design/references/metric-readiness.md +143 -0
  210. package/skills/ae-experiment-design/references/platform-operations.md +99 -0
  211. package/skills/ae-experiment-design/references/sdk-index.md +76 -0
  212. package/skills/ae-experiment-design/references/sdk-integration.md +114 -0
  213. package/skills/ae-experiment-design/references/sdk-troubleshooting.md +139 -0
  214. package/skills/ae-experiment-design/references/server-experiment-sdk.md +78 -0
  215. package/skills/ae-experiment-design/scripts/calculate_experiment_plan.py +450 -0
  216. package/skills/ae-experiment-insight/SKILL.md +149 -0
  217. package/skills/ae-experiment-insight/agents/openai.yaml +4 -0
  218. package/skills/ae-experiment-insight/references/decision-framework.md +69 -0
  219. package/skills/ae-experiment-insight/references/diagnostic-playbook.md +225 -0
  220. package/skills/ae-experiment-insight/references/platform-operations.md +76 -0
  221. package/skills/ae-experiment-insight/scripts/analyze_experiment.py +478 -0
  222. package/skills/ae-generate-tracking-code/SKILL.md +2 -2
  223. package/skills/ae-metadata/SKILL.md +1 -1
  224. package/dist/config-BSSALXEN.js +0 -128
  225. 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-J7MZHDHQ.js";
10
- import "./chunk-V6FR6WTW.js";
11
- import "./chunk-LYVNONC4.js";
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
- { name: "scope", type: "string", required: false, desc: "Filter by scope: personal | company | system" }
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
- { name: "name", type: "string", required: true, desc: "Skill name (1-80 chars)" },
1150
- { name: "description", type: "string", required: true, desc: "Skill description" },
1151
- { name: "instructions", type: "string", required: true, desc: "Skill instructions (use @- to read from stdin)" },
1152
- { name: "display-name", type: "string", required: false, desc: "Display name (max 100)" },
1153
- { name: "category", type: "string", required: false, desc: `Market category key: ${MARKET_CATEGORIES.join(" | ")}` },
1154
- { name: "icon-emoji", type: "string", required: false, desc: "Market icon emoji (e.g. robot)" },
1155
- { name: "icon-color", type: "string", required: false, desc: "Market icon color (e.g. #1E76F0)" },
1156
- { name: "scope", type: "string", required: false, default: "personal", desc: "Target scope: personal | company" }
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
- { name: "id", type: "string", required: true, desc: "Skill record ID (CUID)" }
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
- { name: "id", type: "string", required: true, desc: "Skill record ID (CUID)" },
1229
- { name: "enabled", type: "boolean", required: true, desc: "true to enable, false to disable" }
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
- { name: "scope", type: "string", required: false, default: "all", desc: `Market scope: ${MARKET_SCOPES.join(" | ")} (custom = personal)` },
1250
- { name: "category", type: "string", required: false, desc: `Category key: ${MARKET_CATEGORIES.join(" | ")}` },
1251
- { name: "search", type: "string", required: false, desc: "Fuzzy search on name/displayName/description" },
1252
- { name: "sort", type: "string", required: false, default: "newest", desc: `Sort: ${MARKET_SORTS.join(" | ")} (calls = downloads)` },
1253
- { name: "limit", type: "number", required: false, default: 50, desc: "Page size (1-100, default 50)" },
1254
- { name: "offset", type: "number", required: false, default: 0, desc: "Page offset (>=0, default 0)" }
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
- { name: "id", type: "string", required: true, desc: "Skill record ID (CUID)" },
1285
- { name: "category", type: "string", required: false, desc: `Category key: ${MARKET_CATEGORIES.join(" | ")}` },
1286
- { name: "icon-emoji", type: "string", required: false, desc: "Market icon emoji (e.g. robot)" },
1287
- { name: "icon-color", type: "string", required: false, desc: "Market icon color (e.g. #1E76F0)" }
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
- { name: "id", type: "string", required: true, desc: "Source Skill record ID (CUID, system or company scope)" },
1317
- { name: "category", type: "string", required: false, desc: `Market category key for the copy: ${MARKET_CATEGORIES.join(" | ")}` },
1318
- { name: "icon-emoji", type: "string", required: false, desc: "Override market icon emoji (e.g. robot)" },
1319
- { name: "icon-color", type: "string", required: false, desc: "Override market icon color (e.g. #1E76F0)" }
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
- { name: "id", type: "string", required: true, desc: "Skill record ID (CUID)" }
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
- { name: "id", type: "string", required: true, desc: "Skill record ID (CUID)" },
1436
- { name: "file", type: "string", required: true, desc: mdOnly ? "Local .md file path to upload" : "Local file path to upload (max 1MB)" },
1437
- { name: "sub-path", type: "string", required: false, desc: 'Sub-directory under the target dir (e.g. "sub/")' }
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
- { name: "id", type: "string", required: true, desc: "Skill record ID (CUID)" },
1462
- { name: "path", type: "string", required: true, desc: 'Relative file path within the directory (e.g. "guide.md" or "sub/icon.png")' },
1463
- { name: "output", type: "string", required: false, desc: "Write binary content to a local file (preserves binary data)" }
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
- { name: "id", type: "string", required: true, desc: "Skill record ID (CUID)" },
1493
- { name: "path", type: "string", required: true, desc: "Relative file path within the directory to delete" }
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
- { name: "id", type: "string", required: true, desc: "Skill record ID (CUID)" },
1515
- { name: "name", type: "string", required: false, desc: "New Skill name (1-80 chars)" },
1516
- { name: "description", type: "string", required: false, desc: "New Skill description" },
1517
- { name: "instructions", type: "string", required: false, desc: "New instructions (use @- to read from stdin)" },
1518
- { name: "display-name", type: "string", required: false, desc: "New display name (max 100)" },
1519
- { name: "category", type: "string", required: false, desc: `Market category key: ${MARKET_CATEGORIES.join(" | ")}` },
1520
- { name: "icon-emoji", type: "string", required: false, desc: "Market icon emoji (e.g. robot)" },
1521
- { name: "icon-color", type: "string", required: false, desc: "Market icon color (e.g. #1E76F0)" }
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("Provide at least one of --name / --description / --instructions / --display-name / --category / --icon-emoji / --icon-color");
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
- { name: "id", type: "string", required: true, desc: "Skill record ID (CUID)" }
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
- { name: "file", type: "string", required: true, desc: "Local .zip file path" },
1654
- { name: "scope", type: "string", required: false, default: "personal", desc: "Target scope: personal | company" },
1655
- { name: "auto-rename", type: "boolean", required: false, desc: "Auto-rename on name conflict" },
1656
- { name: "replace-skill-id", type: "string", required: false, desc: "Replace an existing Skill (CUID) instead of creating a new one" },
1657
- { name: "category", type: "string", required: false, desc: `Market category key: ${MARKET_CATEGORIES.join(" | ")}` },
1658
- { name: "name", type: "string", required: false, desc: "Override Skill name (from ZIP SKILL.md if omitted)" },
1659
- { name: "display-name", type: "string", required: false, desc: "Override display name" },
1660
- { name: "description", type: "string", required: false, desc: "Override description" },
1661
- { name: "instructions", type: "string", required: false, desc: "Override instructions (use @- to read from stdin)" },
1662
- { name: "icon-emoji", type: "string", required: false, desc: "Market icon emoji (e.g. robot)" },
1663
- { name: "icon-color", type: "string", required: false, desc: "Market icon color (e.g. #1E76F0)" }
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")) body.instructions = ctx.str("instructions") === "@-" ? "(from stdin)" : 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)], { type: "application/zip" });
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
  ];