@lark-apaas/fullstack-cli 1.1.10 → 1.1.11-alpha.1

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 (2) hide show
  1. package/dist/index.js +54 -9
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1474,12 +1474,16 @@ function transformSendFeishuMessage(input) {
1474
1474
  const markdownElement = bodyElements?.find((el) => el.tag === "markdown");
1475
1475
  const content = markdownElement?.content ?? "";
1476
1476
  const columnSet = bodyElements?.find((el) => el.tag === "column_set");
1477
+ const validStyles = ["default", "primary", "danger"];
1477
1478
  const buttons = columnSet?.columns?.flatMap(
1478
- (column) => column.elements?.filter((el) => el.tag === "button").map((btn) => ({
1479
- style: btn.type,
1480
- text: btn.text?.content,
1481
- url: btn.behaviors?.[0]?.default_url
1482
- })) ?? []
1479
+ (column) => column.elements?.filter((el) => el.tag === "button").map((btn) => {
1480
+ const style = btn.type;
1481
+ return {
1482
+ style: validStyles.includes(style) ? style : "default",
1483
+ text: btn.text?.content ?? "\u6309\u94AE",
1484
+ url: btn.behaviors?.[0]?.default_url ?? "-"
1485
+ };
1486
+ }) ?? []
1483
1487
  ) ?? [];
1484
1488
  return {
1485
1489
  sender: "bot",
@@ -1529,7 +1533,7 @@ function transformAITextGenerate(input) {
1529
1533
  }
1530
1534
 
1531
1535
  // src/commands/migration/versions/v001_capability/json-migrator/form-value-transformers/capabilities/ai-image-understanding.ts
1532
- var DEFAULT_MODEL_ID2 = "87";
1536
+ var DEFAULT_MODEL_ID2 = "88";
1533
1537
  var DEFAULT_MAX_TOKENS2 = 8192;
1534
1538
  var DEFAULT_TEMPERATURE2 = 0.7;
1535
1539
  function transformAIImageUnderstanding(input) {
@@ -1576,16 +1580,48 @@ function transformFormValue(sourceActionID, actionInput) {
1576
1580
  }
1577
1581
 
1578
1582
  // src/commands/migration/versions/v001_capability/json-migrator/transformer.ts
1583
+ function transformAIImageUnderstandingParamsSchema(inputSchema) {
1584
+ if (!inputSchema.properties || typeof inputSchema.properties !== "object") {
1585
+ return inputSchema;
1586
+ }
1587
+ const properties = inputSchema.properties;
1588
+ const newProperties = {};
1589
+ for (const [key, value] of Object.entries(properties)) {
1590
+ if (key === "image_list") {
1591
+ newProperties[key] = {
1592
+ ...value,
1593
+ format: "plugin-image-url"
1594
+ };
1595
+ } else {
1596
+ newProperties[key] = value;
1597
+ }
1598
+ }
1599
+ return {
1600
+ ...inputSchema,
1601
+ properties: newProperties
1602
+ };
1603
+ }
1604
+ var PARAMS_SCHEMA_TRANSFORMER_MAP = {
1605
+ "official_ai/image_understanding": transformAIImageUnderstandingParamsSchema
1606
+ };
1607
+ function transformParamsSchema(sourceActionID, inputSchema) {
1608
+ const transformer = PARAMS_SCHEMA_TRANSFORMER_MAP[sourceActionID];
1609
+ if (!transformer) {
1610
+ return inputSchema;
1611
+ }
1612
+ return transformer(inputSchema);
1613
+ }
1579
1614
  function transformCapability(old) {
1580
1615
  const { pluginKey, pluginVersion } = getPluginInfoBySourceActionID(old.sourceActionID);
1581
1616
  const formValue = transformFormValue(old.sourceActionID, old.actionInput);
1617
+ const paramsSchema = transformParamsSchema(old.sourceActionID, old.inputSchema);
1582
1618
  return {
1583
1619
  id: old.id,
1584
1620
  pluginKey,
1585
1621
  pluginVersion,
1586
1622
  name: old.name,
1587
1623
  description: old.desc,
1588
- paramsSchema: old.inputSchema,
1624
+ paramsSchema,
1589
1625
  formValue,
1590
1626
  createdAt: old.createdAt,
1591
1627
  updatedAt: old.updatedAt
@@ -2495,9 +2531,18 @@ async function generateReport(result) {
2495
2531
  lines.push("- [ ] \u5904\u7406\u624B\u52A8\u8FC1\u79FB\u9879");
2496
2532
  }
2497
2533
  lines.push("");
2498
- const reportPath = path14.join(getProjectRoot3(), REPORT_FILE);
2534
+ const logDir = process.env.LOG_DIR || "logs";
2535
+ const logDirPath = path14.join(getProjectRoot3(), logDir);
2536
+ if (!fs14.existsSync(logDirPath)) {
2537
+ return;
2538
+ }
2539
+ const reportDir = path14.join(logDirPath, "migration");
2540
+ if (!fs14.existsSync(reportDir)) {
2541
+ fs14.mkdirSync(reportDir, { recursive: true });
2542
+ }
2543
+ const reportPath = path14.join(reportDir, REPORT_FILE);
2499
2544
  fs14.writeFileSync(reportPath, lines.join("\n"), "utf-8");
2500
- console.log(`\u{1F4C4} Report generated: ${REPORT_FILE}`);
2545
+ console.log(`\u{1F4C4} Report generated: ${reportPath}`);
2501
2546
  }
2502
2547
 
2503
2548
  // src/commands/migration/versions/v001_capability/migration-runner.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-cli",
3
- "version": "1.1.10",
3
+ "version": "1.1.11-alpha.1",
4
4
  "description": "CLI tool for fullstack template management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "dependencies": {
34
- "@lark-apaas/devtool-kits": "^1.2.13",
34
+ "@lark-apaas/devtool-kits": "^1.2.12",
35
35
  "@lark-apaas/http-client": "0.1.2",
36
36
  "@vercel/nft": "^0.30.3",
37
37
  "commander": "^13.0.0",