@powerhousedao/ph-clint-cli 0.0.1

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.
Files changed (65) hide show
  1. package/README.md +84 -0
  2. package/dist/agents/clint-agent.d.ts +12 -0
  3. package/dist/agents/clint-agent.js +42 -0
  4. package/dist/cli.d.ts +1 -0
  5. package/dist/cli.js +122 -0
  6. package/dist/codegen/index.d.ts +11 -0
  7. package/dist/codegen/index.js +11 -0
  8. package/dist/commands/clint-project-build.d.ts +83 -0
  9. package/dist/commands/clint-project-build.js +34 -0
  10. package/dist/commands/clint-project-init.d.ts +177 -0
  11. package/dist/commands/clint-project-init.js +193 -0
  12. package/dist/commands/clint-project-publish.d.ts +92 -0
  13. package/dist/commands/clint-project-publish.js +73 -0
  14. package/dist/commands/clint-project-regen.d.ts +94 -0
  15. package/dist/commands/clint-project-regen.js +92 -0
  16. package/dist/commands/clint-skills-sync.d.ts +86 -0
  17. package/dist/commands/clint-skills-sync.js +56 -0
  18. package/dist/config.d.ts +3 -0
  19. package/dist/config.js +5 -0
  20. package/dist/framework.d.ts +501 -0
  21. package/dist/framework.gen.d.ts +77 -0
  22. package/dist/framework.gen.js +16 -0
  23. package/dist/framework.js +37 -0
  24. package/dist/gen/agent-profiles/PhClintDevAgent.md +13 -0
  25. package/dist/gen/skills/cli-setup/.cli-docs.md +135 -0
  26. package/dist/gen/skills/cli-setup/SKILL.md +125 -0
  27. package/dist/gen/skills/cli-setup/references/00.assess-cli-needs.md +53 -0
  28. package/dist/gen/skills/cli-setup/references/01.define-config-schema.md +78 -0
  29. package/dist/gen/skills/cli-setup/references/02.wire-cli.md +141 -0
  30. package/dist/gen/skills/cli-setup/references/03.add-entrypoint.md +128 -0
  31. package/dist/gen/skills/cli-setup/references/expected-outcome.md +3 -0
  32. package/dist/gen/skills/command-definition/.cli-docs.md +84 -0
  33. package/dist/gen/skills/command-definition/SKILL.md +99 -0
  34. package/dist/gen/skills/command-definition/references/00.assess-requirements.md +58 -0
  35. package/dist/gen/skills/command-definition/references/01.define-schema.md +72 -0
  36. package/dist/gen/skills/command-definition/references/02.implement-execute.md +118 -0
  37. package/dist/gen/skills/command-definition/references/03.add-prompting.md +54 -0
  38. package/dist/gen/skills/command-definition/references/expected-outcome.md +3 -0
  39. package/dist/gen/skills/service-definition/.cli-docs.md +214 -0
  40. package/dist/gen/skills/service-definition/SKILL.md +148 -0
  41. package/dist/gen/skills/service-definition/references/00.assess-service.md +69 -0
  42. package/dist/gen/skills/service-definition/references/01.define-service.md +166 -0
  43. package/dist/gen/skills/service-definition/references/02.add-preflight.md +132 -0
  44. package/dist/gen/skills/service-definition/references/03.add-project-scanner.md +82 -0
  45. package/dist/gen/skills/service-definition/references/04.wire-events.md +120 -0
  46. package/dist/gen/skills/service-definition/references/expected-outcome.md +3 -0
  47. package/dist/main.d.ts +2 -0
  48. package/dist/main.js +3 -0
  49. package/dist/mastra/index.d.ts +10 -0
  50. package/dist/mastra/index.js +11 -0
  51. package/dist/services/clint-project.d.ts +1 -0
  52. package/dist/services/clint-project.js +68 -0
  53. package/dist/spec/ensure-document.d.ts +17 -0
  54. package/dist/spec/ensure-document.js +56 -0
  55. package/dist/spec/file.d.ts +1 -0
  56. package/dist/spec/file.js +1 -0
  57. package/dist/spec/from-document.d.ts +21 -0
  58. package/dist/spec/from-document.js +18 -0
  59. package/dist/spec/types.d.ts +1 -0
  60. package/dist/spec/types.js +1 -0
  61. package/dist/triggers/publish-trigger.d.ts +81 -0
  62. package/dist/triggers/publish-trigger.js +137 -0
  63. package/dist/triggers/spec-change.d.ts +85 -0
  64. package/dist/triggers/spec-change.js +224 -0
  65. package/package.json +54 -0
@@ -0,0 +1,86 @@
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
+ setAgentModel: (input: import("@powerhousedao/ph-clint-app").SetAgentModelInput) => import("@powerhousedao/ph-clint-app").SetAgentModelAction;
20
+ addAgentProfileRef: (input: import("@powerhousedao/ph-clint-app").AddAgentProfileRefInput) => import("@powerhousedao/ph-clint-app").AddAgentProfileRefAction;
21
+ removeAgentProfileRef: (input: import("@powerhousedao/ph-clint-app").RemoveAgentProfileRefInput) => import("@powerhousedao/ph-clint-app").RemoveAgentProfileRefAction;
22
+ reorderAgentProfileRefs: (input: import("@powerhousedao/ph-clint-app").ReorderAgentProfileRefsInput) => import("@powerhousedao/ph-clint-app").ReorderAgentProfileRefsAction;
23
+ addAgentSkill: (input: import("@powerhousedao/ph-clint-app").AddAgentSkillInput) => import("@powerhousedao/ph-clint-app").AddAgentSkillAction;
24
+ removeAgentSkill: (input: import("@powerhousedao/ph-clint-app").RemoveAgentSkillInput) => import("@powerhousedao/ph-clint-app").RemoveAgentSkillAction;
25
+ addAgentToolPattern: (input: import("@powerhousedao/ph-clint-app").AddAgentToolPatternInput) => import("@powerhousedao/ph-clint-app").AddAgentToolPatternAction;
26
+ removeAgentToolPattern: (input: import("@powerhousedao/ph-clint-app").RemoveAgentToolPatternInput) => import("@powerhousedao/ph-clint-app").RemoveAgentToolPatternAction;
27
+ addSubAgent: (input: import("@powerhousedao/ph-clint-app").AddSubAgentInput) => import("@powerhousedao/ph-clint-app").AddSubAgentAction;
28
+ removeSubAgent: (input: import("@powerhousedao/ph-clint-app").RemoveSubAgentInput) => import("@powerhousedao/ph-clint-app").RemoveSubAgentAction;
29
+ setSubAgentName: (input: import("@powerhousedao/ph-clint-app").SetSubAgentNameInput) => import("@powerhousedao/ph-clint-app").SetSubAgentNameAction;
30
+ setSubAgentDescription: (input: import("@powerhousedao/ph-clint-app").SetSubAgentDescriptionInput) => import("@powerhousedao/ph-clint-app").SetSubAgentDescriptionAction;
31
+ setMainAgentName: (input: import("@powerhousedao/ph-clint-app").SetMainAgentNameInput) => import("@powerhousedao/ph-clint-app").SetMainAgentNameAction;
32
+ setMainAgentDescription: (input: import("@powerhousedao/ph-clint-app").SetMainAgentDescriptionInput) => import("@powerhousedao/ph-clint-app").SetMainAgentDescriptionAction;
33
+ clearMainAgentDescription: (input: import("@powerhousedao/ph-clint-app").ClearMainAgentDescriptionInput) => import("@powerhousedao/ph-clint-app").ClearMainAgentDescriptionAction;
34
+ setMainAgentImage: (input: import("@powerhousedao/ph-clint-app").SetMainAgentImageInput) => import("@powerhousedao/ph-clint-app").SetMainAgentImageAction;
35
+ clearMainAgentImage: (input: import("@powerhousedao/ph-clint-app").ClearMainAgentImageInput) => import("@powerhousedao/ph-clint-app").ClearMainAgentImageAction;
36
+ addProfile: (input: import("@powerhousedao/ph-clint-app").AddProfileInput) => import("@powerhousedao/ph-clint-app").AddProfileAction;
37
+ updateProfile: (input: import("@powerhousedao/ph-clint-app").UpdateProfileInput) => import("@powerhousedao/ph-clint-app").UpdateProfileAction;
38
+ removeProfile: (input: import("@powerhousedao/ph-clint-app").RemoveProfileInput) => import("@powerhousedao/ph-clint-app").RemoveProfileAction;
39
+ reorderProfiles: (input: import("@powerhousedao/ph-clint-app").ReorderProfilesInput) => import("@powerhousedao/ph-clint-app").ReorderProfilesAction;
40
+ addModel: (input: import("@powerhousedao/ph-clint-app").AddModelInput) => import("@powerhousedao/ph-clint-app").AddModelAction;
41
+ removeModel: (input: import("@powerhousedao/ph-clint-app").RemoveModelInput) => import("@powerhousedao/ph-clint-app").RemoveModelAction;
42
+ enableMastra: (input: import("@powerhousedao/ph-clint-app").EnableMastraInput) => import("@powerhousedao/ph-clint-app").EnableMastraAction;
43
+ disableMastra: (input: import("@powerhousedao/ph-clint-app").DisableMastraInput) => import("@powerhousedao/ph-clint-app").DisableMastraAction;
44
+ setEnableChat: (input: import("@powerhousedao/ph-clint-app").SetEnableChatInput) => import("@powerhousedao/ph-clint-app").SetEnableChatAction;
45
+ addSupportedResource: (input: import("@powerhousedao/ph-clint-app").AddSupportedResourceInput) => import("@powerhousedao/ph-clint-app").AddSupportedResourceAction;
46
+ removeSupportedResource: (input: import("@powerhousedao/ph-clint-app").RemoveSupportedResourceInput) => import("@powerhousedao/ph-clint-app").RemoveSupportedResourceAction;
47
+ setProxyEnabled: (input: import("@powerhousedao/ph-clint-app").SetProxyEnabledInput) => import("@powerhousedao/ph-clint-app").SetProxyEnabledAction;
48
+ setObservabilityEnabled: (input: import("@powerhousedao/ph-clint-app").SetObservabilityEnabledInput) => import("@powerhousedao/ph-clint-app").SetObservabilityEnabledAction;
49
+ importSpec: (input: import("@powerhousedao/ph-clint-app").ImportSpecInput) => import("@powerhousedao/ph-clint-app").ImportSpecAction;
50
+ bumpVersion: (input: import("@powerhousedao/ph-clint-app").BumpVersionInput) => import("@powerhousedao/ph-clint-app").BumpVersionAction;
51
+ publishDev: (input: import("@powerhousedao/ph-clint-app").PublishDevInput) => import("@powerhousedao/ph-clint-app").PublishDevAction;
52
+ publishStaging: (input: import("@powerhousedao/ph-clint-app").PublishStagingInput) => import("@powerhousedao/ph-clint-app").PublishStagingAction;
53
+ publishProduction: (input: import("@powerhousedao/ph-clint-app").PublishProductionInput) => import("@powerhousedao/ph-clint-app").PublishProductionAction;
54
+ setPublishStatus: (input: import("@powerhousedao/ph-clint-app").SetPublishStatusInput) => import("@powerhousedao/ph-clint-app").SetPublishStatusAction;
55
+ addExternalSkill: (input: import("@powerhousedao/ph-clint-app").AddExternalSkillInput) => import("@powerhousedao/ph-clint-app").AddExternalSkillAction;
56
+ removeExternalSkill: (input: import("@powerhousedao/ph-clint-app").RemoveExternalSkillInput) => import("@powerhousedao/ph-clint-app").RemoveExternalSkillAction;
57
+ setExternalSkillName: (input: import("@powerhousedao/ph-clint-app").SetExternalSkillNameInput) => import("@powerhousedao/ph-clint-app").SetExternalSkillNameAction;
58
+ setExternalSkillGithubUrl: (input: import("@powerhousedao/ph-clint-app").SetExternalSkillGithubUrlInput) => import("@powerhousedao/ph-clint-app").SetExternalSkillGithubUrlAction;
59
+ addPowerhousePackage: (input: import("@powerhousedao/ph-clint-app").AddPowerhousePackageInput) => import("@powerhousedao/ph-clint-app").AddPowerhousePackageAction;
60
+ removePowerhousePackage: (input: import("@powerhousedao/ph-clint-app").RemovePowerhousePackageInput) => import("@powerhousedao/ph-clint-app").RemovePowerhousePackageAction;
61
+ addPackageDocumentType: (input: import("@powerhousedao/ph-clint-app").AddPackageDocumentTypeInput) => import("@powerhousedao/ph-clint-app").AddPackageDocumentTypeAction;
62
+ removePackageDocumentType: (input: import("@powerhousedao/ph-clint-app").RemovePackageDocumentTypeInput) => import("@powerhousedao/ph-clint-app").RemovePackageDocumentTypeAction;
63
+ setPackageVersion: (input: import("@powerhousedao/ph-clint-app").SetPackageVersionInput) => import("@powerhousedao/ph-clint-app").SetPackageVersionAction;
64
+ enableRoutine: (input: import("@powerhousedao/ph-clint-app").EnableRoutineInput) => import("@powerhousedao/ph-clint-app").EnableRoutineAction;
65
+ disableRoutine: (input: import("@powerhousedao/ph-clint-app").DisableRoutineInput) => import("@powerhousedao/ph-clint-app").DisableRoutineAction;
66
+ setPowerhouseLevel: (input: import("@powerhousedao/ph-clint-app").SetPowerhouseLevelInput) => import("@powerhousedao/ph-clint-app").SetPowerhouseLevelAction;
67
+ setDescription: (input: import("@powerhousedao/ph-clint-app").SetDescriptionInput) => import("@powerhousedao/ph-clint-app").SetDescriptionAction;
68
+ setVersion: (input: import("@powerhousedao/ph-clint-app").SetVersionInput) => import("@powerhousedao/ph-clint-app").SetVersionAction;
69
+ setPackageIdentifier: (input: import("@powerhousedao/ph-clint-app").SetPackageIdentifierInput) => import("@powerhousedao/ph-clint-app").SetPackageIdentifierAction;
70
+ setName: (name: string | {
71
+ name: string;
72
+ }) => import("document-model").SetNameAction;
73
+ setPreferredEditor: (input: string | null | {
74
+ preferredEditor: string | null;
75
+ }) => import("document-model").SetPreferredEditorAction;
76
+ undo: (count?: number, scope?: string) => import("document-model").UndoAction;
77
+ redo: (count?: number, scope?: string) => import("document-model").RedoAction;
78
+ prune: (start?: number, end?: number, scope?: string) => import("document-model").SchemaPruneAction;
79
+ loadState: <TState extends import("document-model").PHBaseState = import("document-model").PHBaseState>(state: TState & {
80
+ name: string;
81
+ }, operations: number) => import("document-model").LoadStateAction;
82
+ noop: (scope?: string) => import("document-model").NOOPAction;
83
+ };
84
+ readonly utils: import("document-model").DocumentModelUtils<import("@powerhousedao/ph-clint-app").PhClintProjectPHState>;
85
+ readonly documentModel: import("document-model").DocumentModelPHState;
86
+ }]>>;
@@ -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
+ });
@@ -0,0 +1,3 @@
1
+ export declare const CLI_ROOT: string;
2
+ export declare const CLI_NAME: string;
3
+ export declare const CLI_VERSION: string;
package/dist/config.js ADDED
@@ -0,0 +1,5 @@
1
+ import { readPackageInfo } from '@powerhousedao/ph-clint';
2
+ const pkg = readPackageInfo(import.meta.url);
3
+ export const CLI_ROOT = pkg.root;
4
+ export const CLI_NAME = pkg.name.replace(/-cli$/, '');
5
+ export const CLI_VERSION = pkg.version;