@porchestra/cli 1.0.0 → 1.0.2
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/bin/porchestra.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1666 -0
- package/dist/index.js.map +1 -0
- package/package.json +11 -1
- package/src/agents/testPrompt/ast.json +0 -71
- package/src/agents/testPrompt/config.ts +0 -18
- package/src/agents/testPrompt/index.ts +0 -64
- package/src/agents/testPrompt/schemas.ts +0 -45
- package/src/agents/testPrompt/tools.ts +0 -88
- package/src/commands/agents.ts +0 -173
- package/src/commands/config.ts +0 -97
- package/src/commands/explore.ts +0 -160
- package/src/commands/login.ts +0 -101
- package/src/commands/logout.ts +0 -52
- package/src/commands/pull.ts +0 -220
- package/src/commands/status.ts +0 -78
- package/src/commands/whoami.ts +0 -56
- package/src/core/api/client.ts +0 -133
- package/src/core/auth/auth-service.ts +0 -176
- package/src/core/auth/token-manager.ts +0 -47
- package/src/core/config/config-manager.ts +0 -107
- package/src/core/config/config-schema.ts +0 -56
- package/src/core/config/project-tracker.ts +0 -158
- package/src/core/generators/code-generator.ts +0 -329
- package/src/core/generators/schema-generator.ts +0 -59
- package/src/index.ts +0 -85
- package/src/types/index.ts +0 -214
- package/src/utils/date.ts +0 -23
- package/src/utils/errors.ts +0 -38
- package/src/utils/logger.ts +0 -11
- package/src/utils/path-utils.ts +0 -47
- package/tests/unit/config-manager.test.ts +0 -74
- package/tests/unit/config-schema.test.ts +0 -61
- package/tests/unit/path-utils.test.ts +0 -53
- package/tests/unit/schema-generator.test.ts +0 -82
- package/tsconfig.json +0 -30
- package/tsup.config.ts +0 -19
- package/vitest.config.ts +0 -20
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { jsonSchemaToZod } from '../../src/core/generators/schema-generator.js';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
describe('schema-generator', () => {
|
|
6
|
-
it('should convert string schema', () => {
|
|
7
|
-
const schema = { type: 'string' };
|
|
8
|
-
const result = jsonSchemaToZod(schema);
|
|
9
|
-
expect(() => result.parse('hello')).not.toThrow();
|
|
10
|
-
expect(() => result.parse(123)).toThrow();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should convert number schema', () => {
|
|
14
|
-
const schema = { type: 'number' };
|
|
15
|
-
const result = jsonSchemaToZod(schema);
|
|
16
|
-
expect(() => result.parse(42)).not.toThrow();
|
|
17
|
-
expect(() => result.parse('hello')).toThrow();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should convert boolean schema', () => {
|
|
21
|
-
const schema = { type: 'boolean' };
|
|
22
|
-
const result = jsonSchemaToZod(schema);
|
|
23
|
-
expect(() => result.parse(true)).not.toThrow();
|
|
24
|
-
expect(() => result.parse('true')).toThrow();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('should convert array schema', () => {
|
|
28
|
-
const schema = {
|
|
29
|
-
type: 'array',
|
|
30
|
-
items: { type: 'string' }
|
|
31
|
-
};
|
|
32
|
-
const result = jsonSchemaToZod(schema);
|
|
33
|
-
expect(() => result.parse(['a', 'b'])).not.toThrow();
|
|
34
|
-
expect(() => result.parse([1, 2])).toThrow();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should convert object schema', () => {
|
|
38
|
-
const schema = {
|
|
39
|
-
type: 'object',
|
|
40
|
-
properties: {
|
|
41
|
-
name: { type: 'string' },
|
|
42
|
-
age: { type: 'number' }
|
|
43
|
-
},
|
|
44
|
-
required: ['name']
|
|
45
|
-
};
|
|
46
|
-
const result = jsonSchemaToZod(schema);
|
|
47
|
-
expect(() => result.parse({ name: 'John' })).not.toThrow();
|
|
48
|
-
expect(() => result.parse({ age: 30 })).toThrow();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should handle enum strings', () => {
|
|
52
|
-
const schema = {
|
|
53
|
-
type: 'string',
|
|
54
|
-
enum: ['red', 'green', 'blue']
|
|
55
|
-
};
|
|
56
|
-
const result = jsonSchemaToZod(schema);
|
|
57
|
-
expect(() => result.parse('red')).not.toThrow();
|
|
58
|
-
expect(() => result.parse('yellow')).toThrow();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('should handle nullable types', () => {
|
|
62
|
-
const schema = {
|
|
63
|
-
type: 'string',
|
|
64
|
-
nullable: true
|
|
65
|
-
};
|
|
66
|
-
const result = jsonSchemaToZod(schema);
|
|
67
|
-
expect(() => result.parse('hello')).not.toThrow();
|
|
68
|
-
expect(() => result.parse(null)).not.toThrow();
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('should handle min/max constraints', () => {
|
|
72
|
-
const schema = {
|
|
73
|
-
type: 'string',
|
|
74
|
-
minLength: 2,
|
|
75
|
-
maxLength: 10
|
|
76
|
-
};
|
|
77
|
-
const result = jsonSchemaToZod(schema);
|
|
78
|
-
expect(() => result.parse('hi')).not.toThrow();
|
|
79
|
-
expect(() => result.parse('a')).toThrow();
|
|
80
|
-
expect(() => result.parse('a'.repeat(20))).toThrow();
|
|
81
|
-
});
|
|
82
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"lib": ["ES2022"],
|
|
7
|
-
"paths": {
|
|
8
|
-
"@porchestra/core": ["../core/src/index.ts"],
|
|
9
|
-
"@porchestra/core/*": ["../core/src/*"]
|
|
10
|
-
},
|
|
11
|
-
"outDir": "./dist",
|
|
12
|
-
"rootDir": ".",
|
|
13
|
-
"strict": true,
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"skipLibCheck": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true,
|
|
17
|
-
"resolveJsonModule": true,
|
|
18
|
-
"declaration": true,
|
|
19
|
-
"declarationMap": true,
|
|
20
|
-
"sourceMap": true,
|
|
21
|
-
"noUnusedLocals": true,
|
|
22
|
-
"noUnusedParameters": true,
|
|
23
|
-
"noImplicitReturns": true,
|
|
24
|
-
"noFallthroughCasesInSwitch": true,
|
|
25
|
-
"isolatedModules": true,
|
|
26
|
-
"allowSyntheticDefaultImports": true
|
|
27
|
-
},
|
|
28
|
-
"include": ["src/**/*"],
|
|
29
|
-
"exclude": ["node_modules", "dist", "tests", "../**/*"]
|
|
30
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup';
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: ['src/index.ts'],
|
|
5
|
-
format: ['esm'],
|
|
6
|
-
target: 'node22',
|
|
7
|
-
platform: 'node',
|
|
8
|
-
bundle: true,
|
|
9
|
-
splitting: false,
|
|
10
|
-
sourcemap: true,
|
|
11
|
-
clean: true,
|
|
12
|
-
minify: false,
|
|
13
|
-
outDir: 'dist',
|
|
14
|
-
// No banner - shebang is in bin/porchestra.js instead
|
|
15
|
-
external: [],
|
|
16
|
-
loader: {
|
|
17
|
-
'.hbs': 'text'
|
|
18
|
-
}
|
|
19
|
-
});
|
package/vitest.config.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config';
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: true,
|
|
6
|
-
environment: 'node',
|
|
7
|
-
include: ['tests/**/*.{test,spec}.{js,ts}'],
|
|
8
|
-
coverage: {
|
|
9
|
-
provider: 'v8',
|
|
10
|
-
reporter: ['text', 'json', 'html'],
|
|
11
|
-
exclude: [
|
|
12
|
-
'node_modules/',
|
|
13
|
-
'dist/',
|
|
14
|
-
'tests/',
|
|
15
|
-
'**/*.d.ts',
|
|
16
|
-
'**/*.config.{js,ts}'
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
});
|