trinity-method-sdk 2.0.6 → 2.0.8

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.
@@ -98,7 +98,7 @@ export async function deploy(options) {
98
98
  PACKAGE_MANAGER: stack.packageManager || 'npm',
99
99
  BACKEND_FRAMEWORK: stack.framework,
100
100
  CURRENT_DATE: new Date().toISOString(),
101
- TRINITY_VERSION: pkg.version || '2.0.6',
101
+ TRINITY_VERSION: pkg.version || '2.0.8',
102
102
  };
103
103
  // STEP 4: Create directory structure
104
104
  const directoriesCreated = await createDirectories(spinner);
@@ -39,7 +39,7 @@ async function deployRootClaudeMarkdown(templatesPath, variables) {
39
39
  */
40
40
  async function deployVersionFile(pkgVersion) {
41
41
  const versionPath = validatePath('trinity/VERSION');
42
- await fs.writeFile(versionPath, pkgVersion || '2.0.6');
42
+ await fs.writeFile(versionPath, pkgVersion || '2.0.8');
43
43
  return 1;
44
44
  }
45
45
  /**
@@ -24,7 +24,7 @@ export async function installSDK(spinner) {
24
24
  if (!packageJson.dependencies) {
25
25
  packageJson.dependencies = {};
26
26
  }
27
- packageJson.dependencies['trinity-method-sdk'] = '^2.0.6';
27
+ packageJson.dependencies['trinity-method-sdk'] = '^2.0.8';
28
28
  await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });
29
29
  spinner.text = 'Installing Trinity Method SDK (this may take a moment)...';
30
30
  // Install dependencies
@@ -21,9 +21,18 @@ export async function updateAgents(spinner, stats) {
21
21
  const sourcePath = path.join(agentsTemplatePath, agentDir);
22
22
  const targetPath = path.join('.claude/agents', agentDir);
23
23
  if (await fs.pathExists(sourcePath)) {
24
- await fs.copy(sourcePath, targetPath, { overwrite: true });
24
+ await fs.ensureDir(targetPath);
25
25
  const files = await fs.readdir(sourcePath);
26
- stats.agentsUpdated += files.length;
26
+ // Copy each file individually, stripping .template extension
27
+ for (const file of files) {
28
+ if (file.endsWith('.md.template')) {
29
+ const sourceFile = path.join(sourcePath, file);
30
+ const deployedFileName = file.replace('.template', '');
31
+ const targetFile = path.join(targetPath, deployedFileName);
32
+ await fs.copy(sourceFile, targetFile, { overwrite: true });
33
+ stats.agentsUpdated++;
34
+ }
35
+ }
27
36
  }
28
37
  }
29
38
  spinner.succeed(`Agents updated (${stats.agentsUpdated} files)`);
@@ -40,10 +40,13 @@ export async function update(options) {
40
40
  await runUpdatePreflightChecks(spinner);
41
41
  // STEP 2: Version check
42
42
  const versionInfo = await detectInstalledSDKVersion(spinner);
43
- if (versionInfo.isUpToDate) {
43
+ if (versionInfo.isUpToDate && !options.force) {
44
44
  console.log(chalk.green('✅ Already up to date\n'));
45
45
  return;
46
46
  }
47
+ if (options.force && versionInfo.isUpToDate) {
48
+ console.log(chalk.yellow('⚠️ Forcing update (already at latest version)\n'));
49
+ }
47
50
  // STEP 3: Dry-run preview or confirmation
48
51
  if (options.dryRun) {
49
52
  displayDryRunPreview(versionInfo.currentVersion, versionInfo.latestVersion);
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Update Templates Module
3
- * Handles updating work order template files
3
+ * Handles updating work order, documentation, and investigation template files
4
4
  * @module cli/commands/update/templates
5
5
  */
6
6
  import { Ora } from 'ora';
7
7
  import { UpdateStats } from './types.js';
8
8
  /**
9
- * Update work order templates from SDK to trinity/templates/
9
+ * Update template files from SDK to trinity/templates/
10
10
  * @param spinner - ora spinner instance for status display
11
11
  * @param stats - update statistics to track progress
12
12
  */
@@ -1,25 +1,40 @@
1
1
  /**
2
2
  * Update Templates Module
3
- * Handles updating work order template files
3
+ * Handles updating work order, documentation, and investigation template files
4
4
  * @module cli/commands/update/templates
5
5
  */
6
6
  import fs from 'fs-extra';
7
7
  import path from 'path';
8
8
  import { getSDKPath } from './utils.js';
9
+ /** Template directories to update */
10
+ const TEMPLATE_DIRS = ['work-orders', 'documentation', 'investigations'];
9
11
  /**
10
- * Update work order templates from SDK to trinity/templates/
12
+ * Update template files from SDK to trinity/templates/
11
13
  * @param spinner - ora spinner instance for status display
12
14
  * @param stats - update statistics to track progress
13
15
  */
14
16
  export async function updateTemplates(spinner, stats) {
15
- spinner.start('Updating work order templates...');
17
+ spinner.start('Updating templates...');
16
18
  const sdkPath = await getSDKPath();
17
- const woTemplatePath = path.join(sdkPath, 'dist/templates/work-orders');
18
- if (await fs.pathExists(woTemplatePath)) {
19
- await fs.copy(woTemplatePath, 'trinity/templates', { overwrite: true });
20
- const files = await fs.readdir(woTemplatePath);
21
- stats.templatesUpdated = files.length;
19
+ const sdkTemplatesPath = path.join(sdkPath, 'dist/templates');
20
+ for (const templateDir of TEMPLATE_DIRS) {
21
+ const sourcePath = path.join(sdkTemplatesPath, templateDir);
22
+ const targetPath = path.join('trinity/templates', templateDir);
23
+ if (await fs.pathExists(sourcePath)) {
24
+ await fs.ensureDir(targetPath);
25
+ const files = await fs.readdir(sourcePath);
26
+ // Copy each file individually, stripping .template extension
27
+ for (const file of files) {
28
+ if (file.endsWith('.md.template')) {
29
+ const sourceFile = path.join(sourcePath, file);
30
+ const deployedFileName = file.replace('.template', '');
31
+ const targetFile = path.join(targetPath, deployedFileName);
32
+ await fs.copy(sourceFile, targetFile, { overwrite: true });
33
+ stats.templatesUpdated++;
34
+ }
35
+ }
36
+ }
22
37
  }
23
- spinner.succeed(`Work order templates updated (${stats.templatesUpdated} files)`);
38
+ spinner.succeed(`Templates updated (${stats.templatesUpdated} files)`);
24
39
  }
25
40
  //# sourceMappingURL=templates.js.map
package/dist/cli/index.js CHANGED
@@ -31,6 +31,7 @@ program
31
31
  .description('Update Trinity Method to latest version')
32
32
  .option('--all', 'Update all registered Trinity projects')
33
33
  .option('--dry-run', 'Preview changes without writing files')
34
+ .option('--force', 'Force update even if already up to date')
34
35
  .action(errorHandler.wrap(update));
35
36
  program.parse();
36
37
  //# sourceMappingURL=index.js.map
@@ -16,6 +16,7 @@ export interface DeployOptions {
16
16
  export interface UpdateOptions {
17
17
  all?: boolean;
18
18
  dryRun?: boolean;
19
+ force?: boolean;
19
20
  }
20
21
  export interface LintingTool {
21
22
  id: string;
@@ -12,6 +12,7 @@ const COMMON_SOURCE_DIRS = [
12
12
  'database',
13
13
  'packages',
14
14
  'apps',
15
+ 'bot',
15
16
  ];
16
17
  // Nested directory patterns (2-level and 3-level)
17
18
  const NESTED_PATTERNS = [
@@ -30,12 +31,17 @@ const NESTED_PATTERNS = [
30
31
  ['client', 'src'],
31
32
  ['client', 'lib'],
32
33
  ['client', 'app'],
34
+ // 2-level patterns - bot variations
35
+ ['bot', 'src'],
36
+ ['bot', 'lib'],
37
+ ['bot', 'app'],
33
38
  // 2-level patterns - src nested
34
39
  ['src', 'backend'],
35
40
  ['src', 'frontend'],
36
41
  ['src', 'database'],
37
42
  ['src', 'server'],
38
43
  ['src', 'client'],
44
+ ['src', 'bot'],
39
45
  // 3-level patterns - src nested deeply
40
46
  ['src', 'backend', 'src'],
41
47
  ['src', 'backend', 'lib'],
@@ -24,7 +24,7 @@ const VARIABLE_RESOLVERS = {
24
24
  DEPLOYMENT_TIMESTAMP: (v) => toString(v.DEPLOYMENT_TIMESTAMP || v.timestamp) || new Date().toISOString(),
25
25
  LANGUAGE: (v) => toString(v.LANGUAGE || v.language) || 'Unknown',
26
26
  PACKAGE_MANAGER: (v) => toString(v.PACKAGE_MANAGER || v.packageManager) || 'npm',
27
- TRINITY_VERSION: (v) => toString(v.TRINITY_VERSION) || '2.0.6',
27
+ TRINITY_VERSION: (v) => toString(v.TRINITY_VERSION) || '2.0.8',
28
28
  TECHNOLOGY_STACK: (v) => toString(v.TECHNOLOGY_STACK || v.TECH_STACK || v.techStack) || 'Unknown',
29
29
  PRIMARY_FRAMEWORK: (v) => toString(v.PRIMARY_FRAMEWORK || v.FRAMEWORK || v.framework) || 'Generic',
30
30
  CURRENT_DATE: (v) => toString(v.CURRENT_DATE) || new Date().toISOString().split('T')[0],