natureco-cli 5.18.1 → 5.18.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "5.18.1",
3
+ "version": "5.18.3",
4
4
  "description": "OpenClaw'dan daha güvenli, daha hızlı, daha ucuz AI agent CLI. Multi-agent, self-evolving skills, audit log, maliyet optimizasyonu ve NatureCo platform-native.",
5
5
  "bin": {
6
6
  "natureco": "bin/natureco.js"
@@ -32,7 +32,8 @@ function apiRequest(method, endpoint, body) {
32
32
  const apiKey = getApiKey();
33
33
  if (!apiKey) return reject(new Error('BROWSER_USE_API_KEY gerekli. Sign up: https://cloud.browser-use.com'));
34
34
 
35
- const url = new URL(endpoint, BASE_URL);
35
+ const fullUrl = BASE_URL + (endpoint.startsWith('/') ? endpoint : '/' + endpoint);
36
+ const url = new URL(fullUrl);
36
37
  const options = {
37
38
  method,
38
39
  hostname: url.hostname,
@@ -93,17 +94,19 @@ async function handleApiAction(params) {
93
94
  for (let i = 0; i < 60; i++) {
94
95
  await new Promise(r => setTimeout(r, 2000));
95
96
  const status = await apiRequest('GET', '/sessions/' + sessionId);
96
- if (status.status === 'completed' || status.status === 'finished' || status.data?.status === 'completed') {
97
+ if (status.status === 'completed' || status.status === 'finished' || status.status === 'stopped' || status.data?.status === 'completed') {
97
98
  return {
98
- success: true,
99
+ success: status.isTaskSuccessful !== false,
99
100
  mode: 'api',
100
101
  sessionId,
101
- result: status.result || status.data?.result || status,
102
- summary: status.summary || status.data?.summary || '',
102
+ result: status.output || status.result || status.data?.result || status,
103
+ summary: status.lastStepSummary || status.summary || status.data?.summary || '',
103
104
  steps: status.steps || status.data?.steps || [],
105
+ screenshotUrl: status.screenshotUrl || null,
106
+ liveUrl: status.liveUrl || null,
104
107
  };
105
108
  }
106
- if (status.status === 'failed' || status.status === 'error') {
109
+ if (status.status === 'failed' || status.status === 'error' || status.status === 'cancelled') {
107
110
  return { success: false, error: 'Session failed: ' + JSON.stringify(status.error || status) };
108
111
  }
109
112
  }