@tayo-dev/rtl 1.0.0 → 1.2.0

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 (87) hide show
  1. package/README.md +89 -86
  2. package/assets/claude/commands/@tayo-dev/rtl/generate.md +15 -0
  3. package/assets/claude/commands/@tayo-dev/rtl/help.md +16 -0
  4. package/assets/codex/@tayo-dev/rtl-conventions/SKILL.md +19 -0
  5. package/assets/codex/@tayo-dev/rtl-generate/SKILL.md +27 -0
  6. package/assets/codex/@tayo-dev/rtl-help/SKILL.md +25 -0
  7. package/assets/codex/@tayo-dev/rtl-mocks/SKILL.md +22 -0
  8. package/assets/gemini/commands/@tayo-dev/rtl/generate.toml +10 -0
  9. package/assets/gemini/commands/@tayo-dev/rtl/help.toml +11 -0
  10. package/assets/opencode/commands/@tayo-dev/rtl-generate.md +11 -0
  11. package/assets/opencode/commands/@tayo-dev/rtl-help.md +12 -0
  12. package/dist/cli/commands/install.d.ts +22 -0
  13. package/dist/cli/commands/install.d.ts.map +1 -0
  14. package/dist/cli/commands/install.js +69 -0
  15. package/dist/cli/commands/install.js.map +1 -0
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +10 -4
  18. package/dist/index.js.map +1 -1
  19. package/dist/install/assets.d.ts +5 -0
  20. package/dist/install/assets.d.ts.map +1 -0
  21. package/dist/install/assets.js +23 -0
  22. package/dist/install/assets.js.map +1 -0
  23. package/dist/install/executor.d.ts +4 -0
  24. package/dist/install/executor.d.ts.map +1 -0
  25. package/dist/install/executor.js +26 -0
  26. package/dist/install/executor.js.map +1 -0
  27. package/dist/install/manifest.d.ts +21 -0
  28. package/dist/install/manifest.d.ts.map +1 -0
  29. package/dist/install/manifest.js +45 -0
  30. package/dist/install/manifest.js.map +1 -0
  31. package/dist/install/options.d.ts +13 -0
  32. package/dist/install/options.d.ts.map +1 -0
  33. package/dist/install/options.js +87 -0
  34. package/dist/install/options.js.map +1 -0
  35. package/dist/install/planner.d.ts +8 -0
  36. package/dist/install/planner.d.ts.map +1 -0
  37. package/dist/install/planner.js +31 -0
  38. package/dist/install/planner.js.map +1 -0
  39. package/dist/install/prompts.d.ts +9 -0
  40. package/dist/install/prompts.d.ts.map +1 -0
  41. package/dist/install/prompts.js +98 -0
  42. package/dist/install/prompts.js.map +1 -0
  43. package/dist/install/registry.d.ts +3 -0
  44. package/dist/install/registry.d.ts.map +1 -0
  45. package/dist/install/registry.js +47 -0
  46. package/dist/install/registry.js.map +1 -0
  47. package/dist/install/resolver.d.ts +8 -0
  48. package/dist/install/resolver.d.ts.map +1 -0
  49. package/dist/install/resolver.js +20 -0
  50. package/dist/install/resolver.js.map +1 -0
  51. package/dist/install/runtimes/claude.d.ts +3 -0
  52. package/dist/install/runtimes/claude.d.ts.map +1 -0
  53. package/dist/install/runtimes/claude.js +8 -0
  54. package/dist/install/runtimes/claude.js.map +1 -0
  55. package/dist/install/runtimes/codex.d.ts +3 -0
  56. package/dist/install/runtimes/codex.d.ts.map +1 -0
  57. package/dist/install/runtimes/codex.js +51 -0
  58. package/dist/install/runtimes/codex.js.map +1 -0
  59. package/dist/install/runtimes/gemini.d.ts +3 -0
  60. package/dist/install/runtimes/gemini.d.ts.map +1 -0
  61. package/dist/install/runtimes/gemini.js +8 -0
  62. package/dist/install/runtimes/gemini.js.map +1 -0
  63. package/dist/install/runtimes/opencode.d.ts +3 -0
  64. package/dist/install/runtimes/opencode.d.ts.map +1 -0
  65. package/dist/install/runtimes/opencode.js +8 -0
  66. package/dist/install/runtimes/opencode.js.map +1 -0
  67. package/dist/install/runtimes/prompt-runtimes.d.ts +3 -0
  68. package/dist/install/runtimes/prompt-runtimes.d.ts.map +1 -0
  69. package/dist/install/runtimes/prompt-runtimes.js +74 -0
  70. package/dist/install/runtimes/prompt-runtimes.js.map +1 -0
  71. package/dist/install/summary.d.ts +12 -0
  72. package/dist/install/summary.d.ts.map +1 -0
  73. package/dist/install/summary.js +112 -0
  74. package/dist/install/summary.js.map +1 -0
  75. package/dist/install/types.d.ts +119 -0
  76. package/dist/install/types.d.ts.map +1 -0
  77. package/dist/install/types.js +5 -0
  78. package/dist/install/types.js.map +1 -0
  79. package/dist/install/verification.d.ts +3 -0
  80. package/dist/install/verification.d.ts.map +1 -0
  81. package/dist/install/verification.js +34 -0
  82. package/dist/install/verification.js.map +1 -0
  83. package/dist/install/writer.d.ts +11 -0
  84. package/dist/install/writer.d.ts.map +1 -0
  85. package/dist/install/writer.js +99 -0
  86. package/dist/install/writer.js.map +1 -0
  87. package/package.json +3 -1
@@ -0,0 +1,74 @@
1
+ import { join } from 'node:path';
2
+ import { resolveAssetSource } from '../assets.js';
3
+ const PROMPT_RUNTIME_ASSETS = {
4
+ claude: [
5
+ {
6
+ id: 'help',
7
+ kind: 'command',
8
+ sourceSegments: ['commands', '@tayo-dev', 'rtl', 'help.md'],
9
+ destinationSegments: ['commands', '@tayo-dev', 'rtl', 'help.md'],
10
+ entrypoint: '/@tayo-dev/rtl:help',
11
+ },
12
+ {
13
+ id: 'generate',
14
+ kind: 'command',
15
+ sourceSegments: ['commands', '@tayo-dev', 'rtl', 'generate.md'],
16
+ destinationSegments: ['commands', '@tayo-dev', 'rtl', 'generate.md'],
17
+ entrypoint: '/@tayo-dev/rtl:generate',
18
+ },
19
+ ],
20
+ gemini: [
21
+ {
22
+ id: 'help',
23
+ kind: 'command',
24
+ sourceSegments: ['commands', '@tayo-dev', 'rtl', 'help.toml'],
25
+ destinationSegments: ['commands', '@tayo-dev', 'rtl', 'help.toml'],
26
+ entrypoint: '/@tayo-dev/rtl:help',
27
+ },
28
+ {
29
+ id: 'generate',
30
+ kind: 'command',
31
+ sourceSegments: ['commands', '@tayo-dev', 'rtl', 'generate.toml'],
32
+ destinationSegments: ['commands', '@tayo-dev', 'rtl', 'generate.toml'],
33
+ entrypoint: '/@tayo-dev/rtl:generate',
34
+ },
35
+ ],
36
+ opencode: [
37
+ {
38
+ id: 'help',
39
+ kind: 'command',
40
+ sourceSegments: ['commands', '@tayo-dev', 'rtl-help.md'],
41
+ destinationSegments: ['commands', '@tayo-dev', 'rtl-help.md'],
42
+ entrypoint: '/@tayo-dev/rtl-help',
43
+ },
44
+ {
45
+ id: 'generate',
46
+ kind: 'command',
47
+ sourceSegments: ['commands', '@tayo-dev', 'rtl-generate.md'],
48
+ destinationSegments: ['commands', '@tayo-dev', 'rtl-generate.md'],
49
+ entrypoint: '/@tayo-dev/rtl-generate',
50
+ },
51
+ ],
52
+ };
53
+ function isPromptRuntime(runtime) {
54
+ return runtime === 'claude' || runtime === 'gemini' || runtime === 'opencode';
55
+ }
56
+ export function buildPromptRuntimeOperations(target, fromModuleUrl = import.meta.url) {
57
+ if (!isPromptRuntime(target.id)) {
58
+ throw new Error(`Prompt runtime operations do not support ${target.id}.`);
59
+ }
60
+ return PROMPT_RUNTIME_ASSETS[target.id].map((asset) => {
61
+ const relativeDestinationPath = join(...asset.destinationSegments);
62
+ return {
63
+ assetId: asset.id,
64
+ runtime: target.id,
65
+ location: target.location,
66
+ kind: asset.kind,
67
+ sourcePath: resolveAssetSource(target.id, asset.sourceSegments, fromModuleUrl),
68
+ relativeDestinationPath,
69
+ targetPath: join(target.destinationDirectory, relativeDestinationPath),
70
+ entrypoint: asset.entrypoint,
71
+ };
72
+ });
73
+ }
74
+ //# sourceMappingURL=prompt-runtimes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-runtimes.js","sourceRoot":"","sources":["../../../src/install/runtimes/prompt-runtimes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAUjD,MAAM,qBAAqB,GAA0D;IACnF,MAAM,EAAE;QACN;YACE,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,SAAS;YACf,cAAc,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,CAAC;YAC3D,mBAAmB,EAAE,CAAC,UA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CACF,CAAA;AAED,SAAS,eAAe,CAAC,OAAsB;IAC7C,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,UAAU,CAAA;AAC/E,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,MAA6B,EAC7B,gBAAwB,MAAM,CAAC,IAAI,CAAC,GAAG;IAEvC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,4CAA4C,MAAM,CAAC,EAAE,GAAG,CAAC,CAAA;IAC3E,CAAC;IAED,OAAO,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACpD,MAAM,uBAAuB,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,mBAAmB,CAAC,CAAA;QAElE,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,EAAE;YACjB,OAAO,EAAE,MAAM,CAAC,EAAE;YAClB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,UAAU,EAAE,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,cAAc,EAAE,aAAa,CAAC;YAC9E,uBAAuB;YACvB,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC;YACtE,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { stdin, stdout } from 'node:process';
2
+ import type { InstallExecutionResult, InstallPlan } from './types.js';
3
+ interface PromptIO {
4
+ input?: typeof stdin;
5
+ output?: typeof stdout;
6
+ }
7
+ export declare function renderInstallSummary(plan: InstallPlan): string;
8
+ export declare function confirmInstallPlan(plan: InstallPlan, io?: PromptIO): Promise<boolean>;
9
+ export declare function renderInstallCancelledMessage(): string;
10
+ export declare function renderInstallExecutionResult(result: InstallExecutionResult): string;
11
+ export {};
12
+ //# sourceMappingURL=summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/install/summary.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE5C,OAAO,KAAK,EACV,sBAAsB,EACtB,WAAW,EAEZ,MAAM,YAAY,CAAA;AAEnB,UAAU,QAAQ;IAChB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,MAAM,CAAA;CACvB;AAkBD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAa9D;AAED,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,WAAW,EACjB,EAAE,GAAE,QAA2C,GAC9C,OAAO,CAAC,OAAO,CAAC,CA0BlB;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD;AAgCD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAsCnF"}
@@ -0,0 +1,112 @@
1
+ import { homedir } from 'node:os';
2
+ import { relative } from 'node:path';
3
+ import { createInterface } from 'node:readline/promises';
4
+ import { stdin, stdout } from 'node:process';
5
+ import pc from 'picocolors';
6
+ function formatTargetDirectory(target) {
7
+ const homeDirectory = homedir();
8
+ if (target.location === 'global' && target.destinationDirectory.startsWith(homeDirectory)) {
9
+ const suffix = relative(homeDirectory, target.destinationDirectory);
10
+ return suffix.length > 0 ? `~/${suffix}` : '~';
11
+ }
12
+ if (target.location === 'local') {
13
+ const suffix = relative(process.cwd(), target.destinationDirectory);
14
+ return suffix.length > 0 ? `./${suffix}` : '.';
15
+ }
16
+ return target.destinationDirectory;
17
+ }
18
+ export function renderInstallSummary(plan) {
19
+ const lines = plan.targets.map((target) => {
20
+ const assetCount = target.operations.length;
21
+ const label = assetCount === 1 ? 'asset' : 'assets';
22
+ return `- ${target.displayName}: ${target.location} (${formatTargetDirectory(target)}) — ${assetCount} ${label}`;
23
+ });
24
+ return [
25
+ pc.bold(`Install plan for ${plan.packageName}`),
26
+ ...lines,
27
+ '',
28
+ pc.dim('No files will be written until confirmation completes.'),
29
+ ].join('\n');
30
+ }
31
+ export async function confirmInstallPlan(plan, io = { input: stdin, output: stdout }) {
32
+ const rl = createInterface({
33
+ input: io.input ?? stdin,
34
+ output: io.output ?? stdout,
35
+ });
36
+ try {
37
+ while (true) {
38
+ const answer = await rl.question(`Proceed with the ${plan.targets.length}-target install plan? [y/N]: `);
39
+ const normalized = answer.trim().toLowerCase();
40
+ if (normalized === '' || normalized === 'n' || normalized === 'no') {
41
+ return false;
42
+ }
43
+ if (normalized === 'y' || normalized === 'yes') {
44
+ return true;
45
+ }
46
+ console.log(pc.yellow('Answer `y` to continue or `n` to cancel.'));
47
+ }
48
+ }
49
+ finally {
50
+ rl.close();
51
+ }
52
+ }
53
+ export function renderInstallCancelledMessage() {
54
+ return 'Install cancelled. Nothing changed.';
55
+ }
56
+ function renderResultLine(target) {
57
+ if (target.status === 'installed') {
58
+ return `- ${target.displayName}: wrote ${target.writtenFiles.length} asset(s) to ${target.destinationDirectory} (${target.verificationCommand})`;
59
+ }
60
+ if (target.status === 'updated') {
61
+ return `- ${target.displayName}: updated ${target.writtenFiles.length} owned asset(s) in ${target.destinationDirectory} (${target.verificationCommand})`;
62
+ }
63
+ if (target.status === 'repaired') {
64
+ return `- ${target.displayName}: repaired ${target.writtenFiles.length} owned asset(s) in ${target.destinationDirectory} (${target.verificationCommand})`;
65
+ }
66
+ const blockedReasons = target.conflicts
67
+ .map((conflict) => {
68
+ if (conflict.kind === 'installer-owned-modified') {
69
+ return `protected manual edit at ${conflict.targetPath}`;
70
+ }
71
+ if (conflict.kind === 'external-collision') {
72
+ return `external collision at ${conflict.targetPath}`;
73
+ }
74
+ return `${conflict.kind} at ${conflict.targetPath}`;
75
+ })
76
+ .join('; ');
77
+ return `- ${target.displayName}: blocked by ${blockedReasons}`;
78
+ }
79
+ export function renderInstallExecutionResult(result) {
80
+ const heading = result.status === 'installed'
81
+ ? pc.green('Install complete.')
82
+ : result.status === 'partial'
83
+ ? pc.yellow('Install finished with conflicts.')
84
+ : pc.red('Install blocked.');
85
+ const verificationLines = result.targets
86
+ .filter((target) => target.status !== 'blocked')
87
+ .map((target) => {
88
+ if (target.verification?.status === 'verified') {
89
+ return `- ${target.displayName}: ${target.verificationCommand} (verified at ${target.verification.checkedPath})`;
90
+ }
91
+ if (target.verification?.status === 'missing-installed-assets') {
92
+ return `- ${target.displayName}: ${target.verificationCommand} (missing ${target.verification.missingPaths.join(', ')})`;
93
+ }
94
+ return `- ${target.displayName}: ${target.verificationCommand} (verification metadata missing)`;
95
+ });
96
+ const manifestLines = result.targets
97
+ .filter((target) => target.status !== 'blocked' && target.manifestPath)
98
+ .map((target) => `- ${target.displayName}: ${target.manifestPath}`);
99
+ return [
100
+ heading,
101
+ ...result.targets.map(renderResultLine),
102
+ verificationLines.length > 0 ? '' : null,
103
+ verificationLines.length > 0 ? 'Verification commands:' : null,
104
+ ...verificationLines,
105
+ manifestLines.length > 0 ? '' : null,
106
+ manifestLines.length > 0 ? 'Ownership markers:' : null,
107
+ ...manifestLines,
108
+ ]
109
+ .filter((line) => Boolean(line))
110
+ .join('\n');
111
+ }
112
+ //# sourceMappingURL=summary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.js","sourceRoot":"","sources":["../../src/install/summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAE,MAAM,YAAY,CAAA;AAY3B,SAAS,qBAAqB,CA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I;QACxC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,IAAI;QAC9D,GAAG,iBAAiB;QACpB,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;QACpC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI;QACtD,GAAG,aAAa;KACjB;SACE,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;SAC/C,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC"}
@@ -0,0 +1,119 @@
1
+ export declare const SUPPORTED_RUNTIMES: readonly ["claude", "opencode", "gemini", "codex"];
2
+ export declare const INSTALL_LOCATIONS: readonly ["global", "local"];
3
+ export declare const RUNTIME_FAMILIES: readonly ["prompt", "skill"];
4
+ export declare const INSTALL_ASSET_KINDS: readonly ["prompt", "command", "skill", "manifest"];
5
+ export type RuntimeTarget = (typeof SUPPORTED_RUNTIMES)[number];
6
+ export type InstallLocation = (typeof INSTALL_LOCATIONS)[number];
7
+ export type RuntimeFamily = (typeof RUNTIME_FAMILIES)[number];
8
+ export type InstallAssetKind = (typeof INSTALL_ASSET_KINDS)[number];
9
+ export type InstallSelectionSource = 'flags' | 'prompt' | 'mixed';
10
+ export interface InstallCommandOptions {
11
+ claude?: boolean;
12
+ opencode?: boolean;
13
+ gemini?: boolean;
14
+ codex?: boolean;
15
+ all?: boolean;
16
+ global?: boolean;
17
+ local?: boolean;
18
+ }
19
+ export type RuntimeLocationMap = Partial<Record<RuntimeTarget, InstallLocation>>;
20
+ export type RuntimeLocationSelections = Record<RuntimeTarget, InstallLocation>;
21
+ export interface NormalizedInstallOptions {
22
+ mode: 'interactive' | 'non-interactive';
23
+ runtimes: RuntimeTarget[];
24
+ locations: RuntimeLocationMap;
25
+ needsRuntimePrompt: boolean;
26
+ runtimesNeedingLocation: RuntimeTarget[];
27
+ source: InstallSelectionSource;
28
+ }
29
+ export interface InstallSelection {
30
+ mode: 'interactive' | 'non-interactive';
31
+ runtimes: RuntimeTarget[];
32
+ locations: RuntimeLocationSelections;
33
+ source: InstallSelectionSource;
34
+ }
35
+ export interface RuntimeAssetDefinition {
36
+ id: string;
37
+ kind: InstallAssetKind;
38
+ sourceSegments: string[];
39
+ destinationSegments: string[];
40
+ entrypoint?: string;
41
+ }
42
+ export interface RuntimeDefinition {
43
+ id: RuntimeTarget;
44
+ displayName: string;
45
+ family: RuntimeFamily;
46
+ globalDirectorySegments: string[];
47
+ localDirectoryName: string;
48
+ packageContainerSegments: string[];
49
+ verificationCommand: string;
50
+ ownershipMarkerFileName: string;
51
+ assets: RuntimeAssetDefinition[];
52
+ }
53
+ export interface ResolvedInstallTarget extends RuntimeDefinition {
54
+ location: InstallLocation;
55
+ destinationDirectory: string;
56
+ }
57
+ export interface InstallOwnedFile {
58
+ relativePath: string;
59
+ kind: InstallAssetKind;
60
+ checksum?: string;
61
+ }
62
+ export interface InstallFileOperation {
63
+ assetId: string;
64
+ runtime: RuntimeTarget;
65
+ location: InstallLocation;
66
+ kind: InstallAssetKind;
67
+ sourcePath: string;
68
+ relativeDestinationPath: string;
69
+ targetPath: string;
70
+ entrypoint?: string;
71
+ }
72
+ export interface PlannedInstallTarget extends ResolvedInstallTarget {
73
+ operations: InstallFileOperation[];
74
+ }
75
+ export interface RuntimeVerificationResult {
76
+ verificationCommand: string;
77
+ status: 'verified' | 'missing-entrypoint' | 'missing-installed-assets';
78
+ checkedPath?: string;
79
+ missingPaths: string[];
80
+ }
81
+ export interface InstallOwnershipManifest {
82
+ packageName: '@tayo-dev/rtl';
83
+ runtime: RuntimeTarget;
84
+ location: InstallLocation;
85
+ manifestVersion: 1;
86
+ generatedAt: string;
87
+ files: InstallOwnedFile[];
88
+ }
89
+ export type InstallAssetConflictKind = 'missing' | 'installer-owned' | 'installer-owned-modified' | 'external-collision';
90
+ export interface InstallAssetConflict {
91
+ kind: InstallAssetConflictKind;
92
+ targetPath: string;
93
+ }
94
+ export interface InstallPlan {
95
+ packageName: '@tayo-dev/rtl';
96
+ commandName: 'taro';
97
+ stage: 'prewrite-preview' | 'ready-to-write';
98
+ source: InstallSelectionSource;
99
+ mode: 'interactive' | 'non-interactive';
100
+ targets: PlannedInstallTarget[];
101
+ }
102
+ export interface RuntimeInstallResult {
103
+ runtime: RuntimeTarget;
104
+ displayName: string;
105
+ location: InstallLocation;
106
+ destinationDirectory: string;
107
+ verificationCommand: string;
108
+ status: 'installed' | 'updated' | 'repaired' | 'blocked';
109
+ writtenFiles: string[];
110
+ manifestPath?: string;
111
+ conflicts: InstallAssetConflict[];
112
+ verification?: RuntimeVerificationResult;
113
+ }
114
+ export interface InstallExecutionResult {
115
+ packageName: '@tayo-dev/rtl';
116
+ status: 'installed' | 'partial' | 'blocked';
117
+ targets: RuntimeInstallResult[];
118
+ }
119
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/install/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,oDAAqD,CAAA;AACpF,eAAO,MAAM,iBAAiB,8BAA+B,CAAA;AAC7D,eAAO,MAAM,gBAAgB,8BAA+B,CAAA;AAC5D,eAAO,MAAM,mBAAmB,qDAAsD,CAAA;AAEtF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AAC/D,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAC7D,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AACnE,MAAM,MAAM,s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AAA;IACnB,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAC1B;AAED,MAAM,MAAM,wBAAwB,GAChC,SAAS,GACT,iBAAiB,GACjB,0BAA0B,GAC1B,oBAAoB,CAAA;AAExB,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,wBAAwB,CAAA;IAC9B,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,eAAe,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,kBAAkB,GAAG,gBAAgB,CAAA;IAC5C,MAAM,EAAE,sBAAsB,CAAA;IAC9B,IAAI,EAAE,aAAa,GAAG,iBAAiB,CAAA;IACvC,OAAO,EAAE,oBAAoB,EAAE,CAAA;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,aAAa,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,eAAe,CAAA;IACzB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAA;IACxD,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,oBAAoB,EAAE,CAAA;IACjC,YAAY,CAAC,EAAE,yBAAyB,CAAA;CACzC;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,eAAe,CAAA;IAC5B,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,SAAS,CAAA;IAC3C,OAAO,EAAE,oBAAoB,EAAE,CAAA;CAChC"}
@@ -0,0 +1,5 @@
1
+ export const SUPPORTED_RUNTIMES = ['claude', 'opencode', 'gemini', 'codex'];
2
+ export const INSTALL_LOCATIONS = ['global', 'local'];
3
+ export const RUNTIME_FAMILIES = ['prompt', 'skill'];
4
+ export const INSTALL_ASSET_KINDS = ['prompt', 'command', 'skill', 'manifest'];
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/install/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAA;AACpF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAA;AAC7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU,CAAA;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,CAAU,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { PlannedInstallTarget, RuntimeVerificationResult } from './types.js';
2
+ export declare function verifyInstalledRuntime(target: PlannedInstallTarget): Promise<RuntimeVerificationResult>;
3
+ //# sourceMappingURL=verification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/install/verification.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAWjF,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,yBAAyB,CAAC,CA4BpC"}
@@ -0,0 +1,34 @@
1
+ import { access } from 'node:fs/promises';
2
+ async function pathExists(path) {
3
+ try {
4
+ await access(path);
5
+ return true;
6
+ }
7
+ catch {
8
+ return false;
9
+ }
10
+ }
11
+ export async function verifyInstalledRuntime(target) {
12
+ const entrypointOperation = target.operations.find((operation) => operation.entrypoint === target.verificationCommand);
13
+ if (!entrypointOperation) {
14
+ return {
15
+ verificationCommand: target.verificationCommand,
16
+ status: 'missing-entrypoint',
17
+ missingPaths: [],
18
+ };
19
+ }
20
+ const missingPaths = [];
21
+ for (const operation of target.operations) {
22
+ const exists = await pathExists(operation.targetPath);
23
+ if (!exists) {
24
+ missingPaths.push(operation.targetPath);
25
+ }
26
+ }
27
+ return {
28
+ verificationCommand: target.verificationCommand,
29
+ status: missingPaths.length > 0 ? 'missing-installed-assets' : 'verified',
30
+ checkedPath: entrypointOperation.targetPath,
31
+ missingPaths,
32
+ };
33
+ }
34
+ //# sourceMappingURL=verification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification.js","sourceRoot":"","sources":["../../src/install/verification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGzC,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,CAAC,CAAA;QAClB,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAA4B;IAE5B,MAAM,mBAAmB,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAChD,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,KAAK,MAAM,CAAC,mBAAmB,CACnE,CAAA;IAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzB,OAAO;YACL,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;YAC/C,MAAM,EAAE,oBAAoB;YAC5B,YAAY,EAAE,EAAE;SACjB,CAAA;IACH,CAAC;IAED,MAAM,YAAY,GAAa,EAAE,CAAA;IAEjC,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QACrD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QACzC,CAAC;IACH,CAAC;IAED,OAAO;QACL,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,MAAM,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,UAAU;QACzE,WAAW,EAAE,mBAAmB,CAAC,UAAU;QAC3C,YAAY;KACb,CAAA;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { InstallAssetConflict, PlannedInstallTarget, RuntimeInstallResult } from './types.js';
2
+ export interface ReplaceConfirmationRequest {
3
+ target: PlannedInstallTarget;
4
+ conflicts: InstallAssetConflict[];
5
+ }
6
+ export interface WriteInstallPlanOptions {
7
+ confirmReplace?: (request: ReplaceConfirmationRequest) => Promise<boolean>;
8
+ generatedAt?: string;
9
+ }
10
+ export declare function writeInstallPlan(target: PlannedInstallTarget, options?: WriteInstallPlanOptions): Promise<RuntimeInstallResult>;
11
+ //# sourceMappingURL=writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/install/writer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,oBAAoB,EAGpB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,YAAY,CAAA;AAEnB,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,oBAAoB,CAAA;IAC5B,SAAS,EAAE,oBAAoB,EAAE,CAAA;CAClC;AAED,MAAM,WAAW,uBAAuB;IACtC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAuBD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,oBAAoB,EAC5B,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,oBAAoB,CAAC,CAsG/B"}
@@ -0,0 +1,99 @@
1
+ import { copyFile, mkdir, readFile, writeFile } from 'node:fs/promises';
2
+ import { dirname, join } from 'node:path';
3
+ import { classifyAssetConflict, createOwnedFile, createOwnershipManifest, } from './manifest.js';
4
+ async function readOwnershipManifest(manifestPath) {
5
+ try {
6
+ const manifestContent = await readFile(manifestPath, 'utf8');
7
+ const manifest = JSON.parse(manifestContent);
8
+ return manifest.packageName === '@tayo-dev/rtl' ? manifest : null;
9
+ }
10
+ catch (error) {
11
+ const fsError = error;
12
+ if (fsError.code === 'ENOENT') {
13
+ return null;
14
+ }
15
+ return null;
16
+ }
17
+ }
18
+ export async function writeInstallPlan(target, options = {}) {
19
+ const manifestPath = join(target.destinationDirectory, target.ownershipMarkerFileName);
20
+ const manifest = await readOwnershipManifest(manifestPath);
21
+ const conflicts = [];
22
+ const writeActions = new Map();
23
+ for (const operation of target.operations) {
24
+ let existingContent = null;
25
+ try {
26
+ existingContent = await readFile(operation.targetPath, 'utf8');
27
+ }
28
+ catch (error) {
29
+ const fsError = error;
30
+ if (fsError.code !== 'ENOENT') {
31
+ throw error;
32
+ }
33
+ }
34
+ const conflict = classifyAssetConflict({
35
+ targetPath: operation.targetPath,
36
+ existingContent,
37
+ manifest,
38
+ relativePath: operation.relativeDestinationPath,
39
+ });
40
+ if (conflict.kind !== 'missing') {
41
+ conflicts.push(conflict);
42
+ if (conflict.kind === 'installer-owned') {
43
+ writeActions.set(operation.targetPath, 'updated');
44
+ }
45
+ continue;
46
+ }
47
+ const ownedFileExists = Boolean(manifest?.files.find((file) => file.relativePath === operation.relativeDestinationPath));
48
+ writeActions.set(operation.targetPath, ownedFileExists ? 'repaired' : 'created');
49
+ }
50
+ if (conflicts.some((conflict) => conflict.kind === 'installer-owned-modified' ||
51
+ conflict.kind === 'external-collision')) {
52
+ return {
53
+ runtime: target.id,
54
+ displayName: target.displayName,
55
+ location: target.location,
56
+ destinationDirectory: target.destinationDirectory,
57
+ verificationCommand: target.verificationCommand,
58
+ status: 'blocked',
59
+ writtenFiles: [],
60
+ manifestPath,
61
+ conflicts,
62
+ };
63
+ }
64
+ const ownedFiles = [];
65
+ const writtenFiles = [];
66
+ for (const operation of target.operations) {
67
+ await mkdir(dirname(operation.targetPath), { recursive: true });
68
+ await copyFile(operation.sourcePath, operation.targetPath);
69
+ const writtenContent = await readFile(operation.sourcePath, 'utf8');
70
+ ownedFiles.push(createOwnedFile({
71
+ relativePath: operation.relativeDestinationPath,
72
+ kind: operation.kind,
73
+ content: writtenContent,
74
+ }));
75
+ writtenFiles.push(operation.targetPath);
76
+ }
77
+ const ownershipManifest = createOwnershipManifest({
78
+ runtime: target.id,
79
+ location: target.location,
80
+ generatedAt: options.generatedAt,
81
+ files: ownedFiles,
82
+ });
83
+ await mkdir(dirname(manifestPath), { recursive: true });
84
+ await writeFile(`${manifestPath}`, `${JSON.stringify(ownershipManifest, null, 2)}\n`);
85
+ const actionSet = new Set(writeActions.values());
86
+ const status = actionSet.has('repaired') ? 'repaired' : actionSet.has('updated') ? 'updated' : 'installed';
87
+ return {
88
+ runtime: target.id,
89
+ displayName: target.displayName,
90
+ location: target.location,
91
+ destinationDirectory: target.destinationDirectory,
92
+ verificationCommand: target.verificationCommand,
93
+ status,
94
+ writtenFiles,
95
+ manifestPath,
96
+ conflicts,
97
+ };
98
+ }
99
+ //# sourceMappingURL=writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writer.js","sourceRoot":"","sources":["../../src/install/writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,uBAAuB,GACxB,MAAM,eAAe,CAAA;AAqBtB,KAAK,UAAU,qBAAqB,CAClC,YAAoB;IAEpB,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;QAC5D,MAAM,QAAQ,GAAG,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B,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;QACjD,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,MAAM;QACN,YAAY;QACZ,YAAY;QACZ,SAAS;KACV,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tayo-dev/rtl",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Generate high-quality React Testing Library tests from Chrome Recorder recordings",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "files": [
10
10
  "dist",
11
+ "assets",
11
12
  "README.md",
12
13
  "LICENSE"
13
14
  ],
@@ -15,6 +16,7 @@
15
16
  "build": "tsc",
16
17
  "start": "node dist/index.js",
17
18
  "dev": "tsc && node dist/index.js",
19
+ "pack:check": "npm pack --json --dry-run",
18
20
  "test": "vitest",
19
21
  "test:run": "vitest run",
20
22
  "test:coverage": "vitest run --coverage"