@output.ai/cli 0.5.5 → 0.5.6-dev.pr193.c8803e6

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.
@@ -91,15 +91,35 @@ function handleInitError(error, projectPath) {
91
91
  errorMessage: 'Folder already exists'
92
92
  };
93
93
  }
94
+ const pathSuffix = projectPath ? ` at ${projectPath}` : '';
94
95
  if (errorCode === 'EACCES') {
95
96
  return {
96
97
  shouldCleanup: projectPath !== null,
97
- errorMessage: 'Permission denied'
98
+ errorMessage: `Permission denied${pathSuffix}`
98
99
  };
99
100
  }
101
+ if (errorCode === 'ENOSPC') {
102
+ return {
103
+ shouldCleanup: projectPath !== null,
104
+ errorMessage: `Not enough disk space${pathSuffix}`
105
+ };
106
+ }
107
+ if (errorCode === 'EPERM') {
108
+ return {
109
+ shouldCleanup: projectPath !== null,
110
+ errorMessage: `Operation not permitted${pathSuffix}`
111
+ };
112
+ }
113
+ if (errorCode === 'ENOENT') {
114
+ return {
115
+ shouldCleanup: projectPath !== null,
116
+ errorMessage: `Required file or directory not found${pathSuffix}`
117
+ };
118
+ }
119
+ const originalMessage = error instanceof Error ? error.message : String(error);
100
120
  return {
101
121
  shouldCleanup: projectPath !== null,
102
- errorMessage: 'Failed to create project'
122
+ errorMessage: `Failed to create project${pathSuffix}: ${originalMessage}`
103
123
  };
104
124
  }
105
125
  export async function runInit(log, _warn, skipEnv = false) {
@@ -33,11 +33,19 @@ describe('project_scaffold', () => {
33
33
  expect(result.errorMessage).toBe(error.message);
34
34
  expect(result.shouldCleanup).toBe(false);
35
35
  });
36
- it('should return error message for generic errors', async () => {
36
+ it('should return error message for generic errors including original message', async () => {
37
37
  const error = new Error('Unknown error');
38
38
  const warn = vi.fn();
39
39
  const result = await handleRunInitError(error, warn);
40
- expect(result.errorMessage).toBe('Failed to create project');
40
+ expect(result.errorMessage).toBe('Failed to create project: Unknown error');
41
+ });
42
+ it('should include project path in error message when available', async () => {
43
+ const error = new Error('npm install failed');
44
+ error.projectPath = '/Users/test/my-project';
45
+ const warn = vi.fn();
46
+ const result = await handleRunInitError(error, warn);
47
+ expect(result.errorMessage).toBe('Failed to create project at /Users/test/my-project: npm install failed');
48
+ expect(result.projectPath).toBe('/Users/test/my-project');
41
49
  });
42
50
  });
43
51
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@output.ai/cli",
3
- "version": "0.5.5",
3
+ "version": "0.5.6-dev.pr193.c8803e6",
4
4
  "description": "CLI for Output.ai workflow generation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,6 +27,7 @@
27
27
  "@oclif/plugin-help": "6.2.33",
28
28
  "@oclif/plugin-plugins": "5.4.50",
29
29
  "@output.ai/llm": ">=0.0.1",
30
+ "@output.ai/http": ">=0.0.1",
30
31
  "change-case": "5.4.4",
31
32
  "cli-progress": "3.12.0",
32
33
  "cli-table3": "0.6.5",