@promptscript/cli 1.0.0-alpha.0 → 1.0.0-alpha.10

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 (39) hide show
  1. package/CHANGELOG.md +362 -0
  2. package/README.md +56 -9
  3. package/index.js +14646 -10439
  4. package/package.json +29 -17
  5. package/src/cli.d.ts.map +1 -1
  6. package/src/commands/compile.d.ts +2 -1
  7. package/src/commands/compile.d.ts.map +1 -1
  8. package/src/commands/diff.d.ts.map +1 -1
  9. package/src/commands/init.d.ts.map +1 -1
  10. package/src/commands/pull.d.ts +1 -2
  11. package/src/commands/pull.d.ts.map +1 -1
  12. package/src/commands/update-check.d.ts +6 -0
  13. package/src/commands/update-check.d.ts.map +1 -0
  14. package/src/commands/validate.d.ts.map +1 -1
  15. package/src/index.d.ts +3 -0
  16. package/src/index.d.ts.map +1 -1
  17. package/src/output/console.d.ts +15 -1
  18. package/src/output/console.d.ts.map +1 -1
  19. package/src/prettier/index.d.ts +2 -0
  20. package/src/prettier/index.d.ts.map +1 -0
  21. package/src/prettier/loader.d.ts +36 -0
  22. package/src/prettier/loader.d.ts.map +1 -0
  23. package/src/services.d.ts +1 -0
  24. package/src/services.d.ts.map +1 -1
  25. package/src/templates/migrate-skill.d.ts +9 -0
  26. package/src/templates/migrate-skill.d.ts.map +1 -0
  27. package/src/types.d.ts +12 -2
  28. package/src/types.d.ts.map +1 -1
  29. package/src/utils/ai-tools-detector.d.ts +11 -1
  30. package/src/utils/ai-tools-detector.d.ts.map +1 -1
  31. package/src/utils/manifest-loader.d.ts +157 -0
  32. package/src/utils/manifest-loader.d.ts.map +1 -0
  33. package/src/utils/registry-resolver.d.ts +41 -0
  34. package/src/utils/registry-resolver.d.ts.map +1 -0
  35. package/src/utils/suggestion-engine.d.ts +56 -0
  36. package/src/utils/suggestion-engine.d.ts.map +1 -0
  37. package/src/utils/version-check.d.ts +48 -0
  38. package/src/utils/version-check.d.ts.map +1 -0
  39. package/package.publish.json +0 -32
@@ -0,0 +1,56 @@
1
+ import type { RegistryManifest, SuggestionResult, ProjectContext, CatalogEntry } from '@promptscript/core';
2
+ import type { ProjectInfo } from './project-detector.js';
3
+ import type { CliServices } from '../services.js';
4
+ /**
5
+ * Build project context from detected project info.
6
+ */
7
+ export declare function buildProjectContext(projectInfo: ProjectInfo, services?: CliServices): Promise<ProjectContext>;
8
+ /**
9
+ * Calculate suggestions based on project context and manifest rules.
10
+ *
11
+ * @param manifest - The registry manifest with suggestion rules
12
+ * @param context - Project context with detected features
13
+ * @returns Suggestions with reasoning
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const suggestions = calculateSuggestions(manifest, {
18
+ * files: ['package.json', 'tsconfig.json'],
19
+ * dependencies: ['react', 'typescript'],
20
+ * languages: ['typescript'],
21
+ * frameworks: ['react']
22
+ * });
23
+ * // suggestions.inherit = '@stacks/react'
24
+ * // suggestions.use = ['@fragments/testing', '@fragments/typescript']
25
+ * ```
26
+ */
27
+ export declare function calculateSuggestions(manifest: RegistryManifest, context: ProjectContext): SuggestionResult;
28
+ /**
29
+ * Get catalog entries that match detection hints for a project context.
30
+ */
31
+ export declare function getMatchingCatalogEntries(manifest: RegistryManifest, context: ProjectContext): Array<{
32
+ entry: CatalogEntry;
33
+ reason: string;
34
+ }>;
35
+ /**
36
+ * Format suggestion result for display.
37
+ */
38
+ export declare function formatSuggestionResult(result: SuggestionResult): string[];
39
+ /**
40
+ * Create interactive choices from suggestions.
41
+ */
42
+ export declare function createSuggestionChoices(manifest: RegistryManifest, result: SuggestionResult): Array<{
43
+ name: string;
44
+ value: string;
45
+ checked: boolean;
46
+ description?: string;
47
+ }>;
48
+ /**
49
+ * Parse selected choices back into a suggestion result.
50
+ */
51
+ export declare function parseSelectedChoices(selected: string[]): {
52
+ inherit?: string;
53
+ use: string[];
54
+ skills: string[];
55
+ };
56
+ //# sourceMappingURL=suggestion-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestion-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EAAE,CAAC;CAClB,CAiBA"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Result of a version check.
3
+ */
4
+ export interface UpdateInfo {
5
+ currentVersion: string;
6
+ latestVersion: string;
7
+ updateAvailable: boolean;
8
+ }
9
+ /**
10
+ * Get the cache directory path.
11
+ * Uses ~/.promptscript/.cache/ for consistency with Git registry cache.
12
+ *
13
+ * - All platforms: ~/.promptscript/.cache/
14
+ */
15
+ export declare function getCacheDir(): string;
16
+ /**
17
+ * Get the full path to the version cache file.
18
+ */
19
+ export declare function getCachePath(): string;
20
+ /**
21
+ * Fetch the latest version from npm registry.
22
+ * Returns null on any network error.
23
+ */
24
+ export declare function fetchLatestVersion(): Promise<string | null>;
25
+ /**
26
+ * Check for updates automatically (respects cache).
27
+ * Called from preAction hook.
28
+ *
29
+ * @param currentVersion - The current CLI version
30
+ * @returns Update info if a newer version is available, null otherwise
31
+ */
32
+ export declare function checkForUpdates(currentVersion: string): Promise<UpdateInfo | null>;
33
+ /**
34
+ * Force check for updates (ignores cache).
35
+ * Used by the update-check command.
36
+ *
37
+ * @param currentVersion - The current CLI version
38
+ * @returns Update info with check result
39
+ */
40
+ export declare function forceCheckForUpdates(currentVersion: string): Promise<{
41
+ info: UpdateInfo | null;
42
+ error: boolean;
43
+ }>;
44
+ /**
45
+ * Print the update notification message.
46
+ */
47
+ export declare function printUpdateNotification(info: UpdateInfo): void;
48
+ //# sourceMappingURL=version-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-check.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/utils/version-check.ts"],"names":[],"mappings":"AAkBA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AA+CD;;;GAGG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA+BjE;AAoCD;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAgDxF;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC;IAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAwBtD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAI9D"}
@@ -1,32 +0,0 @@
1
- {
2
- "name": "@promptscript/cli",
3
- "version": "0.0.1",
4
- "description": "CLI for PromptScript - The Infrastructure-as-Code for AI Context",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/mrwogu/promptscript.git",
8
- "directory": "packages/cli"
9
- },
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "type": "module",
14
- "main": "./index.js",
15
- "bin": {
16
- "prs": "./bin/prs.js",
17
- "promptscript": "./bin/prs.js"
18
- },
19
- "dependencies": {
20
- "@inquirer/prompts": "^8.2.0",
21
- "chalk": "^5.6.2",
22
- "chokidar": "^5.0.0",
23
- "commander": "^14.0.2",
24
- "ora": "^9.0.0",
25
- "yaml": "^2.8.2"
26
- },
27
- "engines": {
28
- "node": ">=18"
29
- },
30
- "keywords": ["promptscript", "ai", "cli", "copilot", "claude", "cursor"],
31
- "license": "MIT"
32
- }