prjct-cli 1.6.7 → 1.6.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +56 -5
  2. package/core/agentic/chain-of-thought.ts +3 -1
  3. package/core/agentic/ground-truth.ts +12 -5
  4. package/core/agentic/index.ts +14 -2
  5. package/core/agentic/memory-system.ts +86 -23
  6. package/core/agentic/services.ts +1 -1
  7. package/core/agentic/template-executor.ts +4 -4
  8. package/core/agentic/template-loader.ts +2 -8
  9. package/core/bus/bus.ts +0 -1
  10. package/core/bus/index.ts +1 -1
  11. package/core/cli/start.ts +0 -2
  12. package/core/commands/base.ts +2 -2
  13. package/core/commands/planning.ts +1 -1
  14. package/core/constants/index.ts +19 -0
  15. package/core/context/generator.ts +0 -2
  16. package/core/context-tools/files-tool.ts +0 -6
  17. package/core/context-tools/imports-tool.ts +0 -6
  18. package/core/context-tools/recent-tool.ts +0 -6
  19. package/core/context-tools/signatures-tool.ts +0 -6
  20. package/core/context-tools/summary-tool.ts +0 -6
  21. package/core/context-tools/token-counter.ts +0 -13
  22. package/core/infrastructure/agent-detector.ts +0 -13
  23. package/core/infrastructure/ai-provider.ts +0 -29
  24. package/core/infrastructure/author-detector.ts +0 -14
  25. package/core/infrastructure/config-manager.ts +1 -1
  26. package/core/infrastructure/setup.ts +0 -3
  27. package/core/plugin/hooks.ts +0 -2
  28. package/core/plugin/index.ts +0 -13
  29. package/core/plugin/loader.ts +0 -2
  30. package/core/plugin/registry.ts +0 -2
  31. package/core/services/agent-service.ts +1 -1
  32. package/core/services/context-generator.ts +1 -1
  33. package/core/services/diff-generator.ts +0 -12
  34. package/core/services/hooks-service.ts +0 -1
  35. package/core/services/memory-service.ts +1 -1
  36. package/core/services/project-service.ts +1 -1
  37. package/core/services/sync-service.ts +1 -1
  38. package/core/services/watch-service.ts +1 -1
  39. package/core/storage/index.ts +1 -1
  40. package/core/storage/storage.ts +0 -2
  41. package/core/utils/animations.ts +0 -18
  42. package/core/utils/cache.ts +0 -6
  43. package/core/utils/collection-filters.ts +0 -24
  44. package/core/utils/date-helper.ts +0 -20
  45. package/core/utils/file-helper.ts +0 -26
  46. package/core/utils/help.ts +0 -9
  47. package/core/utils/jsonl-helper.ts +0 -21
  48. package/core/utils/markdown-builder.ts +0 -3
  49. package/core/utils/next-steps.ts +0 -2
  50. package/core/utils/runtime.ts +0 -11
  51. package/core/utils/session-helper.ts +0 -12
  52. package/core/utils/version.ts +0 -12
  53. package/core/workflow/workflow-preferences.ts +4 -13
  54. package/dist/bin/prjct.mjs +200 -300
  55. package/dist/core/infrastructure/command-installer.js +1 -26
  56. package/dist/core/infrastructure/setup.js +1 -28
  57. package/dist/core/utils/version.js +0 -11
  58. package/package.json +1 -1
@@ -48,16 +48,3 @@ export {
48
48
  initializePlugins,
49
49
  shutdownPlugins,
50
50
  }
51
-
52
- export default {
53
- HookSystem,
54
- HookPoints,
55
- hookSystem,
56
- hooks,
57
- PluginLoader,
58
- pluginLoader,
59
- PluginRegistry,
60
- pluginRegistry,
61
- initializePlugins,
62
- shutdownPlugins,
63
- }
@@ -352,5 +352,3 @@ class PluginLoader {
352
352
  const pluginLoader = new PluginLoader()
353
353
 
354
354
  export { PluginLoader, pluginLoader, type Plugin }
355
-
356
- export default { PluginLoader, pluginLoader }
@@ -324,5 +324,3 @@ class PluginRegistry {
324
324
  const pluginRegistry = new PluginRegistry()
325
325
 
326
326
  export { PluginRegistry, pluginRegistry, type PluginMetadata, type PluginInfo }
327
-
328
- export default { PluginRegistry, pluginRegistry }
@@ -6,7 +6,7 @@
6
6
 
7
7
  import AgentRouter from '../agentic/agent-router'
8
8
  import { AgentError } from '../errors'
9
- import agentDetector from '../infrastructure/agent-detector'
9
+ import * as agentDetector from '../infrastructure/agent-detector'
10
10
  import type { AgentAssignmentResult, AgentInfo, ProjectContext } from '../types'
11
11
 
12
12
  // Valid agent types - whitelist for security (prevents path traversal)
@@ -13,7 +13,7 @@ import fs from 'node:fs/promises'
13
13
  import path from 'node:path'
14
14
  import pathManager from '../infrastructure/path-manager'
15
15
  import { type ContextSources, cite, defaultSources } from '../utils/citations'
16
- import dateHelper from '../utils/date-helper'
16
+ import * as dateHelper from '../utils/date-helper'
17
17
  import { mergePreservedSections, validatePreserveBlocks } from '../utils/preserve-sections'
18
18
  import { NestedContextResolver } from './nested-context-resolver'
19
19
 
@@ -342,15 +342,3 @@ export function formatFullDiff(diff: SyncDiff, options: DiffOptions = {}): strin
342
342
 
343
343
  return lines.join('\n')
344
344
  }
345
-
346
- // =============================================================================
347
- // Exports
348
- // =============================================================================
349
-
350
- export default {
351
- generateSyncDiff,
352
- formatDiffPreview,
353
- formatFullDiff,
354
- estimateTokens,
355
- parseMarkdownSections,
356
- }
@@ -683,4 +683,3 @@ class HooksService {
683
683
  }
684
684
 
685
685
  export const hooksService = new HooksService()
686
- export default { hooksService }
@@ -9,7 +9,7 @@ import pathManager from '../infrastructure/path-manager'
9
9
  import type { MemoryServiceEntry } from '../types'
10
10
  import { getErrorMessage, isNotFoundError } from '../types/fs'
11
11
  import { getTimestamp } from '../utils/date-helper'
12
- import jsonlHelper from '../utils/jsonl-helper'
12
+ import * as jsonlHelper from '../utils/jsonl-helper'
13
13
 
14
14
  export class MemoryService {
15
15
  /**
@@ -5,7 +5,7 @@
5
5
  */
6
6
 
7
7
  import { ProjectError } from '../errors'
8
- import authorDetector from '../infrastructure/author-detector'
8
+ import * as authorDetector from '../infrastructure/author-detector'
9
9
  import configManager from '../infrastructure/config-manager'
10
10
  import pathManager from '../infrastructure/path-manager'
11
11
  import type { Author, CommandResult } from '../types'
@@ -33,7 +33,7 @@ import configManager from '../infrastructure/config-manager'
33
33
  import pathManager from '../infrastructure/path-manager'
34
34
  import { metricsStorage } from '../storage/metrics-storage'
35
35
  import { type ContextSources, defaultSources, type SourceInfo } from '../utils/citations'
36
- import dateHelper from '../utils/date-helper'
36
+ import * as dateHelper from '../utils/date-helper'
37
37
  import log from '../utils/logger'
38
38
  import { ContextFileGenerator } from './context-generator'
39
39
  import type { SyncDiff } from './diff-generator'
@@ -14,7 +14,7 @@ import chalk from 'chalk'
14
14
  import chokidar, { type FSWatcher } from 'chokidar'
15
15
  import configManager from '../infrastructure/config-manager'
16
16
  import { getErrorMessage } from '../types/fs'
17
- import dateHelper from '../utils/date-helper'
17
+ import * as dateHelper from '../utils/date-helper'
18
18
  import { syncService } from './sync-service'
19
19
 
20
20
  // ============================================================================
@@ -79,6 +79,6 @@ export { shippedStorage } from './shipped-storage'
79
79
  export { stateStorage } from './state-storage'
80
80
 
81
81
  // ========== GRANULAR STORAGE (Legacy) ==========
82
- export { default, getStorage } from './storage'
82
+ export { getStorage } from './storage'
83
83
  // ========== AGGREGATE STORAGE (Recommended) ==========
84
84
  export { StorageManager } from './storage-manager'
@@ -175,5 +175,3 @@ class FileStorage implements Storage {
175
175
  export function getStorage(projectId: string): Storage {
176
176
  return new FileStorage(projectId)
177
177
  }
178
-
179
- export default { getStorage }
@@ -249,21 +249,3 @@ ${divider}
249
249
  ${colors.dim('Keep shipping! 🚀')}
250
250
  `
251
251
  }
252
-
253
- // Default export for CommonJS compatibility
254
- export default {
255
- colors,
256
- frames,
257
- banners,
258
- animate,
259
- typeWriter,
260
- progressBar,
261
- sparkle,
262
- formatShip,
263
- formatFocus,
264
- formatSuccess,
265
- formatError,
266
- formatIdea,
267
- formatCleanup,
268
- formatRecap,
269
- }
@@ -185,9 +185,3 @@ export class LazyCache<T> {
185
185
  return !this.loaded || this.data === null
186
186
  }
187
187
  }
188
-
189
- // Default export for CommonJS compatibility
190
- export default {
191
- TTLCache,
192
- LazyCache,
193
- }
@@ -207,27 +207,3 @@ export function uniqueByField<T, K extends keyof T>(items: T[], field: K): T[] {
207
207
  return true
208
208
  })
209
209
  }
210
-
211
- // Default export for CommonJS compatibility
212
- export default {
213
- PRIORITY_ORDER,
214
- SECTION_ORDER,
215
- filterByField,
216
- filterByFieldIn,
217
- filterByFieldNot,
218
- filterActiveByField,
219
- filterByTruthy,
220
- filterByFalsy,
221
- sortByPriority,
222
- sortBySectionAndPriority,
223
- sortByDate,
224
- filterByDateRange,
225
- filterByLastDays,
226
- groupByField,
227
- countByField,
228
- take,
229
- takeLast,
230
- findByField,
231
- anyByField,
232
- uniqueByField,
233
- }
@@ -164,23 +164,3 @@ export function getEndOfDay(date: Date): Date {
164
164
  result.setHours(23, 59, 59, 999)
165
165
  return result
166
166
  }
167
-
168
- // Default export for CommonJS compatibility
169
- export default {
170
- formatDate,
171
- formatMonth,
172
- getTodayKey,
173
- getDateKey,
174
- getYearMonthDay,
175
- parseDate,
176
- getTimestamp,
177
- getDaysAgo,
178
- getDaysFromNow,
179
- getDateRange,
180
- isToday,
181
- isWithinLastDays,
182
- formatDuration,
183
- calculateDuration,
184
- getStartOfDay,
185
- getEndOfDay,
186
- }
@@ -267,29 +267,3 @@ export function getFileExtension(filePath: string): string {
267
267
  export function getFileNameWithoutExtension(filePath: string): string {
268
268
  return path.basename(filePath, path.extname(filePath))
269
269
  }
270
-
271
- // Default export for CommonJS compatibility
272
- export default {
273
- readJson,
274
- writeJson,
275
- readFile,
276
- writeFile,
277
- atomicWrite,
278
- appendToFile,
279
- appendLine,
280
- prependToFile,
281
- fileExists,
282
- dirExists,
283
- ensureDir,
284
- deleteFile,
285
- deleteDir,
286
- listFiles,
287
- getFileSize,
288
- getFileModifiedTime,
289
- copyFile,
290
- moveFile,
291
- readLines,
292
- writeLines,
293
- getFileExtension,
294
- getFileNameWithoutExtension,
295
- }
@@ -312,12 +312,3 @@ export function getHelp(topic?: string): string {
312
312
 
313
313
  return formatCommandHelp(topic)
314
314
  }
315
-
316
- export default {
317
- formatMainHelp,
318
- formatCommandHelp,
319
- formatCommandList,
320
- formatTerminalCommandHelp,
321
- formatAgentCommandHelp,
322
- getHelp,
323
- }
@@ -288,24 +288,3 @@ export async function checkFileSizeWarning(
288
288
 
289
289
  return { sizeMB, isLarge }
290
290
  }
291
-
292
- // Default export for CommonJS compatibility
293
- export default {
294
- parseJsonLines,
295
- stringifyJsonLines,
296
- readJsonLines,
297
- writeJsonLines,
298
- appendJsonLine,
299
- appendJsonLines,
300
- filterJsonLines,
301
- countJsonLines,
302
- getLastJsonLines,
303
- getFirstJsonLines,
304
- mergeJsonLines,
305
- isJsonLinesEmpty,
306
- readJsonLinesStreaming,
307
- getFileSizeMB,
308
- rotateJsonLinesIfNeeded,
309
- appendJsonLineWithRotation,
310
- checkFileSizeWarning,
311
- }
@@ -278,6 +278,3 @@ export class MarkdownBuilder {
278
278
  export function md(): MarkdownBuilder {
279
279
  return new MarkdownBuilder()
280
280
  }
281
-
282
- // Default export
283
- export default { MarkdownBuilder, md }
@@ -91,5 +91,3 @@ export function showStateInfo(state: WorkflowState): void {
91
91
  const info = workflowStateMachine.getStateInfo(state)
92
92
  console.log(chalk.dim(`📍 State: ${chalk.white(state.toUpperCase())} - ${info.description}`))
93
93
  }
94
-
95
- export default { showNextSteps, getNextSteps, showStateInfo }
@@ -106,14 +106,3 @@ export function getRunCommand(scriptPath: string, args: string[] = []): string {
106
106
 
107
107
  return `node ${scriptPath}${argsStr}`
108
108
  }
109
-
110
- export default {
111
- detectRuntime,
112
- isBunAvailable,
113
- isNodeAvailable,
114
- getRuntimeVersion,
115
- isBun,
116
- isNode,
117
- getPreferredRuntime,
118
- getRunCommand,
119
- }
@@ -276,15 +276,3 @@ export async function cleanEmptySessionDirs(
276
276
 
277
277
  return cleaned
278
278
  }
279
-
280
- // Default export for CommonJS compatibility
281
- export default {
282
- getTodaySessionFilePath,
283
- ensureTodaySessionDir,
284
- writeToSession,
285
- readTodaySession,
286
- readRecentSessions,
287
- getSessionStats,
288
- archiveOldSessions,
289
- cleanEmptySessionDirs,
290
- }
@@ -123,15 +123,3 @@ export function needsMigration(fromVersion: string, toVersion: string | null = n
123
123
 
124
124
  export const VERSION = getVersion()
125
125
  export const PACKAGE_ROOT = getPackageRoot()
126
-
127
- // Default export for CommonJS compatibility
128
- export default {
129
- getVersion,
130
- getPackageRoot,
131
- getPackageInfo,
132
- compareVersions,
133
- isCompatible,
134
- needsMigration,
135
- VERSION,
136
- PACKAGE_ROOT,
137
- }
@@ -17,6 +17,7 @@ import { exec } from 'node:child_process'
17
17
  import { promisify } from 'node:util'
18
18
  import chalk from 'chalk'
19
19
  import memorySystem from '../agentic/memory-system'
20
+ import { WORKFLOW_HELP } from '../constants'
20
21
  import { getErrorMessage } from '../types/fs'
21
22
 
22
23
  const execAsync = promisify(exec)
@@ -265,7 +266,7 @@ export function formatWorkflowPreferences(
265
266
  }>
266
267
  ): string {
267
268
  if (preferences.length === 0) {
268
- return `${chalk.dim('No workflow preferences configured.')}\n\nSet one: "p. workflow antes de ship corre los tests"`
269
+ return `${chalk.dim(WORKFLOW_HELP.NO_PREFERENCES)}\n\nSet one: "${WORKFLOW_HELP.SET_EXAMPLE}"`
269
270
  }
270
271
 
271
272
  const lines: string[] = ['', 'WORKFLOW PREFERENCES', '────────────────────────────']
@@ -282,8 +283,8 @@ export function formatWorkflowPreferences(
282
283
  }
283
284
 
284
285
  lines.push('')
285
- lines.push(chalk.dim('Modify: "p. workflow antes de ship corre npm test"'))
286
- lines.push(chalk.dim('Remove: "p. workflow quita el hook de ship"'))
286
+ lines.push(chalk.dim(`Modify: "${WORKFLOW_HELP.MODIFY_EXAMPLE}"`))
287
+ lines.push(chalk.dim(`Remove: "${WORKFLOW_HELP.REMOVE_EXAMPLE}"`))
287
288
 
288
289
  return lines.join('\n')
289
290
  }
@@ -295,13 +296,3 @@ export function clearSessionPreferences(): void {
295
296
  sessionPreferences.clear()
296
297
  oncePreferences.clear()
297
298
  }
298
-
299
- export default {
300
- setWorkflowPreference,
301
- getWorkflowPreferences,
302
- runWorkflowHooks,
303
- listWorkflowPreferences,
304
- removeWorkflowPreference,
305
- formatWorkflowPreferences,
306
- clearSessionPreferences,
307
- }