refineo-cli 0.1.1 → 0.1.4

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/README.md CHANGED
@@ -49,6 +49,7 @@ refineo humanize "text" --model enhanced # Use enhanced model (default)
49
49
  refineo humanize "text" --model standard # Use standard model
50
50
  refineo humanize --file input.txt # Read from file
51
51
  refineo humanize --file input.txt --output output.txt # Write to file
52
+ refineo humanize "text" --verbose # Show debug output
52
53
  echo "text" | refineo humanize # Read from stdin
53
54
  ```
54
55
 
package/dist/cjs/api.js CHANGED
@@ -74,9 +74,11 @@ function getPlatformInfo() {
74
74
 
75
75
  // src/api.ts
76
76
  var USER_AGENT = getPlatformInfo();
77
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
77
+ function isDebug() {
78
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
79
+ }
78
80
  function debug(...args) {
79
- if (DEBUG) {
81
+ if (isDebug()) {
80
82
  console.error("[refineo-debug]", ...args);
81
83
  }
82
84
  }
@@ -121,7 +123,14 @@ async function apiRequest(path, options = {}) {
121
123
  } catch {
122
124
  error = { error: errorText || "Unknown error" };
123
125
  }
124
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
126
+ let errorMessage = "";
127
+ if (Array.isArray(error.details) && error.details.length > 0) {
128
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
129
+ }
130
+ if (!errorMessage) {
131
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
132
+ }
133
+ throw new Error(errorMessage);
125
134
  }
126
135
  return response.json();
127
136
  }
package/dist/cjs/cli.js CHANGED
@@ -81,9 +81,11 @@ function getPlatformInfo() {
81
81
 
82
82
  // src/api.ts
83
83
  var USER_AGENT = getPlatformInfo();
84
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
84
+ function isDebug() {
85
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
86
+ }
85
87
  function debug(...args) {
86
- if (DEBUG) {
88
+ if (isDebug()) {
87
89
  console.error("[refineo-debug]", ...args);
88
90
  }
89
91
  }
@@ -128,7 +130,14 @@ async function apiRequest(path, options = {}) {
128
130
  } catch {
129
131
  error = { error: errorText || "Unknown error" };
130
132
  }
131
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
133
+ let errorMessage = "";
134
+ if (Array.isArray(error.details) && error.details.length > 0) {
135
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
136
+ }
137
+ if (!errorMessage) {
138
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
139
+ }
140
+ throw new Error(errorMessage);
132
141
  }
133
142
  return response.json();
134
143
  }
@@ -258,7 +267,7 @@ async function getUsage() {
258
267
  }
259
268
 
260
269
  // src/cli.ts
261
- var VERSION = "0.1.0";
270
+ var VERSION = "0.1.4";
262
271
  var colors = {
263
272
  reset: "\x1B[0m",
264
273
  bold: "\x1B[1m",
@@ -386,6 +395,7 @@ async function humanizeCommand(args) {
386
395
  let model = "enhanced";
387
396
  let inputFile = "";
388
397
  let outputFile = "";
398
+ let verbose = false;
389
399
  for (let i = 0; i < args.length; i++) {
390
400
  const arg = args[i];
391
401
  if (arg === "--model" || arg === "-m") {
@@ -400,10 +410,15 @@ async function humanizeCommand(args) {
400
410
  inputFile = args[++i];
401
411
  } else if (arg === "--output" || arg === "-o") {
402
412
  outputFile = args[++i];
413
+ } else if (arg === "--verbose" || arg === "-v") {
414
+ verbose = true;
403
415
  } else if (!arg.startsWith("-")) {
404
416
  text = arg;
405
417
  }
406
418
  }
419
+ if (verbose) {
420
+ process.env.REFINEO_DEBUG = "1";
421
+ }
407
422
  if (inputFile) {
408
423
  if (!(0, import_fs2.existsSync)(inputFile)) {
409
424
  printError(`File not found: ${inputFile}`);
@@ -458,6 +473,7 @@ ${colors.bold}Humanize Options:${colors.reset}
458
473
  -m, --model <model> Model: "standard" or "enhanced" (default: enhanced)
459
474
  -f, --file <path> Read input from file
460
475
  -o, --output <path> Write output to file
476
+ -v, --verbose Show debug output
461
477
 
462
478
  ${colors.bold}Examples:${colors.reset}
463
479
  ${colors.dim}# Login to your account${colors.reset}
package/dist/cjs/index.js CHANGED
@@ -88,9 +88,11 @@ function getPlatformInfo() {
88
88
 
89
89
  // src/api.ts
90
90
  var USER_AGENT = getPlatformInfo();
91
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
91
+ function isDebug() {
92
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
93
+ }
92
94
  function debug(...args) {
93
- if (DEBUG) {
95
+ if (isDebug()) {
94
96
  console.error("[refineo-debug]", ...args);
95
97
  }
96
98
  }
@@ -135,7 +137,14 @@ async function apiRequest(path, options = {}) {
135
137
  } catch {
136
138
  error = { error: errorText || "Unknown error" };
137
139
  }
138
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
140
+ let errorMessage = "";
141
+ if (Array.isArray(error.details) && error.details.length > 0) {
142
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
143
+ }
144
+ if (!errorMessage) {
145
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
146
+ }
147
+ throw new Error(errorMessage);
139
148
  }
140
149
  return response.json();
141
150
  }
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAGlB,cAAc,EACd,UAAU,EACX,MAAM,YAAY,CAAC;AAuHpB;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAcvE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,OAAO,CAAC,WAAW,CAAC,CA8DtB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,UAAU,GAAG,UAAuB,GAC1C,OAAO,CAAC,cAAc,CAAC,CAqBzB;AAED;;GAEG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,CAoBpD"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAGlB,cAAc,EACd,UAAU,EACX,MAAM,YAAY,CAAC;AAmIpB;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAcvE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,OAAO,CAAC,WAAW,CAAC,CA8DtB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,UAAU,GAAG,UAAuB,GAC1C,OAAO,CAAC,cAAc,CAAC,CAqBzB;AAED;;GAEG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC,CAoBpD"}
package/dist/esm/api.js CHANGED
@@ -45,9 +45,11 @@ function getPlatformInfo() {
45
45
 
46
46
  // src/api.ts
47
47
  var USER_AGENT = getPlatformInfo();
48
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
48
+ function isDebug() {
49
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
50
+ }
49
51
  function debug(...args) {
50
- if (DEBUG) {
52
+ if (isDebug()) {
51
53
  console.error("[refineo-debug]", ...args);
52
54
  }
53
55
  }
@@ -92,7 +94,14 @@ async function apiRequest(path, options = {}) {
92
94
  } catch {
93
95
  error = { error: errorText || "Unknown error" };
94
96
  }
95
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
97
+ let errorMessage = "";
98
+ if (Array.isArray(error.details) && error.details.length > 0) {
99
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
100
+ }
101
+ if (!errorMessage) {
102
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
103
+ }
104
+ throw new Error(errorMessage);
96
105
  }
97
106
  return response.json();
98
107
  }
package/dist/esm/cli.js CHANGED
@@ -58,9 +58,11 @@ function getPlatformInfo() {
58
58
 
59
59
  // src/api.ts
60
60
  var USER_AGENT = getPlatformInfo();
61
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
61
+ function isDebug() {
62
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
63
+ }
62
64
  function debug(...args) {
63
- if (DEBUG) {
65
+ if (isDebug()) {
64
66
  console.error("[refineo-debug]", ...args);
65
67
  }
66
68
  }
@@ -105,7 +107,14 @@ async function apiRequest(path, options = {}) {
105
107
  } catch {
106
108
  error = { error: errorText || "Unknown error" };
107
109
  }
108
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
110
+ let errorMessage = "";
111
+ if (Array.isArray(error.details) && error.details.length > 0) {
112
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
113
+ }
114
+ if (!errorMessage) {
115
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
116
+ }
117
+ throw new Error(errorMessage);
109
118
  }
110
119
  return response.json();
111
120
  }
@@ -235,7 +244,7 @@ async function getUsage() {
235
244
  }
236
245
 
237
246
  // src/cli.ts
238
- var VERSION = "0.1.0";
247
+ var VERSION = "0.1.4";
239
248
  var colors = {
240
249
  reset: "\x1B[0m",
241
250
  bold: "\x1B[1m",
@@ -363,6 +372,7 @@ async function humanizeCommand(args) {
363
372
  let model = "enhanced";
364
373
  let inputFile = "";
365
374
  let outputFile = "";
375
+ let verbose = false;
366
376
  for (let i = 0; i < args.length; i++) {
367
377
  const arg = args[i];
368
378
  if (arg === "--model" || arg === "-m") {
@@ -377,10 +387,15 @@ async function humanizeCommand(args) {
377
387
  inputFile = args[++i];
378
388
  } else if (arg === "--output" || arg === "-o") {
379
389
  outputFile = args[++i];
390
+ } else if (arg === "--verbose" || arg === "-v") {
391
+ verbose = true;
380
392
  } else if (!arg.startsWith("-")) {
381
393
  text = arg;
382
394
  }
383
395
  }
396
+ if (verbose) {
397
+ process.env.REFINEO_DEBUG = "1";
398
+ }
384
399
  if (inputFile) {
385
400
  if (!existsSync2(inputFile)) {
386
401
  printError(`File not found: ${inputFile}`);
@@ -435,6 +450,7 @@ ${colors.bold}Humanize Options:${colors.reset}
435
450
  -m, --model <model> Model: "standard" or "enhanced" (default: enhanced)
436
451
  -f, --file <path> Read input from file
437
452
  -o, --output <path> Write output to file
453
+ -v, --verbose Show debug output
438
454
 
439
455
  ${colors.bold}Examples:${colors.reset}
440
456
  ${colors.dim}# Login to your account${colors.reset}
package/dist/esm/index.js CHANGED
@@ -53,9 +53,11 @@ function getPlatformInfo() {
53
53
 
54
54
  // src/api.ts
55
55
  var USER_AGENT = getPlatformInfo();
56
- var DEBUG = process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
56
+ function isDebug() {
57
+ return process.env.REFINEO_DEBUG === "1" || process.env.REFINEO_DEBUG === "true";
58
+ }
57
59
  function debug(...args) {
58
- if (DEBUG) {
60
+ if (isDebug()) {
59
61
  console.error("[refineo-debug]", ...args);
60
62
  }
61
63
  }
@@ -100,7 +102,14 @@ async function apiRequest(path, options = {}) {
100
102
  } catch {
101
103
  error = { error: errorText || "Unknown error" };
102
104
  }
103
- throw new Error(error.message || error.error_description || error.error || `HTTP ${response.status}`);
105
+ let errorMessage = "";
106
+ if (Array.isArray(error.details) && error.details.length > 0) {
107
+ errorMessage = error.details.map((d) => d.message).filter(Boolean).join("; ");
108
+ }
109
+ if (!errorMessage) {
110
+ errorMessage = error.message || error.error_description || error.error || `HTTP ${response.status}`;
111
+ }
112
+ throw new Error(errorMessage);
104
113
  }
105
114
  return response.json();
106
115
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "refineo-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "Refineo AI Text Humanizer CLI - Transform AI-generated text into natural human writing",
5
5
  "type": "module",
6
6
  "main": "./dist/esm/index.js",
7
7
  "module": "./dist/esm/index.js",
8
8
  "types": "./dist/esm/index.d.ts",
9
9
  "bin": {
10
- "refineo": "./dist/esm/cli.js"
10
+ "refineo": "dist/esm/cli.js"
11
11
  },
12
12
  "exports": {
13
13
  ".": {
@@ -45,6 +45,10 @@
45
45
  "author": "Refineo",
46
46
  "license": "MIT",
47
47
  "homepage": "https://www.refineo.app",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/DADAExperiments/refineo-ai-tools.git"
51
+ },
48
52
  "engines": {
49
53
  "node": ">=18.0.0"
50
54
  },