@powerhousedao/ph-clint-cli 0.1.0-dev.40 → 0.1.0-dev.42
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/dist/codegen/actions.js +15 -0
- package/dist/codegen/builders/cli-package-json.js +0 -3
- package/dist/codegen/builders/cli-ts.js +7 -9
- package/dist/codegen/builders/manifest-json.js +1 -1
- package/dist/codegen/builders/root-package-json.js +1 -4
- package/dist/commands/clint-project-init.d.ts +1 -3
- package/dist/commands/clint-project-init.js +3 -11
- package/dist/spec/from-document.js +1 -1
- package/dist/spec/types.d.ts +1 -1
- package/dist/spec/types.js +2 -2
- package/package.json +4 -4
package/dist/codegen/actions.js
CHANGED
|
@@ -149,12 +149,22 @@ export async function collectPostGenActions(result, spec) {
|
|
|
149
149
|
actions.push({ kind: 'app-install', dir: result.appDir });
|
|
150
150
|
}
|
|
151
151
|
if (ei <= actionIndex('app-build')) {
|
|
152
|
+
// Add install if not already in the list and node_modules is missing
|
|
153
|
+
if (!actions.some(a => a.kind === 'app-install') &&
|
|
154
|
+
!(await fileExists(path.join(result.appDir, 'node_modules')))) {
|
|
155
|
+
actions.push({ kind: 'app-install', dir: result.appDir });
|
|
156
|
+
}
|
|
152
157
|
actions.push({ kind: 'app-build', dir: result.appDir });
|
|
153
158
|
}
|
|
154
159
|
if (ei <= actionIndex('cli-install')) {
|
|
155
160
|
actions.push({ kind: 'cli-install', dir: result.cliDir });
|
|
156
161
|
}
|
|
157
162
|
if (ei <= actionIndex('cli-build')) {
|
|
163
|
+
// Add install if not already in the list and node_modules is missing
|
|
164
|
+
if (!actions.some(a => a.kind === 'cli-install') &&
|
|
165
|
+
!(await fileExists(path.join(result.cliDir, 'node_modules')))) {
|
|
166
|
+
actions.push({ kind: 'cli-install', dir: result.cliDir });
|
|
167
|
+
}
|
|
158
168
|
actions.push({ kind: 'cli-build', dir: result.cliDir });
|
|
159
169
|
}
|
|
160
170
|
}
|
|
@@ -164,6 +174,11 @@ export async function collectPostGenActions(result, spec) {
|
|
|
164
174
|
actions.push({ kind: 'cli-install', dir: result.cliDir });
|
|
165
175
|
}
|
|
166
176
|
if (ei <= actionIndex('cli-build')) {
|
|
177
|
+
// Add install if not already in the list and node_modules is missing
|
|
178
|
+
if (!actions.some(a => a.kind === 'cli-install') &&
|
|
179
|
+
!(await fileExists(path.join(result.cliDir, 'node_modules')))) {
|
|
180
|
+
actions.push({ kind: 'cli-install', dir: result.cliDir });
|
|
181
|
+
}
|
|
167
182
|
actions.push({ kind: 'cli-build', dir: result.cliDir });
|
|
168
183
|
}
|
|
169
184
|
}
|
|
@@ -95,9 +95,6 @@ export function buildCliPackageJson(spec) {
|
|
|
95
95
|
scripts['publish:staging'] = 'ph-publish staging -c ./publish.config.js';
|
|
96
96
|
scripts['publish:production'] = 'ph-publish production -c ./publish.config.js';
|
|
97
97
|
}
|
|
98
|
-
if (spec.deployment.serviceAnnouncement) {
|
|
99
|
-
scripts['test-service-registry'] = 'json-post-registry --withAuth';
|
|
100
|
-
}
|
|
101
98
|
const pkg = {
|
|
102
99
|
name: pkgName,
|
|
103
100
|
version: spec.version,
|
|
@@ -20,8 +20,7 @@ export function buildCliTs(spec) {
|
|
|
20
20
|
const phClintImports = ['defineCli'];
|
|
21
21
|
if (phAtLeast(ph, 'Reactor'))
|
|
22
22
|
phClintImports.push('buildDefaultReactor');
|
|
23
|
-
|
|
24
|
-
phClintImports.push('jsonPostAnnounce');
|
|
23
|
+
// proxy has no additional imports
|
|
25
24
|
lines.push(`import { ${phClintImports.join(', ')} } from '@powerhousedao/ph-clint';`);
|
|
26
25
|
if (needsRoot) {
|
|
27
26
|
lines.push("import path from 'node:path';");
|
|
@@ -39,9 +38,11 @@ export function buildCliTs(spec) {
|
|
|
39
38
|
lines.push('export const cli = defineCli({');
|
|
40
39
|
lines.push(' name: CLI_NAME,');
|
|
41
40
|
lines.push(' version: CLI_VERSION,');
|
|
41
|
+
lines.push(' // @clint:begin root');
|
|
42
42
|
if (phAtLeast(ph, 'Reactor')) {
|
|
43
43
|
lines.push(' root: CLI_ROOT,');
|
|
44
44
|
}
|
|
45
|
+
lines.push(' // @clint:end root');
|
|
45
46
|
lines.push(' description: `${CLI_NAME} v${CLI_VERSION}`,');
|
|
46
47
|
lines.push(' configSchema,');
|
|
47
48
|
lines.push(' secretsSchema,');
|
|
@@ -101,14 +102,11 @@ export function buildCliTs(spec) {
|
|
|
101
102
|
lines.push(' events: {},');
|
|
102
103
|
lines.push(' // @clint:end events');
|
|
103
104
|
lines.push('');
|
|
104
|
-
lines.push(' // @clint:begin
|
|
105
|
-
if (spec.deployment.
|
|
106
|
-
lines.push('
|
|
107
|
-
lines.push(' enabled: true,');
|
|
108
|
-
lines.push(' announce: (payload, ctx) => jsonPostAnnounce(payload, ctx),');
|
|
109
|
-
lines.push(' },');
|
|
105
|
+
lines.push(' // @clint:begin proxy');
|
|
106
|
+
if (spec.deployment.proxyEnabled) {
|
|
107
|
+
lines.push(' proxyEnabled: true,');
|
|
110
108
|
}
|
|
111
|
-
lines.push(' // @clint:end
|
|
109
|
+
lines.push(' // @clint:end proxy');
|
|
112
110
|
lines.push('');
|
|
113
111
|
lines.push(' // @clint:begin interactive');
|
|
114
112
|
lines.push(' interactive: {');
|
|
@@ -24,7 +24,7 @@ export function buildManifestJson(spec) {
|
|
|
24
24
|
type: 'clint-project',
|
|
25
25
|
features: { agent, powerhouse: ph },
|
|
26
26
|
serviceCommand: getBinName(spec),
|
|
27
|
-
|
|
27
|
+
proxyEnabled: spec.deployment.proxyEnabled,
|
|
28
28
|
supportedResources: spec.deployment.supportedResources,
|
|
29
29
|
};
|
|
30
30
|
return JSON.stringify(manifest, null, 2) + '\n';
|
|
@@ -14,7 +14,7 @@ export function buildRootPackageJson(spec) {
|
|
|
14
14
|
const both = (cmd) => `${prefix(app, cmd)} && ${prefix(cli, cmd)}`;
|
|
15
15
|
const connectEnabled = phAtLeast(spec.features.powerhouse, 'Connect');
|
|
16
16
|
const buildScript = connectEnabled
|
|
17
|
-
? `${prefix(app, 'build')} && ${prefix(app, 'connect
|
|
17
|
+
? `${prefix(app, 'build')} && ${prefix(app, 'connect build')} && ${prefix(cli, 'build')}`
|
|
18
18
|
: both('build');
|
|
19
19
|
const scripts = {
|
|
20
20
|
install: both('install'),
|
|
@@ -27,9 +27,6 @@ export function buildRootPackageJson(spec) {
|
|
|
27
27
|
'publish:staging': `${prefix(cli, 'exec ph-publish')} staging -c ../publish.config.js`,
|
|
28
28
|
'publish:production': `${prefix(cli, 'exec ph-publish')} production -c ../publish.config.js`,
|
|
29
29
|
};
|
|
30
|
-
if (spec.deployment.serviceAnnouncement) {
|
|
31
|
-
scripts['test-service-registry'] = prefix(cli, 'test-service-registry');
|
|
32
|
-
}
|
|
33
30
|
const pkg = {
|
|
34
31
|
name: getPackageName(spec),
|
|
35
32
|
version: spec.version,
|
|
@@ -8,7 +8,6 @@ declare const inputSchema: z.ZodObject<{
|
|
|
8
8
|
enableMastra: z.ZodDefault<z.ZodBoolean>;
|
|
9
9
|
enableRoutine: z.ZodDefault<z.ZodBoolean>;
|
|
10
10
|
force: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
-
skipPhInit: z.ZodDefault<z.ZodBoolean>;
|
|
12
11
|
skipInstall: z.ZodDefault<z.ZodBoolean>;
|
|
13
12
|
}, z.core.$strip>;
|
|
14
13
|
type InitInput = z.output<typeof inputSchema>;
|
|
@@ -21,7 +20,6 @@ export declare const init: import("@powerhousedao/ph-clint").Command<z.ZodObject
|
|
|
21
20
|
enableMastra: z.ZodDefault<z.ZodBoolean>;
|
|
22
21
|
enableRoutine: z.ZodDefault<z.ZodBoolean>;
|
|
23
22
|
force: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
-
skipPhInit: z.ZodDefault<z.ZodBoolean>;
|
|
25
23
|
skipInstall: z.ZodDefault<z.ZodBoolean>;
|
|
26
24
|
}, z.core.$strip>, {
|
|
27
25
|
text: string;
|
|
@@ -67,7 +65,7 @@ export declare const init: import("@powerhousedao/ph-clint").Command<z.ZodObject
|
|
|
67
65
|
githubUrl: string;
|
|
68
66
|
}[];
|
|
69
67
|
deployment: {
|
|
70
|
-
|
|
68
|
+
proxyEnabled: boolean;
|
|
71
69
|
supportedResources: string[];
|
|
72
70
|
};
|
|
73
71
|
scope?: string | undefined;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 3. Collect project identity + feature toggles (prompt for missing).
|
|
8
8
|
* 4. Assemble a ClintProjectSpec and validate with Zod.
|
|
9
9
|
* 5. Write the spec + emit the generated tree via `generateProject`.
|
|
10
|
-
* 6. (Split layout) run `ph init` in `{name}-app
|
|
10
|
+
* 6. (Split layout) run `ph init` in `{name}-app/`.
|
|
11
11
|
* 7. Run `pnpm install` in generated sub-projects unless `--skip-install`.
|
|
12
12
|
* 8. Print next-steps guidance.
|
|
13
13
|
*/
|
|
@@ -44,10 +44,6 @@ const inputSchema = z.object({
|
|
|
44
44
|
.boolean()
|
|
45
45
|
.default(false)
|
|
46
46
|
.describe('Overwrite files if the target directory is not empty'),
|
|
47
|
-
skipPhInit: z
|
|
48
|
-
.boolean()
|
|
49
|
-
.default(false)
|
|
50
|
-
.describe('Do not run `ph init` in the app folder after scaffolding'),
|
|
51
47
|
skipInstall: z
|
|
52
48
|
.boolean()
|
|
53
49
|
.default(false)
|
|
@@ -137,11 +133,10 @@ export const init = defineCommand({
|
|
|
137
133
|
}
|
|
138
134
|
}
|
|
139
135
|
// Run post-generation actions (ph-init, install, build, skills-sync).
|
|
136
|
+
// Only skip cli-install — in split layout, ph-init handles app install
|
|
137
|
+
// internally, and app-build must still run so the CLI can link to it.
|
|
140
138
|
const skip = new Set();
|
|
141
|
-
if (input.skipPhInit)
|
|
142
|
-
skip.add('ph-init');
|
|
143
139
|
if (input.skipInstall) {
|
|
144
|
-
skip.add('app-install');
|
|
145
140
|
skip.add('cli-install');
|
|
146
141
|
}
|
|
147
142
|
await runPostGenActions(result.pendingActions, {
|
|
@@ -156,9 +151,6 @@ export const init = defineCommand({
|
|
|
156
151
|
const relDir = path.relative(workdir, targetDir) || '.';
|
|
157
152
|
if (split) {
|
|
158
153
|
next.push(` cd ${relDir}`);
|
|
159
|
-
if (input.skipPhInit) {
|
|
160
|
-
next.push(` cd ${spec.name}-app && ph init . && cd ..`);
|
|
161
|
-
}
|
|
162
154
|
if (input.skipInstall) {
|
|
163
155
|
next.push(' pnpm install');
|
|
164
156
|
}
|
|
@@ -30,7 +30,7 @@ export function specFromDocumentState(state, meta) {
|
|
|
30
30
|
githubUrl: s.githubUrl,
|
|
31
31
|
})),
|
|
32
32
|
deployment: {
|
|
33
|
-
|
|
33
|
+
proxyEnabled: state.deployment.proxyEnabled,
|
|
34
34
|
supportedResources: [...state.deployment.supportedResources],
|
|
35
35
|
},
|
|
36
36
|
documentId: meta?.documentId,
|
package/dist/spec/types.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ export declare const clintProjectSpecSchema: z.ZodObject<{
|
|
|
90
90
|
githubUrl: z.ZodString;
|
|
91
91
|
}, z.core.$strip>>>;
|
|
92
92
|
deployment: z.ZodDefault<z.ZodObject<{
|
|
93
|
-
|
|
93
|
+
proxyEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
94
94
|
supportedResources: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
95
95
|
}, z.core.$strip>>;
|
|
96
96
|
documentId: z.ZodOptional<z.ZodString>;
|
package/dist/spec/types.js
CHANGED
|
@@ -103,9 +103,9 @@ export const clintProjectSpecSchema = z.object({
|
|
|
103
103
|
*/
|
|
104
104
|
externalSkills: z.array(externalSkillSchema).default([]),
|
|
105
105
|
deployment: z.object({
|
|
106
|
-
|
|
106
|
+
proxyEnabled: z.boolean().default(false),
|
|
107
107
|
supportedResources: z.array(z.string()).default([]),
|
|
108
|
-
}).default({
|
|
108
|
+
}).default({ proxyEnabled: false, supportedResources: [] }),
|
|
109
109
|
/** ID of the source specification document (if backed by a Powerhouse document). */
|
|
110
110
|
documentId: z.string().optional(),
|
|
111
111
|
/** Document type of the source specification document. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/ph-clint-cli",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.42",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@mastra/core": "^1.22.0",
|
|
30
30
|
"@mastra/libsql": "^1.7.4",
|
|
31
31
|
"@mastra/memory": "^1.13.1",
|
|
32
|
-
"@powerhousedao/ph-clint": "^0.1.0-dev.
|
|
33
|
-
"@powerhousedao/ph-clint-app": "^0.1.0-dev.
|
|
34
|
-
"@powerhousedao/ph-clint-dev": "^0.1.0-dev.
|
|
32
|
+
"@powerhousedao/ph-clint": "^0.1.0-dev.42",
|
|
33
|
+
"@powerhousedao/ph-clint-app": "^0.1.0-dev.42",
|
|
34
|
+
"@powerhousedao/ph-clint-dev": "^0.1.0-dev.42",
|
|
35
35
|
"@powerhousedao/reactor": "6.0.0-dev.170",
|
|
36
36
|
"@powerhousedao/reactor-api": "6.0.0-dev.170",
|
|
37
37
|
"@powerhousedao/shared": "6.0.0-dev.170",
|