@dainprotocol/cli 1.1.13 → 1.1.15

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.
@@ -50,7 +50,7 @@ var status_1 = __importDefault(require("./status"));
50
50
  var START_DEPLOY_URI = '/api/app/data/deployments/start-deploy';
51
51
  function deploy(options) {
52
52
  return __awaiter(this, void 0, void 0, function () {
53
- var config, spinner, basePath, deployPath, envArray, result, deploymentId, error_1;
53
+ var config, spinner, basePath, deployPath, envArray, result, deploymentId, dainJson, dainJsonObject, error_1;
54
54
  return __generator(this, function (_a) {
55
55
  switch (_a.label) {
56
56
  case 0:
@@ -60,7 +60,7 @@ function deploy(options) {
60
60
  deployPath = "".concat(basePath).concat(START_DEPLOY_URI);
61
61
  _a.label = 1;
62
62
  case 1:
63
- _a.trys.push([1, 7, , 8]);
63
+ _a.trys.push([1, 9, , 10]);
64
64
  return [4 /*yield*/, loadAndValidateEnvVariables()];
65
65
  case 2:
66
66
  envArray = _a.sent();
@@ -73,6 +73,14 @@ function deploy(options) {
73
73
  deploymentId = result.deploymentId.replace('codegen-', '');
74
74
  return [4 /*yield*/, recursiveStatusUntilRunning(JSON.stringify(config), deploymentId)];
75
75
  case 5:
76
+ _a.sent();
77
+ return [4 /*yield*/, fs_extra_1.default.readFile('./dain.json', 'utf-8')];
78
+ case 6:
79
+ dainJson = _a.sent();
80
+ dainJsonObject = JSON.parse(dainJson);
81
+ dainJsonObject['deployment-id'] = deploymentId;
82
+ return [4 /*yield*/, fs_extra_1.default.writeFile('./dain.json', JSON.stringify(dainJsonObject, null, 2))];
83
+ case 7:
76
84
  _a.sent();
77
85
  console.log('\n-----------------------');
78
86
  spinner.succeed("Deployment URL: ".concat(result.service.url));
@@ -84,17 +92,17 @@ function deploy(options) {
84
92
  return [4 /*yield*/, fetch(result.service.url, {
85
93
  method: 'GET',
86
94
  })];
87
- case 6:
95
+ case 8:
88
96
  _a.sent();
89
97
  process.exit(0);
90
- return [3 /*break*/, 8];
91
- case 7:
98
+ return [3 /*break*/, 10];
99
+ case 9:
92
100
  error_1 = _a.sent();
93
101
  spinner.fail('Deployment failed.');
94
102
  (0, utils_1.logError)('Error during deployment: ', error_1);
95
103
  process.exit(1);
96
- return [3 /*break*/, 8];
97
- case 8: return [2 /*return*/];
104
+ return [3 /*break*/, 10];
105
+ case 10: return [2 /*return*/];
98
106
  }
99
107
  });
100
108
  });
@@ -107,29 +107,6 @@ const getWeatherForecastConfig: ToolConfig = {
107
107
  `User / Agent ${agentInfo.id} requested forecast at ${locationName} (${latitude},${longitude})`
108
108
  );
109
109
 
110
- // Send early UI with map and loading state
111
- if (context.updateUI) {
112
- await context.updateUI({
113
- ui: new CardUIBuilder()
114
- .setRenderMode("page")
115
- .title(`Weather Forecast for ${locationName} ⏳`)
116
- .addChild(new MapUIBuilder()
117
- .setInitialView(latitude, longitude, 10)
118
- .setMapStyle('streets')
119
- .addMarkers([
120
- {
121
- latitude,
122
- longitude,
123
- title: locationName,
124
- description: 'Loading forecast data...',
125
- text: `${locationName} ⏳`,
126
- }
127
- ])
128
- .build())
129
- .content('Fetching weather forecast data...')
130
- .build()
131
- });
132
- }
133
110
 
134
111
  const response = await axios.get(
135
112
  `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&hourly=temperature_2m,relative_humidity_2m,wind_speed_10m`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dainprotocol/cli",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -107,29 +107,6 @@ const getWeatherForecastConfig: ToolConfig = {
107
107
  `User / Agent ${agentInfo.id} requested forecast at ${locationName} (${latitude},${longitude})`
108
108
  );
109
109
 
110
- // Send early UI with map and loading state
111
- if (context.updateUI) {
112
- await context.updateUI({
113
- ui: new CardUIBuilder()
114
- .setRenderMode("page")
115
- .title(`Weather Forecast for ${locationName} ⏳`)
116
- .addChild(new MapUIBuilder()
117
- .setInitialView(latitude, longitude, 10)
118
- .setMapStyle('streets')
119
- .addMarkers([
120
- {
121
- latitude,
122
- longitude,
123
- title: locationName,
124
- description: 'Loading forecast data...',
125
- text: `${locationName} ⏳`,
126
- }
127
- ])
128
- .build())
129
- .content('Fetching weather forecast data...')
130
- .build()
131
- });
132
- }
133
110
 
134
111
  const response = await axios.get(
135
112
  `https://api.open-meteo.com/v1/forecast?latitude=${latitude}&longitude=${longitude}&hourly=temperature_2m,relative_humidity_2m,wind_speed_10m`