ai-project-manage-cli 6.0.90 → 6.0.91

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 +11 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -492,12 +492,10 @@ var requestConfig = {
492
492
  method: "PUT",
493
493
  path: "/cli/task-deployments/status"
494
494
  }),
495
- syncTaskDeploymentLog: defineEndpoint(
496
- {
497
- method: "PUT",
498
- path: "/cli/task-deployments/log"
499
- }
500
- ),
495
+ syncTaskDeploymentLog: defineEndpoint({
496
+ method: "PUT",
497
+ path: "/cli/task-deployments/log"
498
+ }),
501
499
  completeTaskDeployment: defineEndpoint({
502
500
  method: "PUT",
503
501
  path: "/cli/task-deployments/complete"
@@ -2671,9 +2669,14 @@ function createDeployLogSyncer(api, deploymentRunId) {
2671
2669
  if (!latestLog || latestLog === lastSyncedLog) {
2672
2670
  return;
2673
2671
  }
2672
+ const delta = latestLog.startsWith(lastSyncedLog) && lastSyncedLog.length > 0 ? latestLog.slice(lastSyncedLog.length) : latestLog;
2673
+ if (!delta) {
2674
+ return;
2675
+ }
2674
2676
  await api.cli.syncTaskDeploymentLog({
2675
2677
  id: deploymentRunId,
2676
- log: latestLog
2678
+ log: delta,
2679
+ append: lastSyncedLog.length > 0
2677
2680
  });
2678
2681
  lastSyncedLog = latestLog;
2679
2682
  };
@@ -2726,8 +2729,7 @@ async function handleInboundDeploy(cfg, msg, signal) {
2726
2729
  await logSyncer.flush();
2727
2730
  await api.cli.completeTaskDeployment({
2728
2731
  id: deploymentRunId,
2729
- status: "SUCCESS",
2730
- log: log2
2732
+ status: "SUCCESS"
2731
2733
  });
2732
2734
  console.log(`[apm] deploy success id=${deploymentRunId}`);
2733
2735
  } catch (error) {
@@ -2738,7 +2740,6 @@ async function handleInboundDeploy(cfg, msg, signal) {
2738
2740
  await api.cli.completeTaskDeployment({
2739
2741
  id: deploymentRunId,
2740
2742
  status: "FAILED",
2741
- log: log2,
2742
2743
  error: detail
2743
2744
  });
2744
2745
  console.error(`[apm] deploy failed id=${deploymentRunId}: ${detail}`);
@@ -5994,7 +5995,6 @@ async function completeTrackedDeploy(api, deploymentRunId, logSyncer, input) {
5994
5995
  await api.cli.completeTaskDeployment({
5995
5996
  id: deploymentRunId,
5996
5997
  status: input.status,
5997
- log: input.log,
5998
5998
  error: input.error
5999
5999
  });
6000
6000
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-project-manage-cli",
3
- "version": "6.0.90",
3
+ "version": "6.0.91",
4
4
  "description": "命令行工具:后续用于调用平台后端 API 完成运维与自动化操作",
5
5
  "type": "module",
6
6
  "private": false,