@powerhousedao/ph-clint-cli 0.1.0-dev.38 → 0.1.0-dev.39

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.
@@ -64,10 +64,14 @@ export function buildCliPackageJson(spec) {
64
64
  dependencies['@powerhousedao/shared'] = POWERHOUSE_VERSION;
65
65
  dependencies['document-model'] = POWERHOUSE_VERSION;
66
66
  // External reactor packages (non-app) as versioned dependencies.
67
+ // Compare bare names (without scope) so that a spec entry with
68
+ // packageName "foo-app" still matches the scoped "@scope/foo-app".
69
+ const appBare = appPkg.replace(/^@[^/]+\//, '');
67
70
  for (const pkg of spec.packages) {
68
- if (pkg.packageName !== appPkg) {
69
- dependencies[pkg.packageName] = 'latest';
70
- }
71
+ const pkgBare = pkg.packageName.replace(/^@[^/]+\//, '');
72
+ if (pkgBare === appBare)
73
+ continue;
74
+ dependencies[pkg.packageName] = 'latest';
71
75
  }
72
76
  }
73
77
  const scripts = {
@@ -92,7 +96,7 @@ export function buildCliPackageJson(spec) {
92
96
  scripts['publish:production'] = 'ph-publish production -c ./publish.config.js';
93
97
  }
94
98
  if (spec.deployment.serviceAnnouncement) {
95
- scripts['test-service-registry'] = 'vetra-graphql-registry --withAuth';
99
+ scripts['test-service-registry'] = 'json-post-registry --withAuth';
96
100
  }
97
101
  const pkg = {
98
102
  name: pkgName,
@@ -114,6 +118,7 @@ export function buildCliPackageJson(spec) {
114
118
  'ts-jest': '^29.4.6',
115
119
  tsx: '^4.19.0',
116
120
  typescript: '^6.0.2',
121
+ 'typescript-eslint': '^8.33.0',
117
122
  };
118
123
  pkg.engines = { node: '>=22.13.0' };
119
124
  return JSON.stringify(pkg, null, 2) + '\n';
@@ -21,7 +21,7 @@ export function buildCliTs(spec) {
21
21
  if (phAtLeast(ph, 'Reactor'))
22
22
  phClintImports.push('buildDefaultReactor');
23
23
  if (spec.deployment.serviceAnnouncement)
24
- phClintImports.push('vetraGraphqlAnnounce');
24
+ phClintImports.push('jsonPostAnnounce');
25
25
  lines.push(`import { ${phClintImports.join(', ')} } from '@powerhousedao/ph-clint';`);
26
26
  if (needsRoot) {
27
27
  lines.push("import path from 'node:path';");
@@ -105,7 +105,7 @@ export function buildCliTs(spec) {
105
105
  if (spec.deployment.serviceAnnouncement) {
106
106
  lines.push(' serviceAnnouncement: {');
107
107
  lines.push(' enabled: true,');
108
- lines.push(' announce: (payload, ctx) => vetraGraphqlAnnounce(payload, ctx),');
108
+ lines.push(' announce: (payload, ctx) => jsonPostAnnounce(payload, ctx),');
109
109
  lines.push(' },');
110
110
  }
111
111
  lines.push(' // @clint:end serviceAnnouncement');
@@ -118,10 +118,10 @@ export function buildCliTs(spec) {
118
118
  lines.push(' `Workdir: ${workdir}`,');
119
119
  lines.push(" '',");
120
120
  if (mastra.enabled) {
121
- lines.push(" 'Type a message to talk to the agent, or /help for commands.',");
121
+ lines.push(" 'Type a message to talk to the agent, or / for commands.',");
122
122
  }
123
123
  else {
124
- lines.push(" 'Type /help for commands.',");
124
+ lines.push(" 'Type / for commands or /cli-docs for help.',");
125
125
  }
126
126
  lines.push(" ].join('\\n'),");
127
127
  lines.push(' },');
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Builds `eslint.config.js` for the CLI — placeholder flat config.
2
+ * Builds `eslint.config.js` for the CLI — minimal TypeScript-ESLint config.
3
3
  */
4
4
  export declare function buildEslintConfigJs(): string;
@@ -1,12 +1,15 @@
1
1
  /**
2
- * Builds `eslint.config.js` for the CLI — placeholder flat config.
2
+ * Builds `eslint.config.js` for the CLI — minimal TypeScript-ESLint config.
3
3
  */
4
4
  export function buildEslintConfigJs() {
5
5
  return [
6
6
  '// @clint:begin eslint',
7
- '// Placeholder ESLint flat config — replaced by codegen when the',
8
- "// project's lint stack is configured.",
9
- 'export default [];',
7
+ "import tseslint from 'typescript-eslint';",
8
+ '',
9
+ 'export default tseslint.config(',
10
+ ' tseslint.configs.recommended,',
11
+ " { ignores: ['dist/', 'gen/', 'coverage/'] },",
12
+ ');',
10
13
  '// @clint:end eslint',
11
14
  '',
12
15
  ].join('\n');
@@ -21,6 +21,7 @@ import { buildDemoAgentTs } from './demo-agent-ts.js';
21
21
  import { buildFrameworkGenTs } from './framework-gen-ts.js';
22
22
  import { buildFrameworkTs } from './framework-ts.js';
23
23
  import { buildManifestJson } from './manifest-json.js';
24
+ import { buildSmokeTestTs } from './smoke-test-ts.js';
24
25
  import { type ClintProjectSpec } from '../../spec/types.js';
25
26
  /**
26
27
  * A spec-driven file builder. Returns `null` from `build` to indicate the
@@ -44,7 +45,7 @@ export interface FileBuilder {
44
45
  */
45
46
  export declare function getProfileFileBuilders(spec: ClintProjectSpec): FileBuilder[];
46
47
  export declare const CLI_FILE_BUILDERS: FileBuilder[];
47
- export { buildCliPackageJson, buildCliTs, buildConfigTs, buildMainTs, buildTsconfigJson, buildJestConfigJs, buildEslintConfigJs, buildGitignore, buildMastraIndexTs, buildBuildSkillsScript, buildAgentBaseMd, buildAgentTs, buildDemoAgentTs, buildFrameworkGenTs, buildFrameworkTs, buildManifestJson, };
48
+ export { buildCliPackageJson, buildCliTs, buildConfigTs, buildMainTs, buildTsconfigJson, buildJestConfigJs, buildEslintConfigJs, buildGitignore, buildMastraIndexTs, buildBuildSkillsScript, buildAgentBaseMd, buildAgentTs, buildDemoAgentTs, buildFrameworkGenTs, buildFrameworkTs, buildManifestJson, buildSmokeTestTs, };
48
49
  export { buildRootPackageJson } from './root-package-json.js';
49
50
  export { buildPublishConfigJs } from './publish-config-js.js';
50
51
  export { buildReadme } from './readme-md.js';
@@ -21,6 +21,7 @@ import { buildDemoAgentTs } from './demo-agent-ts.js';
21
21
  import { buildFrameworkGenTs } from './framework-gen-ts.js';
22
22
  import { buildFrameworkTs } from './framework-ts.js';
23
23
  import { buildManifestJson } from './manifest-json.js';
24
+ import { buildSmokeTestTs } from './smoke-test-ts.js';
24
25
  /**
25
26
  * Generate dynamic file builders for agent profile markdown files.
26
27
  * One file per profile in `prompts/agent-profiles/{id}.md`.
@@ -75,9 +76,9 @@ export const CLI_FILE_BUILDERS = [
75
76
  },
76
77
  { relativePath: 'prompts/skills-tpl/.gitkeep', build: () => '' },
77
78
  { relativePath: 'prompts/skills-ext/.gitkeep', build: () => '' },
78
- { relativePath: 'tests/.gitkeep', build: () => '' },
79
+ { relativePath: 'tests/smoke.test.ts', build: buildSmokeTestTs, initOnly: true },
79
80
  ];
80
- export { buildCliPackageJson, buildCliTs, buildConfigTs, buildMainTs, buildTsconfigJson, buildJestConfigJs, buildEslintConfigJs, buildGitignore, buildMastraIndexTs, buildBuildSkillsScript, buildAgentBaseMd, buildAgentTs, buildDemoAgentTs, buildFrameworkGenTs, buildFrameworkTs, buildManifestJson, };
81
+ export { buildCliPackageJson, buildCliTs, buildConfigTs, buildMainTs, buildTsconfigJson, buildJestConfigJs, buildEslintConfigJs, buildGitignore, buildMastraIndexTs, buildBuildSkillsScript, buildAgentBaseMd, buildAgentTs, buildDemoAgentTs, buildFrameworkGenTs, buildFrameworkTs, buildManifestJson, buildSmokeTestTs, };
81
82
  export { buildRootPackageJson } from './root-package-json.js';
82
83
  export { buildPublishConfigJs } from './publish-config-js.js';
83
84
  export { buildReadme } from './readme-md.js';
@@ -22,9 +22,7 @@ export function buildRootPackageJson(spec) {
22
22
  test: both('test'),
23
23
  dev: prefix(cli, 'dev'),
24
24
  start: prefix(cli, 'start'),
25
- lint: prefix(cli, 'lint'),
26
- 'app:dev': prefix(app, 'dev'),
27
- 'cli:dev': prefix(cli, 'dev'),
25
+ lint: both('lint'),
28
26
  'publish:dev': `${prefix(cli, 'exec ph-publish')} dev -c ../publish.config.js`,
29
27
  'publish:staging': `${prefix(cli, 'exec ph-publish')} staging -c ../publish.config.js`,
30
28
  'publish:production': `${prefix(cli, 'exec ph-publish')} production -c ../publish.config.js`,
@@ -0,0 +1,2 @@
1
+ import { type ClintProjectSpec } from '../../spec/types.js';
2
+ export declare function buildSmokeTestTs(spec: ClintProjectSpec): string;
@@ -0,0 +1,15 @@
1
+ import { getBinName } from '../../spec/types.js';
2
+ export function buildSmokeTestTs(spec) {
3
+ const bin = getBinName(spec);
4
+ return [
5
+ `import { describe, it, expect } from '@jest/globals';`,
6
+ ``,
7
+ `describe('${bin}', () => {`,
8
+ ` it('loads without error', async () => {`,
9
+ ` const { cli } = await import('../src/cli.js');`,
10
+ ` expect(cli).toBeDefined();`,
11
+ ` });`,
12
+ `});`,
13
+ ``,
14
+ ].join('\n');
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/ph-clint-cli",
3
- "version": "0.1.0-dev.38",
3
+ "version": "0.1.0-dev.39",
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.38",
33
- "@powerhousedao/ph-clint-app": "^0.1.0-dev.38",
34
- "@powerhousedao/ph-clint-dev": "^0.1.0-dev.38",
32
+ "@powerhousedao/ph-clint": "^0.1.0-dev.39",
33
+ "@powerhousedao/ph-clint-app": "^0.1.0-dev.39",
34
+ "@powerhousedao/ph-clint-dev": "^0.1.0-dev.39",
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",