@powerhousedao/ph-clint-cli 0.1.0-dev.7 → 0.1.0-dev.71
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/cli.js +52 -10
- package/dist/codegen/actions.d.ts +1 -0
- package/dist/codegen/actions.js +1 -0
- package/dist/codegen/builders/agent-ts.d.ts +4 -4
- package/dist/codegen/builders/agent-ts.js +92 -2
- package/dist/codegen/builders/app-index-ts.d.ts +3 -10
- package/dist/codegen/builders/app-index-ts.js +30 -20
- package/dist/codegen/builders/cli-package-json.d.ts +1 -8
- package/dist/codegen/builders/cli-package-json.js +1 -96
- package/dist/codegen/builders/cli-ts.js +88 -37
- package/dist/codegen/builders/config-ts.d.ts +1 -1
- package/dist/codegen/builders/config-ts.js +2 -8
- package/dist/codegen/builders/demo-agent-ts.d.ts +8 -0
- package/dist/codegen/builders/demo-agent-ts.js +50 -0
- package/dist/codegen/builders/eslint-config-js.d.ts +1 -1
- package/dist/codegen/builders/eslint-config-js.js +7 -4
- package/dist/codegen/builders/framework-gen-ts.d.ts +11 -6
- package/dist/codegen/builders/framework-gen-ts.js +73 -21
- package/dist/codegen/builders/framework-ts.js +33 -7
- package/dist/codegen/builders/index.d.ts +1 -44
- package/dist/codegen/builders/index.js +1 -61
- package/dist/codegen/builders/manifest-json.d.ts +6 -0
- package/dist/codegen/builders/manifest-json.js +31 -0
- package/dist/codegen/builders/mastra-index-ts.d.ts +3 -0
- package/dist/codegen/builders/mastra-index-ts.js +47 -5
- package/dist/codegen/builders/publish-config-js.d.ts +8 -0
- package/dist/codegen/builders/publish-config-js.js +33 -0
- package/dist/codegen/builders/publish-config-ts.d.ts +4 -2
- package/dist/codegen/builders/publish-config-ts.js +25 -11
- package/dist/codegen/builders/readme-md.js +7 -6
- package/dist/codegen/builders/root-package-json.js +14 -11
- package/dist/codegen/builders/smoke-test-ts.d.ts +2 -0
- package/dist/codegen/builders/smoke-test-ts.js +15 -0
- package/dist/codegen/exec.d.ts +1 -20
- package/dist/codegen/exec.js +1 -41
- package/dist/codegen/generated.d.ts +1 -0
- package/dist/codegen/generated.js +1 -0
- package/dist/codegen/hashes.d.ts +1 -6
- package/dist/codegen/hashes.js +1 -60
- package/dist/codegen/index.d.ts +8 -36
- package/dist/codegen/index.js +6 -293
- package/dist/codegen/markers.d.ts +1 -36
- package/dist/codegen/markers.js +1 -86
- package/dist/codegen/scaffold.d.ts +1 -34
- package/dist/codegen/scaffold.js +1 -60
- package/dist/codegen/write.d.ts +1 -6
- package/dist/codegen/write.js +1 -32
- package/dist/commands/clint-project-build.d.ts +63 -1
- package/dist/commands/clint-project-build.js +11 -28
- package/dist/commands/clint-project-init.d.ts +100 -10
- package/dist/commands/clint-project-init.js +63 -47
- package/dist/commands/clint-project-publish.d.ts +64 -1
- package/dist/commands/clint-project-publish.js +6 -4
- package/dist/commands/clint-project-regen.d.ts +63 -1
- package/dist/commands/clint-project-regen.js +26 -2
- package/dist/commands/clint-skills-sync.d.ts +72 -0
- package/dist/commands/clint-skills-sync.js +56 -0
- package/dist/framework.d.ts +228 -50
- package/dist/framework.gen.d.ts +34 -8
- package/dist/framework.js +1 -5
- package/{prompts/agent-profiles/AgentBase.md → dist/gen/agent-profiles/PhClintDevAgent.md} +1 -1
- package/dist/gen/skills/cli-setup/.cli-docs.md +135 -0
- package/dist/gen/skills/cli-setup/SKILL.md +125 -0
- package/dist/gen/skills/cli-setup/references/00.assess-cli-needs.md +53 -0
- package/dist/gen/skills/cli-setup/references/01.define-config-schema.md +78 -0
- package/dist/gen/skills/cli-setup/references/02.wire-cli.md +141 -0
- package/dist/gen/skills/cli-setup/references/03.add-entrypoint.md +128 -0
- package/dist/gen/skills/cli-setup/references/expected-outcome.md +3 -0
- package/dist/gen/skills/command-definition/.cli-docs.md +84 -0
- package/dist/gen/skills/command-definition/SKILL.md +99 -0
- package/dist/gen/skills/command-definition/references/00.assess-requirements.md +58 -0
- package/dist/gen/skills/command-definition/references/01.define-schema.md +72 -0
- package/dist/gen/skills/command-definition/references/02.implement-execute.md +118 -0
- package/dist/gen/skills/command-definition/references/03.add-prompting.md +54 -0
- package/dist/gen/skills/command-definition/references/expected-outcome.md +3 -0
- package/dist/gen/skills/service-definition/.cli-docs.md +214 -0
- package/dist/gen/skills/service-definition/SKILL.md +148 -0
- package/dist/gen/skills/service-definition/references/00.assess-service.md +69 -0
- package/dist/gen/skills/service-definition/references/01.define-service.md +166 -0
- package/dist/gen/skills/service-definition/references/02.add-preflight.md +132 -0
- package/dist/gen/skills/service-definition/references/03.add-project-scanner.md +82 -0
- package/dist/gen/skills/service-definition/references/04.wire-events.md +120 -0
- package/dist/gen/skills/service-definition/references/expected-outcome.md +3 -0
- package/dist/services/clint-project.js +21 -0
- package/dist/skills/sync.d.ts +1 -0
- package/dist/skills/sync.js +1 -0
- package/dist/spec/ensure-document.d.ts +17 -0
- package/dist/spec/ensure-document.js +56 -0
- package/dist/spec/file.d.ts +1 -4
- package/dist/spec/file.js +1 -34
- package/dist/spec/from-document.d.ts +4 -1
- package/dist/spec/from-document.js +4 -16
- package/dist/spec/types.d.ts +1 -62
- package/dist/spec/types.js +1 -112
- package/dist/triggers/publish-trigger.d.ts +67 -0
- package/dist/triggers/publish-trigger.js +137 -0
- package/dist/triggers/spec-change.d.ts +46 -18
- package/dist/triggers/spec-change.js +138 -102
- package/package.json +12 -17
- package/prompts/skills-ext/.gitkeep +0 -0
- package/prompts/skills-tpl/.gitkeep +0 -0
|
@@ -2,27 +2,28 @@
|
|
|
2
2
|
* `ph-clint clint-project-init` — the project bootstrap wizard.
|
|
3
3
|
*
|
|
4
4
|
* Behavior:
|
|
5
|
-
* 1. Resolve target dir (positional `dir`, defaults to
|
|
5
|
+
* 1. Resolve target dir (positional `dir`, defaults to the project name).
|
|
6
6
|
* 2. Assert it is empty (or `--force`).
|
|
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
|
*/
|
|
14
14
|
import path from 'node:path';
|
|
15
|
-
import { defineCommand } from '
|
|
15
|
+
import { defineCommand } from '../framework.js';
|
|
16
16
|
import { z } from 'zod';
|
|
17
17
|
import { clintProjectSpecSchema, } from '../spec/types.js';
|
|
18
18
|
import { generateProject } from '../codegen/index.js';
|
|
19
|
-
import { isDirEmptyEnough } from '
|
|
20
|
-
import {
|
|
19
|
+
import { isDirEmptyEnough } from '@powerhousedao/ph-clint-dev/codegen/write';
|
|
20
|
+
import { runPostGenActions } from '@powerhousedao/ph-clint-dev/codegen/actions';
|
|
21
|
+
import { ensureSpecDocument } from '../spec/ensure-document.js';
|
|
21
22
|
const inputSchema = z.object({
|
|
22
23
|
dir: z
|
|
23
24
|
.string()
|
|
24
25
|
.optional()
|
|
25
|
-
.describe('Target directory (defaults to the
|
|
26
|
+
.describe('Target directory (defaults to the project name)'),
|
|
26
27
|
name: z
|
|
27
28
|
.string()
|
|
28
29
|
.describe('Project name — bare, or `@scope/name`. Lowercase letters, digits, hyphens.'),
|
|
@@ -39,47 +40,64 @@ const inputSchema = z.object({
|
|
|
39
40
|
.boolean()
|
|
40
41
|
.default(false)
|
|
41
42
|
.describe('Enable the tick-based routine loop'),
|
|
42
|
-
|
|
43
|
+
enableObservability: z
|
|
43
44
|
.boolean()
|
|
44
45
|
.default(false)
|
|
45
|
-
.describe('
|
|
46
|
-
|
|
46
|
+
.describe('Wire @powerhousedao/ph-clint-observability into the generated CLI. ' +
|
|
47
|
+
'The generated CLI will ask its end-user for telemetry consent on first run.'),
|
|
48
|
+
force: z
|
|
47
49
|
.boolean()
|
|
48
50
|
.default(false)
|
|
49
|
-
.describe('
|
|
51
|
+
.describe('Overwrite files if the target directory is not empty'),
|
|
50
52
|
skipInstall: z
|
|
51
53
|
.boolean()
|
|
52
54
|
.default(false)
|
|
53
55
|
.describe('Do not run `pnpm install` after scaffolding'),
|
|
54
56
|
});
|
|
55
|
-
/** Parse `@scope/name` into { scope, name }. */
|
|
57
|
+
/** Parse `@scope/name` into { scope, name }. Auto-appends `-cli` if missing. */
|
|
56
58
|
function splitPackageName(raw) {
|
|
57
59
|
const match = /^@([a-z0-9][a-z0-9-]*)\/([a-z0-9][a-z0-9-]*)$/.exec(raw);
|
|
58
|
-
if (match)
|
|
59
|
-
|
|
60
|
+
if (match) {
|
|
61
|
+
const name = match[2].endsWith('-cli') ? match[2] : `${match[2]}-cli`;
|
|
62
|
+
return { scope: `@${match[1]}`, name };
|
|
63
|
+
}
|
|
60
64
|
if (raw.startsWith('@')) {
|
|
61
65
|
throw new Error(`invalid package name "${raw}" — expected "@scope/name" with lowercase letters, digits, hyphens`);
|
|
62
66
|
}
|
|
63
67
|
if (!/^[a-z0-9][a-z0-9-]*$/.test(raw)) {
|
|
64
68
|
throw new Error(`invalid project name "${raw}" — expected lowercase letters, digits, hyphens`);
|
|
65
69
|
}
|
|
66
|
-
|
|
70
|
+
const name = raw.endsWith('-cli') ? raw : `${raw}-cli`;
|
|
71
|
+
return { name };
|
|
67
72
|
}
|
|
68
73
|
export function buildSpec(input) {
|
|
69
74
|
const { scope, name } = splitPackageName(input.name);
|
|
70
75
|
// Routine is forced on when Mastra is on — the REPL-only path works, but
|
|
71
76
|
// the agent routine loop is what most users actually want.
|
|
72
77
|
const routine = input.enableRoutine || input.enableMastra;
|
|
78
|
+
const baseName = name.replace(/-cli$/, '');
|
|
79
|
+
const mastra = input.enableMastra
|
|
80
|
+
? {
|
|
81
|
+
enabled: true,
|
|
82
|
+
agentId: `${baseName}-agent`,
|
|
83
|
+
agentName: `${baseName.charAt(0).toUpperCase()}${baseName.slice(1).replace(/-(\w)/g, (_, c) => ' ' + c.toUpperCase())} Agent`,
|
|
84
|
+
models: [{ id: 'anthropic/claude-sonnet-4-5', isDefault: true }],
|
|
85
|
+
profiles: [{ id: 'base', title: 'Base', content: 'You are a helpful assistant.' }],
|
|
86
|
+
}
|
|
87
|
+
: { enabled: false };
|
|
73
88
|
const candidate = {
|
|
74
89
|
name,
|
|
75
90
|
scope,
|
|
76
91
|
description: input.description ?? '',
|
|
77
92
|
features: {
|
|
78
|
-
powerhouse:
|
|
79
|
-
mastra
|
|
93
|
+
powerhouse: input.enablePowerhouse ? 'Connect' : 'Disabled',
|
|
94
|
+
mastra,
|
|
80
95
|
routine: { enabled: routine },
|
|
81
96
|
},
|
|
82
97
|
};
|
|
98
|
+
if (input.enableObservability) {
|
|
99
|
+
candidate.deployment = { observabilityEnabled: true };
|
|
100
|
+
}
|
|
83
101
|
return clintProjectSpecSchema.parse(candidate);
|
|
84
102
|
}
|
|
85
103
|
export const init = defineCommand({
|
|
@@ -90,8 +108,9 @@ export const init = defineCommand({
|
|
|
90
108
|
promptForDefaults: true,
|
|
91
109
|
promptOptional: ['description'],
|
|
92
110
|
},
|
|
93
|
-
execute: async (input, { workdir, stdout }) => {
|
|
94
|
-
const
|
|
111
|
+
execute: async (input, { workdir, stdout, reactor: getReactor, folders, runProcess }) => {
|
|
112
|
+
const { name: bareName } = splitPackageName(input.name);
|
|
113
|
+
const targetDir = path.resolve(workdir, input.dir ?? bareName);
|
|
95
114
|
if (!input.force) {
|
|
96
115
|
const empty = await isDirEmptyEnough(targetDir);
|
|
97
116
|
if (!empty) {
|
|
@@ -109,44 +128,41 @@ export const init = defineCommand({
|
|
|
109
128
|
allowNonEmpty: input.force,
|
|
110
129
|
});
|
|
111
130
|
stdout(`Generated ${result.files.length} files in ${targetDir}\n`);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
stdout(`Note: \`ph init\` did not run — ${phResult.reason ?? 'see above'}.\n`);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// Dependency installation.
|
|
126
|
-
if (!input.skipInstall) {
|
|
127
|
-
const dirs = [];
|
|
128
|
-
if (split) {
|
|
129
|
-
if (result.appDir)
|
|
130
|
-
dirs.push(result.appDir);
|
|
131
|
-
dirs.push(result.cliDir);
|
|
131
|
+
// Create spec document in personal drive (if reactor available)
|
|
132
|
+
if (getReactor && folders) {
|
|
133
|
+
try {
|
|
134
|
+
const reactor = await getReactor();
|
|
135
|
+
if (reactor) {
|
|
136
|
+
const { docId } = await ensureSpecDocument({
|
|
137
|
+
spec, targetDir, reactor, folders,
|
|
138
|
+
});
|
|
139
|
+
stdout(`Created spec document ${docId} in Clint Folders/specs/${spec.name}\n`);
|
|
140
|
+
}
|
|
132
141
|
}
|
|
133
|
-
|
|
134
|
-
|
|
142
|
+
catch (err) {
|
|
143
|
+
// Non-fatal — trigger will pick it up on next startup
|
|
144
|
+
stdout(`Note: could not create spec document — ${err instanceof Error ? err.message : String(err)}\n`);
|
|
135
145
|
}
|
|
136
|
-
await runPnpmInstall({
|
|
137
|
-
dirs,
|
|
138
|
-
log: (msg) => stdout(msg + '\n'),
|
|
139
|
-
});
|
|
140
146
|
}
|
|
147
|
+
// Run post-generation actions (ph-init, install, build, skills-sync).
|
|
148
|
+
// Only skip cli-install — in split layout, ph-init handles app install
|
|
149
|
+
// internally, and app-build must still run so the CLI can link to it.
|
|
150
|
+
const skip = new Set();
|
|
151
|
+
if (input.skipInstall) {
|
|
152
|
+
skip.add('cli-install');
|
|
153
|
+
}
|
|
154
|
+
await runPostGenActions(result.pendingActions, {
|
|
155
|
+
log: (msg) => stdout(msg + '\n'),
|
|
156
|
+
runProcess,
|
|
157
|
+
skip,
|
|
158
|
+
});
|
|
159
|
+
const split = spec.features.powerhouse !== 'Disabled';
|
|
141
160
|
const next = [];
|
|
142
161
|
next.push('');
|
|
143
162
|
next.push('Next steps:');
|
|
144
163
|
const relDir = path.relative(workdir, targetDir) || '.';
|
|
145
164
|
if (split) {
|
|
146
165
|
next.push(` cd ${relDir}`);
|
|
147
|
-
if (input.skipPhInit) {
|
|
148
|
-
next.push(` cd ${spec.name}-app && ph init . && cd ..`);
|
|
149
|
-
}
|
|
150
166
|
if (input.skipInstall) {
|
|
151
167
|
next.push(' pnpm install');
|
|
152
168
|
}
|
|
@@ -8,8 +8,71 @@ export declare const clintProjectPublish: import("@powerhousedao/ph-clint").Comm
|
|
|
8
8
|
dir: z.ZodOptional<z.ZodString>;
|
|
9
9
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
10
10
|
skipBuild: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
skipGitCheck: z.ZodDefault<z.ZodBoolean>;
|
|
11
12
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
12
13
|
}, z.core.$strip>, {
|
|
13
14
|
text: string;
|
|
14
15
|
data: import("@powerhousedao/ph-clint-dev/publish").PublishResult;
|
|
15
|
-
},
|
|
16
|
+
}, {
|
|
17
|
+
model: string;
|
|
18
|
+
devServicePort: number;
|
|
19
|
+
phVersion: string;
|
|
20
|
+
apiKey?: string | undefined;
|
|
21
|
+
}, import("@powerhousedao/ph-clint").InferRegistry<readonly [{
|
|
22
|
+
readonly version: 1;
|
|
23
|
+
readonly reducer: import("document-model").Reducer<import("@powerhousedao/ph-clint-app").PhClintProjectPHState>;
|
|
24
|
+
readonly actions: {
|
|
25
|
+
addSupportedResource: (input: import("@powerhousedao/ph-clint-app").AddSupportedResourceInput) => import("@powerhousedao/ph-clint-app").AddSupportedResourceAction;
|
|
26
|
+
removeSupportedResource: (input: import("@powerhousedao/ph-clint-app").RemoveSupportedResourceInput) => import("@powerhousedao/ph-clint-app").RemoveSupportedResourceAction;
|
|
27
|
+
setProxyEnabled: (input: import("@powerhousedao/ph-clint-app").SetProxyEnabledInput) => import("@powerhousedao/ph-clint-app").SetProxyEnabledAction;
|
|
28
|
+
setObservabilityEnabled: (input: import("@powerhousedao/ph-clint-app").SetObservabilityEnabledInput) => import("@powerhousedao/ph-clint-app").SetObservabilityEnabledAction;
|
|
29
|
+
importSpec: (input: import("@powerhousedao/ph-clint-app").ImportSpecInput) => import("@powerhousedao/ph-clint-app").ImportSpecAction;
|
|
30
|
+
bumpVersion: (input: import("@powerhousedao/ph-clint-app").BumpVersionInput) => import("@powerhousedao/ph-clint-app").BumpVersionAction;
|
|
31
|
+
publishDev: (input: import("@powerhousedao/ph-clint-app").PublishDevInput) => import("@powerhousedao/ph-clint-app").PublishDevAction;
|
|
32
|
+
publishStaging: (input: import("@powerhousedao/ph-clint-app").PublishStagingInput) => import("@powerhousedao/ph-clint-app").PublishStagingAction;
|
|
33
|
+
publishProduction: (input: import("@powerhousedao/ph-clint-app").PublishProductionInput) => import("@powerhousedao/ph-clint-app").PublishProductionAction;
|
|
34
|
+
setPublishStatus: (input: import("@powerhousedao/ph-clint-app").SetPublishStatusInput) => import("@powerhousedao/ph-clint-app").SetPublishStatusAction;
|
|
35
|
+
addExternalSkill: (input: import("@powerhousedao/ph-clint-app").AddExternalSkillInput) => import("@powerhousedao/ph-clint-app").AddExternalSkillAction;
|
|
36
|
+
removeExternalSkill: (input: import("@powerhousedao/ph-clint-app").RemoveExternalSkillInput) => import("@powerhousedao/ph-clint-app").RemoveExternalSkillAction;
|
|
37
|
+
setExternalSkillName: (input: import("@powerhousedao/ph-clint-app").SetExternalSkillNameInput) => import("@powerhousedao/ph-clint-app").SetExternalSkillNameAction;
|
|
38
|
+
setExternalSkillGithubUrl: (input: import("@powerhousedao/ph-clint-app").SetExternalSkillGithubUrlInput) => import("@powerhousedao/ph-clint-app").SetExternalSkillGithubUrlAction;
|
|
39
|
+
addPowerhousePackage: (input: import("@powerhousedao/ph-clint-app").AddPowerhousePackageInput) => import("@powerhousedao/ph-clint-app").AddPowerhousePackageAction;
|
|
40
|
+
removePowerhousePackage: (input: import("@powerhousedao/ph-clint-app").RemovePowerhousePackageInput) => import("@powerhousedao/ph-clint-app").RemovePowerhousePackageAction;
|
|
41
|
+
addPackageDocumentType: (input: import("@powerhousedao/ph-clint-app").AddPackageDocumentTypeInput) => import("@powerhousedao/ph-clint-app").AddPackageDocumentTypeAction;
|
|
42
|
+
removePackageDocumentType: (input: import("@powerhousedao/ph-clint-app").RemovePackageDocumentTypeInput) => import("@powerhousedao/ph-clint-app").RemovePackageDocumentTypeAction;
|
|
43
|
+
setPackageVersion: (input: import("@powerhousedao/ph-clint-app").SetPackageVersionInput) => import("@powerhousedao/ph-clint-app").SetPackageVersionAction;
|
|
44
|
+
enableRoutine: (input: import("@powerhousedao/ph-clint-app").EnableRoutineInput) => import("@powerhousedao/ph-clint-app").EnableRoutineAction;
|
|
45
|
+
disableRoutine: (input: import("@powerhousedao/ph-clint-app").DisableRoutineInput) => import("@powerhousedao/ph-clint-app").DisableRoutineAction;
|
|
46
|
+
enableMastra: (input: import("@powerhousedao/ph-clint-app").EnableMastraInput) => import("@powerhousedao/ph-clint-app").EnableMastraAction;
|
|
47
|
+
disableMastra: (input: import("@powerhousedao/ph-clint-app").DisableMastraInput) => import("@powerhousedao/ph-clint-app").DisableMastraAction;
|
|
48
|
+
setAgentId: (input: import("@powerhousedao/ph-clint-app").SetAgentIdInput) => import("@powerhousedao/ph-clint-app").SetAgentIdAction;
|
|
49
|
+
setAgentName: (input: import("@powerhousedao/ph-clint-app").SetAgentNameInput) => import("@powerhousedao/ph-clint-app").SetAgentNameAction;
|
|
50
|
+
addModel: (input: import("@powerhousedao/ph-clint-app").AddModelInput) => import("@powerhousedao/ph-clint-app").AddModelAction;
|
|
51
|
+
removeModel: (input: import("@powerhousedao/ph-clint-app").RemoveModelInput) => import("@powerhousedao/ph-clint-app").RemoveModelAction;
|
|
52
|
+
setDefaultModel: (input: import("@powerhousedao/ph-clint-app").SetDefaultModelInput) => import("@powerhousedao/ph-clint-app").SetDefaultModelAction;
|
|
53
|
+
addProfile: (input: import("@powerhousedao/ph-clint-app").AddProfileInput) => import("@powerhousedao/ph-clint-app").AddProfileAction;
|
|
54
|
+
updateProfile: (input: import("@powerhousedao/ph-clint-app").UpdateProfileInput) => import("@powerhousedao/ph-clint-app").UpdateProfileAction;
|
|
55
|
+
removeProfile: (input: import("@powerhousedao/ph-clint-app").RemoveProfileInput) => import("@powerhousedao/ph-clint-app").RemoveProfileAction;
|
|
56
|
+
reorderProfiles: (input: import("@powerhousedao/ph-clint-app").ReorderProfilesInput) => import("@powerhousedao/ph-clint-app").ReorderProfilesAction;
|
|
57
|
+
setAgentDescription: (input: import("@powerhousedao/ph-clint-app").SetAgentDescriptionInput) => import("@powerhousedao/ph-clint-app").SetAgentDescriptionAction;
|
|
58
|
+
setAgentImage: (input: import("@powerhousedao/ph-clint-app").SetAgentImageInput) => import("@powerhousedao/ph-clint-app").SetAgentImageAction;
|
|
59
|
+
clearAgentImage: (input: import("@powerhousedao/ph-clint-app").ClearAgentImageInput) => import("@powerhousedao/ph-clint-app").ClearAgentImageAction;
|
|
60
|
+
setEnableChat: (input: import("@powerhousedao/ph-clint-app").SetEnableChatInput) => import("@powerhousedao/ph-clint-app").SetEnableChatAction;
|
|
61
|
+
setPowerhouseLevel: (input: import("@powerhousedao/ph-clint-app").SetPowerhouseLevelInput) => import("@powerhousedao/ph-clint-app").SetPowerhouseLevelAction;
|
|
62
|
+
setDescription: (input: import("@powerhousedao/ph-clint-app").SetDescriptionInput) => import("@powerhousedao/ph-clint-app").SetDescriptionAction;
|
|
63
|
+
setVersion: (input: import("@powerhousedao/ph-clint-app").SetVersionInput) => import("@powerhousedao/ph-clint-app").SetVersionAction;
|
|
64
|
+
setPackageIdentifier: (input: import("@powerhousedao/ph-clint-app").SetPackageIdentifierInput) => import("@powerhousedao/ph-clint-app").SetPackageIdentifierAction;
|
|
65
|
+
setName: (name: string | {
|
|
66
|
+
name: string;
|
|
67
|
+
}) => import("document-model").SetNameAction;
|
|
68
|
+
undo: (count?: number, scope?: string) => import("document-model").UndoAction;
|
|
69
|
+
redo: (count?: number, scope?: string) => import("document-model").RedoAction;
|
|
70
|
+
prune: (start?: number, end?: number, scope?: string) => import("document-model").SchemaPruneAction;
|
|
71
|
+
loadState: <TState extends import("document-model").PHBaseState = import("document-model").PHBaseState>(state: TState & {
|
|
72
|
+
name: string;
|
|
73
|
+
}, operations: number) => import("document-model").LoadStateAction;
|
|
74
|
+
noop: (scope?: string) => import("document-model").NOOPAction;
|
|
75
|
+
};
|
|
76
|
+
readonly utils: import("document-model").DocumentModelUtils<import("@powerhousedao/ph-clint-app").PhClintProjectPHState>;
|
|
77
|
+
readonly documentModel: import("document-model").DocumentModelPHState;
|
|
78
|
+
}]>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { defineCommand } from '
|
|
2
|
+
import { defineCommand } from '../framework.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { resolvePublishPlan, buildPackages, publishPackages, } from '@powerhousedao/ph-clint-dev/publish';
|
|
5
5
|
const inputSchema = z.object({
|
|
@@ -7,6 +7,7 @@ const inputSchema = z.object({
|
|
|
7
7
|
dir: z.string().optional().describe('Project root directory'),
|
|
8
8
|
dryRun: z.boolean().default(false).describe('Preview without publishing'),
|
|
9
9
|
skipBuild: z.boolean().default(false),
|
|
10
|
+
skipGitCheck: z.boolean().default(false).describe('Skip git working tree check'),
|
|
10
11
|
verbose: z.boolean().default(false),
|
|
11
12
|
});
|
|
12
13
|
function formatPlanPreview(plan) {
|
|
@@ -34,11 +35,12 @@ export const clintProjectPublish = defineCommand({
|
|
|
34
35
|
logLines.push(msg);
|
|
35
36
|
stdout(msg + '\n');
|
|
36
37
|
};
|
|
37
|
-
// 1. Resolve plan
|
|
38
|
+
// 1. Resolve plan — discover config from the target dir, not process.cwd().
|
|
39
|
+
const configFile = path.join(dir, 'publish.config.js');
|
|
38
40
|
const plan = await resolvePublishPlan({
|
|
39
41
|
tag: input.tag,
|
|
40
|
-
configPath:
|
|
41
|
-
skipGitCheck: input.dryRun,
|
|
42
|
+
configPath: configFile,
|
|
43
|
+
skipGitCheck: input.dryRun || input.skipGitCheck,
|
|
42
44
|
log,
|
|
43
45
|
});
|
|
44
46
|
// 2. Show preview
|
|
@@ -15,4 +15,66 @@ export declare const regen: import("@powerhousedao/ph-clint").Command<z.ZodObjec
|
|
|
15
15
|
migrated: boolean;
|
|
16
16
|
warnings: string[];
|
|
17
17
|
};
|
|
18
|
-
},
|
|
18
|
+
}, {
|
|
19
|
+
model: string;
|
|
20
|
+
devServicePort: number;
|
|
21
|
+
phVersion: string;
|
|
22
|
+
apiKey?: string | undefined;
|
|
23
|
+
}, import("@powerhousedao/ph-clint").InferRegistry<readonly [{
|
|
24
|
+
readonly version: 1;
|
|
25
|
+
readonly reducer: import("document-model").Reducer<import("@powerhousedao/ph-clint-app").PhClintProjectPHState>;
|
|
26
|
+
readonly actions: {
|
|
27
|
+
addSupportedResource: (input: import("@powerhousedao/ph-clint-app").AddSupportedResourceInput) => import("@powerhousedao/ph-clint-app").AddSupportedResourceAction;
|
|
28
|
+
removeSupportedResource: (input: import("@powerhousedao/ph-clint-app").RemoveSupportedResourceInput) => import("@powerhousedao/ph-clint-app").RemoveSupportedResourceAction;
|
|
29
|
+
setProxyEnabled: (input: import("@powerhousedao/ph-clint-app").SetProxyEnabledInput) => import("@powerhousedao/ph-clint-app").SetProxyEnabledAction;
|
|
30
|
+
setObservabilityEnabled: (input: import("@powerhousedao/ph-clint-app").SetObservabilityEnabledInput) => import("@powerhousedao/ph-clint-app").SetObservabilityEnabledAction;
|
|
31
|
+
importSpec: (input: import("@powerhousedao/ph-clint-app").ImportSpecInput) => import("@powerhousedao/ph-clint-app").ImportSpecAction;
|
|
32
|
+
bumpVersion: (input: import("@powerhousedao/ph-clint-app").BumpVersionInput) => import("@powerhousedao/ph-clint-app").BumpVersionAction;
|
|
33
|
+
publishDev: (input: import("@powerhousedao/ph-clint-app").PublishDevInput) => import("@powerhousedao/ph-clint-app").PublishDevAction;
|
|
34
|
+
publishStaging: (input: import("@powerhousedao/ph-clint-app").PublishStagingInput) => import("@powerhousedao/ph-clint-app").PublishStagingAction;
|
|
35
|
+
publishProduction: (input: import("@powerhousedao/ph-clint-app").PublishProductionInput) => import("@powerhousedao/ph-clint-app").PublishProductionAction;
|
|
36
|
+
setPublishStatus: (input: import("@powerhousedao/ph-clint-app").SetPublishStatusInput) => import("@powerhousedao/ph-clint-app").SetPublishStatusAction;
|
|
37
|
+
addExternalSkill: (input: import("@powerhousedao/ph-clint-app").AddExternalSkillInput) => import("@powerhousedao/ph-clint-app").AddExternalSkillAction;
|
|
38
|
+
removeExternalSkill: (input: import("@powerhousedao/ph-clint-app").RemoveExternalSkillInput) => import("@powerhousedao/ph-clint-app").RemoveExternalSkillAction;
|
|
39
|
+
setExternalSkillName: (input: import("@powerhousedao/ph-clint-app").SetExternalSkillNameInput) => import("@powerhousedao/ph-clint-app").SetExternalSkillNameAction;
|
|
40
|
+
setExternalSkillGithubUrl: (input: import("@powerhousedao/ph-clint-app").SetExternalSkillGithubUrlInput) => import("@powerhousedao/ph-clint-app").SetExternalSkillGithubUrlAction;
|
|
41
|
+
addPowerhousePackage: (input: import("@powerhousedao/ph-clint-app").AddPowerhousePackageInput) => import("@powerhousedao/ph-clint-app").AddPowerhousePackageAction;
|
|
42
|
+
removePowerhousePackage: (input: import("@powerhousedao/ph-clint-app").RemovePowerhousePackageInput) => import("@powerhousedao/ph-clint-app").RemovePowerhousePackageAction;
|
|
43
|
+
addPackageDocumentType: (input: import("@powerhousedao/ph-clint-app").AddPackageDocumentTypeInput) => import("@powerhousedao/ph-clint-app").AddPackageDocumentTypeAction;
|
|
44
|
+
removePackageDocumentType: (input: import("@powerhousedao/ph-clint-app").RemovePackageDocumentTypeInput) => import("@powerhousedao/ph-clint-app").RemovePackageDocumentTypeAction;
|
|
45
|
+
setPackageVersion: (input: import("@powerhousedao/ph-clint-app").SetPackageVersionInput) => import("@powerhousedao/ph-clint-app").SetPackageVersionAction;
|
|
46
|
+
enableRoutine: (input: import("@powerhousedao/ph-clint-app").EnableRoutineInput) => import("@powerhousedao/ph-clint-app").EnableRoutineAction;
|
|
47
|
+
disableRoutine: (input: import("@powerhousedao/ph-clint-app").DisableRoutineInput) => import("@powerhousedao/ph-clint-app").DisableRoutineAction;
|
|
48
|
+
enableMastra: (input: import("@powerhousedao/ph-clint-app").EnableMastraInput) => import("@powerhousedao/ph-clint-app").EnableMastraAction;
|
|
49
|
+
disableMastra: (input: import("@powerhousedao/ph-clint-app").DisableMastraInput) => import("@powerhousedao/ph-clint-app").DisableMastraAction;
|
|
50
|
+
setAgentId: (input: import("@powerhousedao/ph-clint-app").SetAgentIdInput) => import("@powerhousedao/ph-clint-app").SetAgentIdAction;
|
|
51
|
+
setAgentName: (input: import("@powerhousedao/ph-clint-app").SetAgentNameInput) => import("@powerhousedao/ph-clint-app").SetAgentNameAction;
|
|
52
|
+
addModel: (input: import("@powerhousedao/ph-clint-app").AddModelInput) => import("@powerhousedao/ph-clint-app").AddModelAction;
|
|
53
|
+
removeModel: (input: import("@powerhousedao/ph-clint-app").RemoveModelInput) => import("@powerhousedao/ph-clint-app").RemoveModelAction;
|
|
54
|
+
setDefaultModel: (input: import("@powerhousedao/ph-clint-app").SetDefaultModelInput) => import("@powerhousedao/ph-clint-app").SetDefaultModelAction;
|
|
55
|
+
addProfile: (input: import("@powerhousedao/ph-clint-app").AddProfileInput) => import("@powerhousedao/ph-clint-app").AddProfileAction;
|
|
56
|
+
updateProfile: (input: import("@powerhousedao/ph-clint-app").UpdateProfileInput) => import("@powerhousedao/ph-clint-app").UpdateProfileAction;
|
|
57
|
+
removeProfile: (input: import("@powerhousedao/ph-clint-app").RemoveProfileInput) => import("@powerhousedao/ph-clint-app").RemoveProfileAction;
|
|
58
|
+
reorderProfiles: (input: import("@powerhousedao/ph-clint-app").ReorderProfilesInput) => import("@powerhousedao/ph-clint-app").ReorderProfilesAction;
|
|
59
|
+
setAgentDescription: (input: import("@powerhousedao/ph-clint-app").SetAgentDescriptionInput) => import("@powerhousedao/ph-clint-app").SetAgentDescriptionAction;
|
|
60
|
+
setAgentImage: (input: import("@powerhousedao/ph-clint-app").SetAgentImageInput) => import("@powerhousedao/ph-clint-app").SetAgentImageAction;
|
|
61
|
+
clearAgentImage: (input: import("@powerhousedao/ph-clint-app").ClearAgentImageInput) => import("@powerhousedao/ph-clint-app").ClearAgentImageAction;
|
|
62
|
+
setEnableChat: (input: import("@powerhousedao/ph-clint-app").SetEnableChatInput) => import("@powerhousedao/ph-clint-app").SetEnableChatAction;
|
|
63
|
+
setPowerhouseLevel: (input: import("@powerhousedao/ph-clint-app").SetPowerhouseLevelInput) => import("@powerhousedao/ph-clint-app").SetPowerhouseLevelAction;
|
|
64
|
+
setDescription: (input: import("@powerhousedao/ph-clint-app").SetDescriptionInput) => import("@powerhousedao/ph-clint-app").SetDescriptionAction;
|
|
65
|
+
setVersion: (input: import("@powerhousedao/ph-clint-app").SetVersionInput) => import("@powerhousedao/ph-clint-app").SetVersionAction;
|
|
66
|
+
setPackageIdentifier: (input: import("@powerhousedao/ph-clint-app").SetPackageIdentifierInput) => import("@powerhousedao/ph-clint-app").SetPackageIdentifierAction;
|
|
67
|
+
setName: (name: string | {
|
|
68
|
+
name: string;
|
|
69
|
+
}) => import("document-model").SetNameAction;
|
|
70
|
+
undo: (count?: number, scope?: string) => import("document-model").UndoAction;
|
|
71
|
+
redo: (count?: number, scope?: string) => import("document-model").RedoAction;
|
|
72
|
+
prune: (start?: number, end?: number, scope?: string) => import("document-model").SchemaPruneAction;
|
|
73
|
+
loadState: <TState extends import("document-model").PHBaseState = import("document-model").PHBaseState>(state: TState & {
|
|
74
|
+
name: string;
|
|
75
|
+
}, operations: number) => import("document-model").LoadStateAction;
|
|
76
|
+
noop: (scope?: string) => import("document-model").NOOPAction;
|
|
77
|
+
};
|
|
78
|
+
readonly utils: import("document-model").DocumentModelUtils<import("@powerhousedao/ph-clint-app").PhClintProjectPHState>;
|
|
79
|
+
readonly documentModel: import("document-model").DocumentModelPHState;
|
|
80
|
+
}]>>;
|
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
* migration fires first.
|
|
8
8
|
*/
|
|
9
9
|
import path from 'node:path';
|
|
10
|
-
import { defineCommand } from '
|
|
10
|
+
import { defineCommand } from '../framework.js';
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
import { readProjectSpec } from '../spec/file.js';
|
|
13
13
|
import { generateProject } from '../codegen/index.js';
|
|
14
|
+
import { runPostGenActions } from '@powerhousedao/ph-clint-dev/codegen/actions';
|
|
15
|
+
import { ensureSpecDocument } from '../spec/ensure-document.js';
|
|
14
16
|
const inputSchema = z.object({
|
|
15
17
|
dir: z
|
|
16
18
|
.string()
|
|
@@ -25,7 +27,7 @@ export const regen = defineCommand({
|
|
|
25
27
|
id: 'clint-project-regen',
|
|
26
28
|
description: 'Regenerate project files from the persisted spec',
|
|
27
29
|
inputSchema,
|
|
28
|
-
execute: async (input, { workdir, stdout, log }) => {
|
|
30
|
+
execute: async (input, { workdir, stdout, log, runProcess, reactor: getReactor, folders }) => {
|
|
29
31
|
const targetDir = path.resolve(workdir, input.dir ?? '.');
|
|
30
32
|
const spec = await readProjectSpec(targetDir);
|
|
31
33
|
if (!spec) {
|
|
@@ -52,7 +54,29 @@ export const regen = defineCommand({
|
|
|
52
54
|
else
|
|
53
55
|
stdout('warning: ' + w + '\n');
|
|
54
56
|
}
|
|
57
|
+
// Ensure spec document exists in drive (recover if deleted)
|
|
58
|
+
if (getReactor && folders) {
|
|
59
|
+
try {
|
|
60
|
+
const reactor = await getReactor();
|
|
61
|
+
if (reactor) {
|
|
62
|
+
const { docId, created } = await ensureSpecDocument({
|
|
63
|
+
spec, targetDir, reactor, folders,
|
|
64
|
+
});
|
|
65
|
+
if (created) {
|
|
66
|
+
lines.push(`Created spec document ${docId} in Clint Folders/specs/${spec.name}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
log?.warn(`Could not ensure spec document: ${err instanceof Error ? err.message : String(err)}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
55
74
|
stdout(lines.join('\n') + '\n');
|
|
75
|
+
// Run post-generation actions (install, build, skills-sync).
|
|
76
|
+
await runPostGenActions(result.pendingActions, {
|
|
77
|
+
log: (msg) => stdout(msg + '\n'),
|
|
78
|
+
runProcess,
|
|
79
|
+
});
|
|
56
80
|
return {
|
|
57
81
|
text: lines.join('\n'),
|
|
58
82
|
data: {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const skillsSync: import("@powerhousedao/ph-clint").Command<z.ZodObject<{
|
|
3
|
+
dir: z.ZodOptional<z.ZodString>;
|
|
4
|
+
}, z.core.$strip>, {
|
|
5
|
+
text: string;
|
|
6
|
+
data?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
text: string;
|
|
9
|
+
data: import("@powerhousedao/ph-clint-dev/skills/sync").SyncResult;
|
|
10
|
+
}, {
|
|
11
|
+
model: string;
|
|
12
|
+
devServicePort: number;
|
|
13
|
+
phVersion: string;
|
|
14
|
+
apiKey?: string | undefined;
|
|
15
|
+
}, import("@powerhousedao/ph-clint").InferRegistry<readonly [{
|
|
16
|
+
readonly version: 1;
|
|
17
|
+
readonly reducer: import("document-model").Reducer<import("@powerhousedao/ph-clint-app").PhClintProjectPHState>;
|
|
18
|
+
readonly actions: {
|
|
19
|
+
addSupportedResource: (input: import("@powerhousedao/ph-clint-app").AddSupportedResourceInput) => import("@powerhousedao/ph-clint-app").AddSupportedResourceAction;
|
|
20
|
+
removeSupportedResource: (input: import("@powerhousedao/ph-clint-app").RemoveSupportedResourceInput) => import("@powerhousedao/ph-clint-app").RemoveSupportedResourceAction;
|
|
21
|
+
setProxyEnabled: (input: import("@powerhousedao/ph-clint-app").SetProxyEnabledInput) => import("@powerhousedao/ph-clint-app").SetProxyEnabledAction;
|
|
22
|
+
setObservabilityEnabled: (input: import("@powerhousedao/ph-clint-app").SetObservabilityEnabledInput) => import("@powerhousedao/ph-clint-app").SetObservabilityEnabledAction;
|
|
23
|
+
importSpec: (input: import("@powerhousedao/ph-clint-app").ImportSpecInput) => import("@powerhousedao/ph-clint-app").ImportSpecAction;
|
|
24
|
+
bumpVersion: (input: import("@powerhousedao/ph-clint-app").BumpVersionInput) => import("@powerhousedao/ph-clint-app").BumpVersionAction;
|
|
25
|
+
publishDev: (input: import("@powerhousedao/ph-clint-app").PublishDevInput) => import("@powerhousedao/ph-clint-app").PublishDevAction;
|
|
26
|
+
publishStaging: (input: import("@powerhousedao/ph-clint-app").PublishStagingInput) => import("@powerhousedao/ph-clint-app").PublishStagingAction;
|
|
27
|
+
publishProduction: (input: import("@powerhousedao/ph-clint-app").PublishProductionInput) => import("@powerhousedao/ph-clint-app").PublishProductionAction;
|
|
28
|
+
setPublishStatus: (input: import("@powerhousedao/ph-clint-app").SetPublishStatusInput) => import("@powerhousedao/ph-clint-app").SetPublishStatusAction;
|
|
29
|
+
addExternalSkill: (input: import("@powerhousedao/ph-clint-app").AddExternalSkillInput) => import("@powerhousedao/ph-clint-app").AddExternalSkillAction;
|
|
30
|
+
removeExternalSkill: (input: import("@powerhousedao/ph-clint-app").RemoveExternalSkillInput) => import("@powerhousedao/ph-clint-app").RemoveExternalSkillAction;
|
|
31
|
+
setExternalSkillName: (input: import("@powerhousedao/ph-clint-app").SetExternalSkillNameInput) => import("@powerhousedao/ph-clint-app").SetExternalSkillNameAction;
|
|
32
|
+
setExternalSkillGithubUrl: (input: import("@powerhousedao/ph-clint-app").SetExternalSkillGithubUrlInput) => import("@powerhousedao/ph-clint-app").SetExternalSkillGithubUrlAction;
|
|
33
|
+
addPowerhousePackage: (input: import("@powerhousedao/ph-clint-app").AddPowerhousePackageInput) => import("@powerhousedao/ph-clint-app").AddPowerhousePackageAction;
|
|
34
|
+
removePowerhousePackage: (input: import("@powerhousedao/ph-clint-app").RemovePowerhousePackageInput) => import("@powerhousedao/ph-clint-app").RemovePowerhousePackageAction;
|
|
35
|
+
addPackageDocumentType: (input: import("@powerhousedao/ph-clint-app").AddPackageDocumentTypeInput) => import("@powerhousedao/ph-clint-app").AddPackageDocumentTypeAction;
|
|
36
|
+
removePackageDocumentType: (input: import("@powerhousedao/ph-clint-app").RemovePackageDocumentTypeInput) => import("@powerhousedao/ph-clint-app").RemovePackageDocumentTypeAction;
|
|
37
|
+
setPackageVersion: (input: import("@powerhousedao/ph-clint-app").SetPackageVersionInput) => import("@powerhousedao/ph-clint-app").SetPackageVersionAction;
|
|
38
|
+
enableRoutine: (input: import("@powerhousedao/ph-clint-app").EnableRoutineInput) => import("@powerhousedao/ph-clint-app").EnableRoutineAction;
|
|
39
|
+
disableRoutine: (input: import("@powerhousedao/ph-clint-app").DisableRoutineInput) => import("@powerhousedao/ph-clint-app").DisableRoutineAction;
|
|
40
|
+
enableMastra: (input: import("@powerhousedao/ph-clint-app").EnableMastraInput) => import("@powerhousedao/ph-clint-app").EnableMastraAction;
|
|
41
|
+
disableMastra: (input: import("@powerhousedao/ph-clint-app").DisableMastraInput) => import("@powerhousedao/ph-clint-app").DisableMastraAction;
|
|
42
|
+
setAgentId: (input: import("@powerhousedao/ph-clint-app").SetAgentIdInput) => import("@powerhousedao/ph-clint-app").SetAgentIdAction;
|
|
43
|
+
setAgentName: (input: import("@powerhousedao/ph-clint-app").SetAgentNameInput) => import("@powerhousedao/ph-clint-app").SetAgentNameAction;
|
|
44
|
+
addModel: (input: import("@powerhousedao/ph-clint-app").AddModelInput) => import("@powerhousedao/ph-clint-app").AddModelAction;
|
|
45
|
+
removeModel: (input: import("@powerhousedao/ph-clint-app").RemoveModelInput) => import("@powerhousedao/ph-clint-app").RemoveModelAction;
|
|
46
|
+
setDefaultModel: (input: import("@powerhousedao/ph-clint-app").SetDefaultModelInput) => import("@powerhousedao/ph-clint-app").SetDefaultModelAction;
|
|
47
|
+
addProfile: (input: import("@powerhousedao/ph-clint-app").AddProfileInput) => import("@powerhousedao/ph-clint-app").AddProfileAction;
|
|
48
|
+
updateProfile: (input: import("@powerhousedao/ph-clint-app").UpdateProfileInput) => import("@powerhousedao/ph-clint-app").UpdateProfileAction;
|
|
49
|
+
removeProfile: (input: import("@powerhousedao/ph-clint-app").RemoveProfileInput) => import("@powerhousedao/ph-clint-app").RemoveProfileAction;
|
|
50
|
+
reorderProfiles: (input: import("@powerhousedao/ph-clint-app").ReorderProfilesInput) => import("@powerhousedao/ph-clint-app").ReorderProfilesAction;
|
|
51
|
+
setAgentDescription: (input: import("@powerhousedao/ph-clint-app").SetAgentDescriptionInput) => import("@powerhousedao/ph-clint-app").SetAgentDescriptionAction;
|
|
52
|
+
setAgentImage: (input: import("@powerhousedao/ph-clint-app").SetAgentImageInput) => import("@powerhousedao/ph-clint-app").SetAgentImageAction;
|
|
53
|
+
clearAgentImage: (input: import("@powerhousedao/ph-clint-app").ClearAgentImageInput) => import("@powerhousedao/ph-clint-app").ClearAgentImageAction;
|
|
54
|
+
setEnableChat: (input: import("@powerhousedao/ph-clint-app").SetEnableChatInput) => import("@powerhousedao/ph-clint-app").SetEnableChatAction;
|
|
55
|
+
setPowerhouseLevel: (input: import("@powerhousedao/ph-clint-app").SetPowerhouseLevelInput) => import("@powerhousedao/ph-clint-app").SetPowerhouseLevelAction;
|
|
56
|
+
setDescription: (input: import("@powerhousedao/ph-clint-app").SetDescriptionInput) => import("@powerhousedao/ph-clint-app").SetDescriptionAction;
|
|
57
|
+
setVersion: (input: import("@powerhousedao/ph-clint-app").SetVersionInput) => import("@powerhousedao/ph-clint-app").SetVersionAction;
|
|
58
|
+
setPackageIdentifier: (input: import("@powerhousedao/ph-clint-app").SetPackageIdentifierInput) => import("@powerhousedao/ph-clint-app").SetPackageIdentifierAction;
|
|
59
|
+
setName: (name: string | {
|
|
60
|
+
name: string;
|
|
61
|
+
}) => import("document-model").SetNameAction;
|
|
62
|
+
undo: (count?: number, scope?: string) => import("document-model").UndoAction;
|
|
63
|
+
redo: (count?: number, scope?: string) => import("document-model").RedoAction;
|
|
64
|
+
prune: (start?: number, end?: number, scope?: string) => import("document-model").SchemaPruneAction;
|
|
65
|
+
loadState: <TState extends import("document-model").PHBaseState = import("document-model").PHBaseState>(state: TState & {
|
|
66
|
+
name: string;
|
|
67
|
+
}, operations: number) => import("document-model").LoadStateAction;
|
|
68
|
+
noop: (scope?: string) => import("document-model").NOOPAction;
|
|
69
|
+
};
|
|
70
|
+
readonly utils: import("document-model").DocumentModelUtils<import("@powerhousedao/ph-clint-app").PhClintProjectPHState>;
|
|
71
|
+
readonly documentModel: import("document-model").DocumentModelPHState;
|
|
72
|
+
}]>>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ph-clint clint-skills-sync` — reconcile external skills on disk to match
|
|
3
|
+
* the project spec. Clones missing skills from GitHub, removes skills no
|
|
4
|
+
* longer referenced, and updates `.skills-manifest.json`.
|
|
5
|
+
*/
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { defineCommand } from '../framework.js';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
import { readProjectSpec } from '../spec/file.js';
|
|
10
|
+
import { syncExternalSkills } from '@powerhousedao/ph-clint-dev/skills/sync';
|
|
11
|
+
const inputSchema = z.object({
|
|
12
|
+
dir: z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Project directory (defaults to the current directory)'),
|
|
16
|
+
});
|
|
17
|
+
export const skillsSync = defineCommand({
|
|
18
|
+
id: 'clint-skills-sync',
|
|
19
|
+
description: 'Synchronise external skills from the project spec',
|
|
20
|
+
inputSchema,
|
|
21
|
+
execute: async (input, { workdir, stdout, log }) => {
|
|
22
|
+
const targetDir = path.resolve(workdir, input.dir ?? '.');
|
|
23
|
+
const spec = await readProjectSpec(targetDir);
|
|
24
|
+
if (!spec) {
|
|
25
|
+
return {
|
|
26
|
+
text: `Error: no spec found at ${targetDir}/.ph/ph-clint-cli/project-spec.json.\n` +
|
|
27
|
+
'Run `ph-clint clint-project-init` first to scaffold a new project.',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const result = await syncExternalSkills({
|
|
31
|
+
targetDir,
|
|
32
|
+
desired: spec.externalSkills,
|
|
33
|
+
log: (msg) => {
|
|
34
|
+
if (log)
|
|
35
|
+
log.info(msg);
|
|
36
|
+
else
|
|
37
|
+
stdout(msg + '\n');
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const lines = [];
|
|
41
|
+
if (result.added.length > 0) {
|
|
42
|
+
lines.push(`Added: ${result.added.join(', ')}`);
|
|
43
|
+
}
|
|
44
|
+
if (result.removed.length > 0) {
|
|
45
|
+
lines.push(`Removed: ${result.removed.join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
if (result.added.length === 0 && result.removed.length === 0) {
|
|
48
|
+
lines.push('External skills are up to date.');
|
|
49
|
+
}
|
|
50
|
+
stdout(lines.join('\n') + '\n');
|
|
51
|
+
return {
|
|
52
|
+
text: lines.join('\n'),
|
|
53
|
+
data: result,
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
});
|