@slats/claude-assets-sync 0.3.0 → 0.3.1

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 (139) hide show
  1. package/README.md +9 -9
  2. package/dist/claude-hashes.json +7 -7
  3. package/dist/commands/runCli/runCli.mjs +7 -2
  4. package/dist/commands/runCli/type.d.ts +1 -0
  5. package/dist/commands/runCli/utils/renderOrFallback.d.ts +6 -0
  6. package/dist/commands/runCli/utils/renderOrFallback.mjs +12 -0
  7. package/dist/commands/runCli/utils/renderPlain.d.ts +11 -0
  8. package/dist/commands/runCli/utils/renderPlain.mjs +89 -0
  9. package/dist/commands/runCli/utils/resolveScopeFlag.d.ts +9 -1
  10. package/dist/commands/runCli/utils/resolveScopeFlag.mjs +5 -11
  11. package/dist/commands/runCli/utils/toConsumerPackages.d.ts +9 -0
  12. package/dist/commands/runCli/utils/toConsumerPackages.mjs +26 -0
  13. package/dist/core/index.d.ts +2 -2
  14. package/dist/core/injectDocs/index.d.ts +3 -2
  15. package/dist/core/injectDocs/type.d.ts +0 -19
  16. package/dist/core/scope/index.d.ts +1 -1
  17. package/dist/core/scope/scope.d.ts +0 -1
  18. package/dist/core/scope/scope.mjs +1 -4
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.mjs +2 -2
  21. package/dist/ui/InjectApp/InjectApp.d.ts +2 -0
  22. package/dist/ui/InjectApp/InjectApp.mjs +82 -0
  23. package/dist/ui/InjectApp/index.d.ts +2 -0
  24. package/dist/ui/InjectApp/utils/eventSelectors.d.ts +5 -0
  25. package/dist/ui/InjectApp/utils/eventSelectors.mjs +24 -0
  26. package/dist/ui/InjectApp/utils/phaseReducer.d.ts +2 -0
  27. package/dist/ui/InjectApp/utils/phaseReducer.mjs +130 -0
  28. package/dist/ui/InjectApp/utils/renderInjectApp.d.ts +2 -0
  29. package/dist/ui/InjectApp/utils/renderInjectApp.mjs +19 -0
  30. package/dist/ui/InjectApp/utils/type.d.ts +5 -0
  31. package/dist/ui/components/ActionRow.d.ts +7 -0
  32. package/dist/ui/components/ActionRow.mjs +45 -0
  33. package/dist/ui/components/Banner.d.ts +7 -0
  34. package/dist/ui/components/Banner.mjs +9 -0
  35. package/dist/ui/components/ConfirmForce.d.ts +8 -0
  36. package/dist/ui/components/ConfirmForce.mjs +35 -0
  37. package/dist/ui/components/ErrorPanel.d.ts +6 -0
  38. package/dist/ui/components/ErrorPanel.mjs +14 -0
  39. package/dist/ui/components/Footer.d.ts +8 -0
  40. package/dist/ui/components/Footer.mjs +27 -0
  41. package/dist/ui/components/PlanTable.d.ts +8 -0
  42. package/dist/ui/components/PlanTable.mjs +15 -0
  43. package/dist/ui/components/ProgressBar.d.ts +10 -0
  44. package/dist/ui/components/ProgressBar.mjs +28 -0
  45. package/dist/ui/components/ScopePicker.d.ts +7 -0
  46. package/dist/ui/components/ScopePicker.mjs +26 -0
  47. package/dist/ui/components/Spinner.d.ts +8 -0
  48. package/dist/ui/components/Spinner.mjs +10 -0
  49. package/dist/ui/components/StatusBadge.d.ts +8 -0
  50. package/dist/ui/components/StepTracker.d.ts +9 -0
  51. package/dist/ui/components/StepTracker.mjs +43 -0
  52. package/dist/ui/components/Summary.d.ts +9 -0
  53. package/dist/ui/components/Summary.mjs +30 -0
  54. package/dist/ui/components/TargetCard.d.ts +11 -0
  55. package/dist/ui/components/TargetCard.mjs +29 -0
  56. package/dist/ui/hooks/useApplyStep.d.ts +12 -0
  57. package/dist/ui/hooks/useApplyStep.mjs +30 -0
  58. package/dist/ui/hooks/useExitApp.d.ts +8 -0
  59. package/dist/ui/hooks/useExitApp.mjs +19 -0
  60. package/dist/ui/hooks/useForceConfirmStep.d.ts +9 -0
  61. package/dist/ui/hooks/useForceConfirmStep.mjs +24 -0
  62. package/dist/ui/hooks/useInjectSession.d.ts +10 -0
  63. package/dist/ui/hooks/useInjectSession.mjs +63 -0
  64. package/dist/ui/hooks/useInterval.d.ts +1 -0
  65. package/dist/ui/hooks/usePhase.d.ts +2 -0
  66. package/dist/ui/hooks/usePhase.mjs +9 -0
  67. package/dist/ui/hooks/usePlanStep.d.ts +13 -0
  68. package/dist/ui/hooks/usePlanStep.mjs +94 -0
  69. package/dist/ui/hooks/useResolveStep.d.ts +18 -0
  70. package/dist/ui/hooks/useResolveStep.mjs +21 -0
  71. package/dist/ui/hooks/useTerminalWidth.d.ts +1 -0
  72. package/dist/ui/index.d.ts +2 -0
  73. package/dist/ui/index.mjs +16 -0
  74. package/dist/ui/theme/colors.d.ts +12 -0
  75. package/dist/ui/theme/colors.mjs +9 -0
  76. package/dist/ui/theme/icons.d.ts +29 -0
  77. package/dist/ui/theme/icons.mjs +17 -0
  78. package/dist/ui/theme/layout.d.ts +20 -0
  79. package/dist/ui/theme/layout.mjs +9 -0
  80. package/dist/ui/types/event.d.ts +45 -0
  81. package/dist/ui/types/index.d.ts +4 -0
  82. package/dist/ui/types/phase.d.ts +44 -0
  83. package/dist/ui/types/render.d.ts +6 -0
  84. package/dist/ui/types/target.d.ts +25 -0
  85. package/dist/utils/version.d.ts +1 -1
  86. package/dist/utils/version.mjs +1 -1
  87. package/docs/claude/skills/claude-docs-asset-wiring/SKILL.md +1 -1
  88. package/docs/claude/skills/claude-docs-asset-wiring/knowledge/claude-md-template.md +4 -12
  89. package/docs/claude/skills/claude-docs-asset-wiring/knowledge/gotchas.md +17 -14
  90. package/docs/claude/skills/claude-docs-asset-wiring/knowledge/package-json-patches.md +18 -13
  91. package/docs/claude/skills/claude-docs-asset-wiring/knowledge/reference-files.md +4 -4
  92. package/docs/consumer-integration.md +9 -8
  93. package/package.json +12 -7
  94. package/scripts/dev-ui-fixtures.ts +288 -0
  95. package/scripts/dev-ui.tsx +289 -0
  96. package/dist/commands/runCli/runCli.cjs +0 -53
  97. package/dist/commands/runCli/utils/classifyTarget.cjs +0 -48
  98. package/dist/commands/runCli/utils/injectOne.cjs +0 -47
  99. package/dist/commands/runCli/utils/injectOne.d.ts +0 -3
  100. package/dist/commands/runCli/utils/injectOne.mjs +0 -45
  101. package/dist/commands/runCli/utils/resolvePackage.cjs +0 -77
  102. package/dist/commands/runCli/utils/resolveScopeAlias.cjs +0 -69
  103. package/dist/commands/runCli/utils/resolveScopeFlag.cjs +0 -28
  104. package/dist/commands/runCli/utils/resolveTargets.cjs +0 -40
  105. package/dist/commands/runCli/utils/runInject.cjs +0 -52
  106. package/dist/commands/runCli/utils/runInject.d.ts +0 -3
  107. package/dist/commands/runCli/utils/runInject.mjs +0 -50
  108. package/dist/core/buildPlan/buildPlan.cjs +0 -42
  109. package/dist/core/buildPlan/utils/toPosix.cjs +0 -9
  110. package/dist/core/buildPlan/utils/walkFiles.cjs +0 -25
  111. package/dist/core/hash/hash.cjs +0 -30
  112. package/dist/core/hashManifest/hashManifest.cjs +0 -27
  113. package/dist/core/injectDocs/injectDocs.cjs +0 -43
  114. package/dist/core/injectDocs/injectDocs.d.ts +0 -2
  115. package/dist/core/injectDocs/injectDocs.mjs +0 -41
  116. package/dist/core/injectDocs/utils/applyAction.cjs +0 -21
  117. package/dist/core/injectDocs/utils/emitCiForceList.cjs +0 -10
  118. package/dist/core/injectDocs/utils/emitCiForceList.d.ts +0 -2
  119. package/dist/core/injectDocs/utils/emitCiForceList.mjs +0 -8
  120. package/dist/core/injectDocs/utils/printPlan.cjs +0 -20
  121. package/dist/core/injectDocs/utils/printPlan.d.ts +0 -2
  122. package/dist/core/injectDocs/utils/printPlan.mjs +0 -18
  123. package/dist/core/injectDocs/utils/summarize.cjs +0 -27
  124. package/dist/core/scope/scope.cjs +0 -46
  125. package/dist/core/scope/utils/isDirectory.cjs +0 -14
  126. package/dist/index.cjs +0 -20
  127. package/dist/prompts/confirmForce.cjs +0 -27
  128. package/dist/prompts/confirmForce.d.ts +0 -1
  129. package/dist/prompts/confirmForce.mjs +0 -25
  130. package/dist/prompts/index.d.ts +0 -2
  131. package/dist/prompts/selectScope.cjs +0 -30
  132. package/dist/prompts/selectScope.d.ts +0 -2
  133. package/dist/prompts/selectScope.mjs +0 -28
  134. package/dist/utils/asyncPool.cjs +0 -26
  135. package/dist/utils/heartbeat.cjs +0 -25
  136. package/dist/utils/heartbeat.d.ts +0 -16
  137. package/dist/utils/heartbeat.mjs +0 -23
  138. package/dist/utils/logger.cjs +0 -74
  139. package/dist/utils/version.cjs +0 -5
@@ -1,30 +0,0 @@
1
- 'use strict';
2
-
3
- var prompts = require('@inquirer/prompts');
4
- var pc = require('picocolors');
5
-
6
- const CHOICES = [
7
- {
8
- name: 'user',
9
- value: 'user',
10
- description: '~/.claude (applies globally to every project)',
11
- },
12
- {
13
- name: 'project',
14
- value: 'project',
15
- description: 'nearest ancestor .claude (or <cwd>/.claude)',
16
- },
17
- ];
18
- async function selectScopeAsync() {
19
- const answer = await prompts.select({
20
- message: pc.bold(pc.cyan('Select injection scope:')),
21
- choices: CHOICES.map((c) => ({
22
- name: c.name,
23
- value: c.value,
24
- description: pc.dim(c.description),
25
- })),
26
- });
27
- return answer;
28
- }
29
-
30
- exports.selectScopeAsync = selectScopeAsync;
@@ -1,2 +0,0 @@
1
- import type { Scope } from '../core/scope/index.js';
2
- export declare function selectScopeAsync(): Promise<Scope>;
@@ -1,28 +0,0 @@
1
- import { select } from '@inquirer/prompts';
2
- import pc from 'picocolors';
3
-
4
- const CHOICES = [
5
- {
6
- name: 'user',
7
- value: 'user',
8
- description: '~/.claude (applies globally to every project)',
9
- },
10
- {
11
- name: 'project',
12
- value: 'project',
13
- description: 'nearest ancestor .claude (or <cwd>/.claude)',
14
- },
15
- ];
16
- async function selectScopeAsync() {
17
- const answer = await select({
18
- message: pc.bold(pc.cyan('Select injection scope:')),
19
- choices: CHOICES.map((c) => ({
20
- name: c.name,
21
- value: c.value,
22
- description: pc.dim(c.description),
23
- })),
24
- });
25
- return answer;
26
- }
27
-
28
- export { selectScopeAsync };
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- async function asyncPool(limit, items, fn) {
4
- const results = [];
5
- const executing = new Set();
6
- for (const [index, item] of items.entries()) {
7
- const p = (async () => {
8
- try {
9
- const value = await fn(item);
10
- results[index] = { status: 'fulfilled', value };
11
- }
12
- catch (reason) {
13
- results[index] = { status: 'rejected', reason };
14
- }
15
- })();
16
- executing.add(p);
17
- p.then(() => executing.delete(p));
18
- if (executing.size >= limit) {
19
- await Promise.race(executing);
20
- }
21
- }
22
- await Promise.all(executing);
23
- return results;
24
- }
25
-
26
- exports.asyncPool = asyncPool;
@@ -1,25 +0,0 @@
1
- 'use strict';
2
-
3
- var pc = require('picocolors');
4
-
5
- function startHeartbeat(options = {}) {
6
- const intervalMs = options.intervalMs ?? 500;
7
- const label = options.label ?? 'working';
8
- const emit = options.emit ??
9
- ((line) => {
10
- process.stderr.write(line);
11
- });
12
- const startedAt = Date.now();
13
- const timer = setInterval(() => {
14
- const elapsedMs = Date.now() - startedAt;
15
- const seconds = (elapsedMs / 1000).toFixed(1);
16
- emit(`${pc.dim(`[${seconds}s]`)} ${pc.cyan(`${label}...`)}\n`);
17
- }, intervalMs);
18
- if (typeof timer.unref === 'function')
19
- timer.unref();
20
- return () => {
21
- clearInterval(timer);
22
- };
23
- }
24
-
25
- exports.startHeartbeat = startHeartbeat;
@@ -1,16 +0,0 @@
1
- export interface HeartbeatOptions {
2
- intervalMs?: number;
3
- emit?: (line: string) => void;
4
- label?: string;
5
- }
6
- export type StopHeartbeat = () => void;
7
- /**
8
- * Wall-clock heartbeat ticker for long-running async operations.
9
- *
10
- * Wraps operations at the command layer (NOT core) to provide in-flight
11
- * visibility when stdout is quiet for several hundred milliseconds.
12
- *
13
- * The emitted line is written via the provided `emit` (default: stderr) so
14
- * it never interferes with programmatic stdout output.
15
- */
16
- export declare function startHeartbeat(options?: HeartbeatOptions): StopHeartbeat;
@@ -1,23 +0,0 @@
1
- import pc from 'picocolors';
2
-
3
- function startHeartbeat(options = {}) {
4
- const intervalMs = options.intervalMs ?? 500;
5
- const label = options.label ?? 'working';
6
- const emit = options.emit ??
7
- ((line) => {
8
- process.stderr.write(line);
9
- });
10
- const startedAt = Date.now();
11
- const timer = setInterval(() => {
12
- const elapsedMs = Date.now() - startedAt;
13
- const seconds = (elapsedMs / 1000).toFixed(1);
14
- emit(`${pc.dim(`[${seconds}s]`)} ${pc.cyan(`${label}...`)}\n`);
15
- }, intervalMs);
16
- if (typeof timer.unref === 'function')
17
- timer.unref();
18
- return () => {
19
- clearInterval(timer);
20
- };
21
- }
22
-
23
- export { startHeartbeat };
@@ -1,74 +0,0 @@
1
- 'use strict';
2
-
3
- var pc = require('picocolors');
4
-
5
- const logger = {
6
- info(message) {
7
- console.log(pc.blue('info'), message);
8
- },
9
- success(message) {
10
- console.log(pc.green('success'), message);
11
- },
12
- warn(message) {
13
- console.log(pc.yellow('warn'), message);
14
- },
15
- error(message) {
16
- console.log(pc.red('error'), message);
17
- },
18
- debug(message) {
19
- if (process.env.VERBOSE) {
20
- console.log(pc.gray('debug'), message);
21
- }
22
- },
23
- step(step, detail) {
24
- const stepText = pc.cyan(`[${step}]`);
25
- console.log(stepText, detail || '');
26
- },
27
- file(operation, path) {
28
- const colors = {
29
- create: pc.green,
30
- update: pc.yellow,
31
- skip: pc.gray,
32
- };
33
- const symbols = {
34
- create: '+',
35
- update: '~',
36
- skip: '-',
37
- };
38
- console.log(` ${colors[operation](symbols[operation])} ${path}`);
39
- },
40
- packageStart(packageName) {
41
- console.log();
42
- console.log(pc.bold(pc.cyan(`Syncing ${packageName}...`)));
43
- },
44
- packageEnd(_packageName, result) {
45
- if (result.skipped)
46
- console.log(pc.gray(` Skipped: ${result.reason || 'Unknown reason'}`));
47
- else if (result.success)
48
- console.log(pc.green(` Completed successfully`));
49
- else
50
- console.log(pc.red(` Failed: ${result.reason || 'Unknown error'}`));
51
- },
52
- summary(results) {
53
- console.log();
54
- console.log(pc.bold('Summary:'));
55
- console.log(` ${pc.green('Success:')} ${results.success}`);
56
- console.log(` ${pc.gray('Skipped:')} ${results.skipped}`);
57
- if (results.failed > 0)
58
- console.log(` ${pc.red('Failed:')} ${results.failed}`);
59
- },
60
- dryRunNotice() {
61
- console.log();
62
- console.log(pc.yellow(pc.bold('[DRY RUN] No files will be created or modified.')));
63
- console.log();
64
- },
65
- heading(message) {
66
- console.log();
67
- console.log(pc.bold(pc.cyan(`▸ ${message}`)));
68
- },
69
- accent(message) {
70
- return pc.cyan(pc.bold(message));
71
- },
72
- };
73
-
74
- exports.logger = logger;
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- const VERSION = '0.3.0';
4
-
5
- exports.VERSION = VERSION;