@dainprotocol/cli 1.0.28 → 1.0.30

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.
@@ -53,6 +53,7 @@ function deploy(options) {
53
53
  switch (_a.label) {
54
54
  case 0:
55
55
  config = (0, utils_1.getDainConfig)(options.config);
56
+ // disable for now only availible for internal testing for now
56
57
  if (config.runtime !== 'workers') {
57
58
  (0, utils_1.logError)("Deployment is only supported for 'workers' runtime.");
58
59
  process.exit(1);
@@ -13,6 +13,15 @@ function init(projectName) {
13
13
  var projectDir = path_1.default.join(process.cwd(), projectName);
14
14
  var templateDir = path_1.default.join(__dirname, '..', '..', 'templates', 'default');
15
15
  try {
16
+ // Check Node.js version
17
+ var nodeVersion = process.version;
18
+ var versionNum = Number(nodeVersion.slice(1).split('.')[0]);
19
+ if (versionNum < 20) {
20
+ spinner.fail('Node.js version 20.7 or higher is required');
21
+ (0, utils_1.logError)('Please upgrade Node.js to version 20.7 or higher');
22
+ (0, utils_1.logInfo)('You can download it from: https://nodejs.org/');
23
+ process.exit(1);
24
+ }
16
25
  // Check if directory already exists
17
26
  if (fs_extra_1.default.existsSync(projectDir)) {
18
27
  spinner.fail("Directory ".concat(projectName, " already exists"));
@@ -30,7 +30,7 @@ const getWeatherConfig: ToolConfig = {
30
30
  pricing: { pricePerUse: 0, currency: "USD" },
31
31
  handler: async ({ latitude, longitude }, agentInfo) => {
32
32
  console.log(
33
- `Agent ${agentInfo.agentId} requested weather at ${latitude},${longitude}`
33
+ `User / Agent ${agentInfo.id} requested weather at ${latitude},${longitude}`
34
34
  );
35
35
 
36
36
  const response = await axios.get(
@@ -75,7 +75,7 @@ const getWeatherForecastConfig: ToolConfig = {
75
75
  pricing: { pricePerUse: 0, currency: "USD" },
76
76
  handler: async ({ latitude, longitude }, agentInfo) => {
77
77
  console.log(
78
- `Agent ${agentInfo.agentId} requested forecast at ${latitude},${longitude}`
78
+ `User / Agent ${agentInfo.id} requested forecast at ${latitude},${longitude}`
79
79
  );
80
80
 
81
81
  const response = await axios.get(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dainprotocol/cli",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "CLI for Dain Protocol",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -30,7 +30,7 @@ const getWeatherConfig: ToolConfig = {
30
30
  pricing: { pricePerUse: 0, currency: "USD" },
31
31
  handler: async ({ latitude, longitude }, agentInfo) => {
32
32
  console.log(
33
- `Agent ${agentInfo.agentId} requested weather at ${latitude},${longitude}`
33
+ `User / Agent ${agentInfo.id} requested weather at ${latitude},${longitude}`
34
34
  );
35
35
 
36
36
  const response = await axios.get(
@@ -75,7 +75,7 @@ const getWeatherForecastConfig: ToolConfig = {
75
75
  pricing: { pricePerUse: 0, currency: "USD" },
76
76
  handler: async ({ latitude, longitude }, agentInfo) => {
77
77
  console.log(
78
- `Agent ${agentInfo.agentId} requested forecast at ${latitude},${longitude}`
78
+ `User / Agent ${agentInfo.id} requested forecast at ${latitude},${longitude}`
79
79
  );
80
80
 
81
81
  const response = await axios.get(