synarcx 0.1.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.
- package/LICENSE +23 -0
- package/README.md +90 -0
- package/bin/synarcx.js +3 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +474 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +278 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +264 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +552 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.js +170 -0
- package/dist/commands/schema.d.ts +6 -0
- package/dist/commands/schema.js +870 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +132 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +226 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +295 -0
- package/dist/commands/workflow/index.d.ts +17 -0
- package/dist/commands/workflow/index.js +12 -0
- package/dist/commands/workflow/instructions.d.ts +29 -0
- package/dist/commands/workflow/instructions.js +327 -0
- package/dist/commands/workflow/new-change.d.ts +11 -0
- package/dist/commands/workflow/new-change.js +45 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.js +34 -0
- package/dist/commands/workflow/shared.d.ts +57 -0
- package/dist/commands/workflow/shared.js +117 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.js +75 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.js +69 -0
- package/dist/commands/workspace/open.d.ts +29 -0
- package/dist/commands/workspace/open.js +84 -0
- package/dist/commands/workspace/operations.d.ts +18 -0
- package/dist/commands/workspace/operations.js +461 -0
- package/dist/commands/workspace/selection.d.ts +5 -0
- package/dist/commands/workspace/selection.js +90 -0
- package/dist/commands/workspace/types.d.ts +83 -0
- package/dist/commands/workspace/types.js +36 -0
- package/dist/commands/workspace.d.ts +3 -0
- package/dist/commands/workspace.js +635 -0
- package/dist/core/archive.d.ts +11 -0
- package/dist/core/archive.js +319 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/index.d.ts +8 -0
- package/dist/core/artifact-graph/index.js +14 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +143 -0
- package/dist/core/artifact-graph/instruction-loader.js +217 -0
- package/dist/core/artifact-graph/outputs.d.ts +14 -0
- package/dist/core/artifact-graph/outputs.js +39 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.js +258 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.js +31 -0
- package/dist/core/artifact-graph/types.d.ts +45 -0
- package/dist/core/artifact-graph/types.js +43 -0
- package/dist/core/available-tools.d.ts +17 -0
- package/dist/core/available-tools.js +43 -0
- package/dist/core/command-generation/adapters/amazon-q.d.ts +13 -0
- package/dist/core/command-generation/adapters/amazon-q.js +26 -0
- package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
- package/dist/core/command-generation/adapters/antigravity.js +26 -0
- package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
- package/dist/core/command-generation/adapters/auggie.js +27 -0
- package/dist/core/command-generation/adapters/bob.d.ts +14 -0
- package/dist/core/command-generation/adapters/bob.js +45 -0
- package/dist/core/command-generation/adapters/claude.d.ts +13 -0
- package/dist/core/command-generation/adapters/claude.js +50 -0
- package/dist/core/command-generation/adapters/cline.d.ts +14 -0
- package/dist/core/command-generation/adapters/cline.js +27 -0
- package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
- package/dist/core/command-generation/adapters/codebuddy.js +28 -0
- package/dist/core/command-generation/adapters/codex.d.ts +16 -0
- package/dist/core/command-generation/adapters/codex.js +39 -0
- package/dist/core/command-generation/adapters/continue.d.ts +13 -0
- package/dist/core/command-generation/adapters/continue.js +28 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
- package/dist/core/command-generation/adapters/costrict.js +27 -0
- package/dist/core/command-generation/adapters/crush.d.ts +13 -0
- package/dist/core/command-generation/adapters/crush.js +30 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.js +44 -0
- package/dist/core/command-generation/adapters/factory.d.ts +13 -0
- package/dist/core/command-generation/adapters/factory.js +27 -0
- package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
- package/dist/core/command-generation/adapters/gemini.js +26 -0
- package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
- package/dist/core/command-generation/adapters/github-copilot.js +26 -0
- package/dist/core/command-generation/adapters/iflow.d.ts +13 -0
- package/dist/core/command-generation/adapters/iflow.js +29 -0
- package/dist/core/command-generation/adapters/index.d.ts +32 -0
- package/dist/core/command-generation/adapters/index.js +32 -0
- package/dist/core/command-generation/adapters/junie.d.ts +13 -0
- package/dist/core/command-generation/adapters/junie.js +26 -0
- package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/kilocode.js +23 -0
- package/dist/core/command-generation/adapters/kiro.d.ts +13 -0
- package/dist/core/command-generation/adapters/kiro.js +26 -0
- package/dist/core/command-generation/adapters/lingma.d.ts +13 -0
- package/dist/core/command-generation/adapters/lingma.js +30 -0
- package/dist/core/command-generation/adapters/opencode.d.ts +13 -0
- package/dist/core/command-generation/adapters/opencode.js +27 -0
- package/dist/core/command-generation/adapters/pi.d.ts +18 -0
- package/dist/core/command-generation/adapters/pi.js +55 -0
- package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
- package/dist/core/command-generation/adapters/qoder.js +30 -0
- package/dist/core/command-generation/adapters/qwen.d.ts +13 -0
- package/dist/core/command-generation/adapters/qwen.js +26 -0
- package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/roocode.js +27 -0
- package/dist/core/command-generation/adapters/windsurf.d.ts +14 -0
- package/dist/core/command-generation/adapters/windsurf.js +51 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/registry.d.ts +36 -0
- package/dist/core/command-generation/registry.js +98 -0
- package/dist/core/command-generation/types.d.ts +56 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/completions/command-registry.d.ts +7 -0
- package/dist/core/completions/command-registry.js +596 -0
- package/dist/core/completions/completion-provider.d.ts +71 -0
- package/dist/core/completions/completion-provider.js +129 -0
- package/dist/core/completions/factory.d.ts +64 -0
- package/dist/core/completions/factory.js +75 -0
- package/dist/core/completions/generators/bash-generator.d.ts +35 -0
- package/dist/core/completions/generators/bash-generator.js +230 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +160 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +36 -0
- package/dist/core/completions/generators/powershell-generator.js +266 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +47 -0
- package/dist/core/completions/generators/zsh-generator.js +274 -0
- package/dist/core/completions/installers/bash-installer.d.ts +87 -0
- package/dist/core/completions/installers/bash-installer.js +318 -0
- package/dist/core/completions/installers/fish-installer.d.ts +43 -0
- package/dist/core/completions/installers/fish-installer.js +143 -0
- package/dist/core/completions/installers/powershell-installer.d.ts +102 -0
- package/dist/core/completions/installers/powershell-installer.js +387 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +117 -0
- package/dist/core/completions/installers/zsh-installer.js +421 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +30 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +45 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +34 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +45 -0
- package/dist/core/completions/types.d.ts +101 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-schema.d.ts +86 -0
- package/dist/core/config-schema.js +213 -0
- package/dist/core/config.d.ts +19 -0
- package/dist/core/config.js +38 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/global-config.d.ts +49 -0
- package/dist/core/global-config.js +124 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.js +4 -0
- package/dist/core/init.d.ts +37 -0
- package/dist/core/init.js +585 -0
- package/dist/core/legacy-cleanup.d.ts +169 -0
- package/dist/core/legacy-cleanup.js +578 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +172 -0
- package/dist/core/migration.d.ts +23 -0
- package/dist/core/migration.js +108 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +197 -0
- package/dist/core/parsers/markdown-parser.d.ts +26 -0
- package/dist/core/parsers/markdown-parser.js +227 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/parsers/spec-structure.d.ts +9 -0
- package/dist/core/parsers/spec-structure.js +88 -0
- package/dist/core/profile-sync-drift.d.ts +38 -0
- package/dist/core/profile-sync-drift.js +197 -0
- package/dist/core/profiles.d.ts +26 -0
- package/dist/core/profiles.js +37 -0
- package/dist/core/project-config.d.ts +64 -0
- package/dist/core/project-config.js +224 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/skill-generation.d.ts +49 -0
- package/dist/core/shared/skill-generation.js +90 -0
- package/dist/core/shared/tool-detection.d.ts +71 -0
- package/dist/core/shared/tool-detection.js +152 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +393 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.js +9 -0
- package/dist/core/templates/skill-templates.d.ts +15 -0
- package/dist/core/templates/skill-templates.js +14 -0
- package/dist/core/templates/types.d.ts +19 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/workflows/analyze.d.ts +4 -0
- package/dist/core/templates/workflows/analyze.js +101 -0
- package/dist/core/templates/workflows/apply-change.d.ts +10 -0
- package/dist/core/templates/workflows/apply-change.js +308 -0
- package/dist/core/templates/workflows/archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/archive-change.js +271 -0
- package/dist/core/templates/workflows/clarify.d.ts +4 -0
- package/dist/core/templates/workflows/clarify.js +108 -0
- package/dist/core/templates/workflows/debug.d.ts +4 -0
- package/dist/core/templates/workflows/debug.js +117 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.js +479 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.js +216 -0
- package/dist/core/templates/workflows/sync.d.ts +4 -0
- package/dist/core/templates/workflows/sync.js +108 -0
- package/dist/core/update.d.ts +82 -0
- package/dist/core/update.js +555 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.js +418 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +169 -0
- package/dist/core/workspace/foundation.d.ts +79 -0
- package/dist/core/workspace/foundation.js +367 -0
- package/dist/core/workspace/index.d.ts +5 -0
- package/dist/core/workspace/index.js +5 -0
- package/dist/core/workspace/link-input.d.ts +9 -0
- package/dist/core/workspace/link-input.js +32 -0
- package/dist/core/workspace/open-surface.d.ts +24 -0
- package/dist/core/workspace/open-surface.js +137 -0
- package/dist/core/workspace/openers.d.ts +21 -0
- package/dist/core/workspace/openers.js +119 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/prompts/searchable-multi-select.d.ts +28 -0
- package/dist/prompts/searchable-multi-select.js +159 -0
- package/dist/ui/ascii-patterns.d.ts +25 -0
- package/dist/ui/ascii-patterns.js +140 -0
- package/dist/ui/welcome-screen.d.ts +10 -0
- package/dist/ui/welcome-screen.js +144 -0
- package/dist/utils/change-metadata.d.ts +51 -0
- package/dist/utils/change-metadata.js +147 -0
- package/dist/utils/change-utils.d.ts +62 -0
- package/dist/utils/change-utils.js +122 -0
- package/dist/utils/command-references.d.ts +18 -0
- package/dist/utils/command-references.js +20 -0
- package/dist/utils/file-system.d.ts +41 -0
- package/dist/utils/file-system.js +301 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.js +73 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.js +36 -0
- package/package.json +76 -0
- package/schemas/synarcx/schema.yaml +153 -0
- package/schemas/synarcx/templates/design.md +19 -0
- package/schemas/synarcx/templates/proposal.md +23 -0
- package/schemas/synarcx/templates/spec.md +8 -0
- package/schemas/synarcx/templates/tasks.md +9 -0
- package/scripts/postinstall.js +83 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { InstallationResult } from '../factory.js';
|
|
2
|
+
/**
|
|
3
|
+
* Installer for Zsh completion scripts.
|
|
4
|
+
* Supports both Oh My Zsh and standard Zsh configurations.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ZshInstaller {
|
|
7
|
+
private readonly homeDir;
|
|
8
|
+
/**
|
|
9
|
+
* Markers for .zshrc configuration management
|
|
10
|
+
*/
|
|
11
|
+
private readonly ZSHRC_MARKERS;
|
|
12
|
+
constructor(homeDir?: string);
|
|
13
|
+
/**
|
|
14
|
+
* Check if Oh My Zsh is installed
|
|
15
|
+
*
|
|
16
|
+
* @returns true if Oh My Zsh is detected via $ZSH env var or directory exists
|
|
17
|
+
*/
|
|
18
|
+
isOhMyZshInstalled(): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the appropriate installation path for the completion script
|
|
21
|
+
*
|
|
22
|
+
* @returns Object with installation path and whether it's Oh My Zsh
|
|
23
|
+
*/
|
|
24
|
+
getInstallationPath(): Promise<{
|
|
25
|
+
path: string;
|
|
26
|
+
isOhMyZsh: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Backup an existing completion file if it exists
|
|
30
|
+
*
|
|
31
|
+
* @param targetPath - Path to the file to backup
|
|
32
|
+
* @returns Path to the backup file, or undefined if no backup was needed
|
|
33
|
+
*/
|
|
34
|
+
backupExistingFile(targetPath: string): Promise<string | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Get the path to .zshrc file
|
|
37
|
+
*
|
|
38
|
+
* @returns Path to .zshrc
|
|
39
|
+
*/
|
|
40
|
+
private getZshrcPath;
|
|
41
|
+
/**
|
|
42
|
+
* Generate .zshrc configuration content
|
|
43
|
+
*
|
|
44
|
+
* @param completionsDir - Directory containing completion scripts
|
|
45
|
+
* @returns Configuration content
|
|
46
|
+
*/
|
|
47
|
+
private generateZshrcConfig;
|
|
48
|
+
/**
|
|
49
|
+
* Configure .zshrc to enable completions
|
|
50
|
+
* Only applies to standard Zsh (not Oh My Zsh)
|
|
51
|
+
*
|
|
52
|
+
* @param completionsDir - Directory containing completion scripts
|
|
53
|
+
* @returns true if configured successfully, false otherwise
|
|
54
|
+
*/
|
|
55
|
+
configureZshrc(completionsDir: string): Promise<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* Check if .zshrc has synarcx configuration markers
|
|
58
|
+
*
|
|
59
|
+
* @returns true if .zshrc exists and has markers
|
|
60
|
+
*/
|
|
61
|
+
private hasZshrcConfig;
|
|
62
|
+
/**
|
|
63
|
+
* Remove .zshrc configuration
|
|
64
|
+
* Used during uninstallation
|
|
65
|
+
*
|
|
66
|
+
* @returns true if removed successfully, false otherwise
|
|
67
|
+
*/
|
|
68
|
+
removeZshrcConfig(): Promise<boolean>;
|
|
69
|
+
/**
|
|
70
|
+
* Install the completion script
|
|
71
|
+
*
|
|
72
|
+
* @param completionScript - The completion script content to install
|
|
73
|
+
* @returns Installation result with status and instructions
|
|
74
|
+
*/
|
|
75
|
+
install(completionScript: string): Promise<InstallationResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Generate Oh My Zsh fpath verification guidance
|
|
78
|
+
*
|
|
79
|
+
* @param completionsDir - Custom completions directory path
|
|
80
|
+
* @returns Array of guidance strings, or undefined if not needed
|
|
81
|
+
*/
|
|
82
|
+
private generateOhMyZshFpathGuidance;
|
|
83
|
+
/**
|
|
84
|
+
* Generate user instructions for enabling completions
|
|
85
|
+
*
|
|
86
|
+
* @param isOhMyZsh - Whether Oh My Zsh is being used
|
|
87
|
+
* @param installedPath - Path where the script was installed
|
|
88
|
+
* @returns Array of instruction strings
|
|
89
|
+
*/
|
|
90
|
+
private generateInstructions;
|
|
91
|
+
/**
|
|
92
|
+
* Uninstall the completion script
|
|
93
|
+
*
|
|
94
|
+
* @returns true if uninstalled successfully, false otherwise
|
|
95
|
+
*/
|
|
96
|
+
uninstall(): Promise<{
|
|
97
|
+
success: boolean;
|
|
98
|
+
message: string;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Check if completion script is currently installed
|
|
102
|
+
*
|
|
103
|
+
* @returns true if the completion script exists
|
|
104
|
+
*/
|
|
105
|
+
isInstalled(): Promise<boolean>;
|
|
106
|
+
/**
|
|
107
|
+
* Get information about the current installation
|
|
108
|
+
*
|
|
109
|
+
* @returns Installation status information
|
|
110
|
+
*/
|
|
111
|
+
getInstallationInfo(): Promise<{
|
|
112
|
+
installed: boolean;
|
|
113
|
+
path?: string;
|
|
114
|
+
isOhMyZsh?: boolean;
|
|
115
|
+
}>;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=zsh-installer.d.ts.map
|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import { FileSystemUtils } from '../../../utils/file-system.js';
|
|
5
|
+
/**
|
|
6
|
+
* Installer for Zsh completion scripts.
|
|
7
|
+
* Supports both Oh My Zsh and standard Zsh configurations.
|
|
8
|
+
*/
|
|
9
|
+
export class ZshInstaller {
|
|
10
|
+
homeDir;
|
|
11
|
+
/**
|
|
12
|
+
* Markers for .zshrc configuration management
|
|
13
|
+
*/
|
|
14
|
+
ZSHRC_MARKERS = {
|
|
15
|
+
start: '# SYNARCX:START',
|
|
16
|
+
end: '# SYNARCX:END',
|
|
17
|
+
};
|
|
18
|
+
constructor(homeDir = os.homedir()) {
|
|
19
|
+
this.homeDir = homeDir;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Check if Oh My Zsh is installed
|
|
23
|
+
*
|
|
24
|
+
* @returns true if Oh My Zsh is detected via $ZSH env var or directory exists
|
|
25
|
+
*/
|
|
26
|
+
async isOhMyZshInstalled() {
|
|
27
|
+
// First check for $ZSH environment variable (standard OMZ setup)
|
|
28
|
+
if (process.env.ZSH) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
// Fall back to checking for ~/.oh-my-zsh directory
|
|
32
|
+
const ohMyZshPath = path.join(this.homeDir, '.oh-my-zsh');
|
|
33
|
+
try {
|
|
34
|
+
const stat = await fs.stat(ohMyZshPath);
|
|
35
|
+
return stat.isDirectory();
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the appropriate installation path for the completion script
|
|
43
|
+
*
|
|
44
|
+
* @returns Object with installation path and whether it's Oh My Zsh
|
|
45
|
+
*/
|
|
46
|
+
async getInstallationPath() {
|
|
47
|
+
const isOhMyZsh = await this.isOhMyZshInstalled();
|
|
48
|
+
if (isOhMyZsh) {
|
|
49
|
+
// Oh My Zsh custom completions directory
|
|
50
|
+
return {
|
|
51
|
+
path: path.join(this.homeDir, '.oh-my-zsh', 'custom', 'completions', '_synarcx'),
|
|
52
|
+
isOhMyZsh: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
// Standard Zsh completions directory
|
|
57
|
+
return {
|
|
58
|
+
path: path.join(this.homeDir, '.zsh', 'completions', '_synarcx'),
|
|
59
|
+
isOhMyZsh: false,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Backup an existing completion file if it exists
|
|
65
|
+
*
|
|
66
|
+
* @param targetPath - Path to the file to backup
|
|
67
|
+
* @returns Path to the backup file, or undefined if no backup was needed
|
|
68
|
+
*/
|
|
69
|
+
async backupExistingFile(targetPath) {
|
|
70
|
+
try {
|
|
71
|
+
await fs.access(targetPath);
|
|
72
|
+
// File exists, create a backup
|
|
73
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
74
|
+
const backupPath = `${targetPath}.backup-${timestamp}`;
|
|
75
|
+
await fs.copyFile(targetPath, backupPath);
|
|
76
|
+
return backupPath;
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// File doesn't exist, no backup needed
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get the path to .zshrc file
|
|
85
|
+
*
|
|
86
|
+
* @returns Path to .zshrc
|
|
87
|
+
*/
|
|
88
|
+
getZshrcPath() {
|
|
89
|
+
return path.join(this.homeDir, '.zshrc');
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Generate .zshrc configuration content
|
|
93
|
+
*
|
|
94
|
+
* @param completionsDir - Directory containing completion scripts
|
|
95
|
+
* @returns Configuration content
|
|
96
|
+
*/
|
|
97
|
+
generateZshrcConfig(completionsDir) {
|
|
98
|
+
return [
|
|
99
|
+
'# synarcx shell completions configuration',
|
|
100
|
+
`fpath=("${completionsDir}" $fpath)`,
|
|
101
|
+
'autoload -Uz compinit',
|
|
102
|
+
'compinit',
|
|
103
|
+
].join('\n');
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Configure .zshrc to enable completions
|
|
107
|
+
* Only applies to standard Zsh (not Oh My Zsh)
|
|
108
|
+
*
|
|
109
|
+
* @param completionsDir - Directory containing completion scripts
|
|
110
|
+
* @returns true if configured successfully, false otherwise
|
|
111
|
+
*/
|
|
112
|
+
async configureZshrc(completionsDir) {
|
|
113
|
+
// Check if auto-configuration is disabled
|
|
114
|
+
if (process.env.SYNARCX_NO_AUTO_CONFIG === '1') {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
const zshrcPath = this.getZshrcPath();
|
|
119
|
+
const config = this.generateZshrcConfig(completionsDir);
|
|
120
|
+
// Check write permissions
|
|
121
|
+
const canWrite = await FileSystemUtils.canWriteFile(zshrcPath);
|
|
122
|
+
if (!canWrite) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
// Use marker-based update
|
|
126
|
+
await FileSystemUtils.updateFileWithMarkers(zshrcPath, config, this.ZSHRC_MARKERS.start, this.ZSHRC_MARKERS.end);
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
// Fail gracefully - don't break installation
|
|
131
|
+
console.debug(`Unable to configure .zshrc for completions: ${error.message}`);
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Check if .zshrc has synarcx configuration markers
|
|
137
|
+
*
|
|
138
|
+
* @returns true if .zshrc exists and has markers
|
|
139
|
+
*/
|
|
140
|
+
async hasZshrcConfig() {
|
|
141
|
+
try {
|
|
142
|
+
const zshrcPath = this.getZshrcPath();
|
|
143
|
+
const content = await fs.readFile(zshrcPath, 'utf-8');
|
|
144
|
+
return content.includes(this.ZSHRC_MARKERS.start) && content.includes(this.ZSHRC_MARKERS.end);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Remove .zshrc configuration
|
|
152
|
+
* Used during uninstallation
|
|
153
|
+
*
|
|
154
|
+
* @returns true if removed successfully, false otherwise
|
|
155
|
+
*/
|
|
156
|
+
async removeZshrcConfig() {
|
|
157
|
+
try {
|
|
158
|
+
const zshrcPath = this.getZshrcPath();
|
|
159
|
+
// Check if file exists
|
|
160
|
+
try {
|
|
161
|
+
await fs.access(zshrcPath);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
// File doesn't exist, nothing to remove
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
// Read file content
|
|
168
|
+
const content = await fs.readFile(zshrcPath, 'utf-8');
|
|
169
|
+
// Check if markers exist
|
|
170
|
+
if (!content.includes(this.ZSHRC_MARKERS.start) || !content.includes(this.ZSHRC_MARKERS.end)) {
|
|
171
|
+
// Markers don't exist, nothing to remove
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
// Remove content between markers (including markers)
|
|
175
|
+
const lines = content.split('\n');
|
|
176
|
+
const startIndex = lines.findIndex((line) => line.trim() === this.ZSHRC_MARKERS.start);
|
|
177
|
+
const endIndex = lines.findIndex((line) => line.trim() === this.ZSHRC_MARKERS.end);
|
|
178
|
+
if (startIndex === -1 || endIndex === -1 || endIndex < startIndex) {
|
|
179
|
+
// Invalid marker placement
|
|
180
|
+
return false;
|
|
181
|
+
}
|
|
182
|
+
// Remove lines between markers (inclusive)
|
|
183
|
+
lines.splice(startIndex, endIndex - startIndex + 1);
|
|
184
|
+
// Remove trailing empty lines at the start if the markers were at the top
|
|
185
|
+
while (lines.length > 0 && lines[0].trim() === '') {
|
|
186
|
+
lines.shift();
|
|
187
|
+
}
|
|
188
|
+
// Write back
|
|
189
|
+
await fs.writeFile(zshrcPath, lines.join('\n'), 'utf-8');
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
// Fail gracefully
|
|
194
|
+
console.debug(`Unable to remove .zshrc configuration: ${error.message}`);
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Install the completion script
|
|
200
|
+
*
|
|
201
|
+
* @param completionScript - The completion script content to install
|
|
202
|
+
* @returns Installation result with status and instructions
|
|
203
|
+
*/
|
|
204
|
+
async install(completionScript) {
|
|
205
|
+
try {
|
|
206
|
+
const { path: targetPath, isOhMyZsh } = await this.getInstallationPath();
|
|
207
|
+
// Check if already installed with same content
|
|
208
|
+
let isUpdate = false;
|
|
209
|
+
try {
|
|
210
|
+
const existingContent = await fs.readFile(targetPath, 'utf-8');
|
|
211
|
+
if (existingContent === completionScript) {
|
|
212
|
+
// Already installed and up to date
|
|
213
|
+
return {
|
|
214
|
+
success: true,
|
|
215
|
+
installedPath: targetPath,
|
|
216
|
+
isOhMyZsh,
|
|
217
|
+
message: 'Completion script is already installed (up to date)',
|
|
218
|
+
instructions: [
|
|
219
|
+
'The completion script is already installed and up to date.',
|
|
220
|
+
'If completions are not working, try: exec zsh',
|
|
221
|
+
],
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
// File exists but content is different - this is an update
|
|
225
|
+
isUpdate = true;
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
// File doesn't exist or can't be read, proceed with installation
|
|
229
|
+
console.debug(`Unable to read existing completion file at ${targetPath}: ${error.message}`);
|
|
230
|
+
}
|
|
231
|
+
// Ensure the directory exists
|
|
232
|
+
const targetDir = path.dirname(targetPath);
|
|
233
|
+
await fs.mkdir(targetDir, { recursive: true });
|
|
234
|
+
// Backup existing file if updating
|
|
235
|
+
const backupPath = isUpdate ? await this.backupExistingFile(targetPath) : undefined;
|
|
236
|
+
// Write the completion script
|
|
237
|
+
await fs.writeFile(targetPath, completionScript, 'utf-8');
|
|
238
|
+
// Auto-configure .zshrc for standard Zsh only.
|
|
239
|
+
// Oh My Zsh loads custom/completions and runs compinit itself.
|
|
240
|
+
let zshrcConfigured = false;
|
|
241
|
+
if (!isOhMyZsh) {
|
|
242
|
+
zshrcConfigured = await this.configureZshrc(targetDir);
|
|
243
|
+
}
|
|
244
|
+
// Generate instructions (only if .zshrc wasn't auto-configured)
|
|
245
|
+
let instructions = zshrcConfigured ? undefined : this.generateInstructions(isOhMyZsh, targetPath);
|
|
246
|
+
// Add fpath guidance for Oh My Zsh installations
|
|
247
|
+
if (isOhMyZsh) {
|
|
248
|
+
const fpathGuidance = this.generateOhMyZshFpathGuidance(targetDir);
|
|
249
|
+
if (fpathGuidance) {
|
|
250
|
+
instructions = instructions ? [...instructions, '', ...fpathGuidance] : fpathGuidance;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// Determine appropriate message based on update status
|
|
254
|
+
let message;
|
|
255
|
+
if (isUpdate) {
|
|
256
|
+
message = backupPath
|
|
257
|
+
? 'Completion script updated successfully (previous version backed up)'
|
|
258
|
+
: 'Completion script updated successfully';
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
message = isOhMyZsh
|
|
262
|
+
? 'Completion script installed successfully for Oh My Zsh'
|
|
263
|
+
: zshrcConfigured
|
|
264
|
+
? 'Completion script installed and .zshrc configured successfully'
|
|
265
|
+
: 'Completion script installed successfully for Zsh';
|
|
266
|
+
}
|
|
267
|
+
return {
|
|
268
|
+
success: true,
|
|
269
|
+
installedPath: targetPath,
|
|
270
|
+
backupPath,
|
|
271
|
+
isOhMyZsh,
|
|
272
|
+
zshrcConfigured,
|
|
273
|
+
message,
|
|
274
|
+
instructions,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
return {
|
|
279
|
+
success: false,
|
|
280
|
+
isOhMyZsh: false,
|
|
281
|
+
message: `Failed to install completion script: ${error instanceof Error ? error.message : String(error)}`,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Generate Oh My Zsh fpath verification guidance
|
|
287
|
+
*
|
|
288
|
+
* @param completionsDir - Custom completions directory path
|
|
289
|
+
* @returns Array of guidance strings, or undefined if not needed
|
|
290
|
+
*/
|
|
291
|
+
generateOhMyZshFpathGuidance(completionsDir) {
|
|
292
|
+
return [
|
|
293
|
+
'Note: Oh My Zsh typically auto-loads completions from custom/completions.',
|
|
294
|
+
`Verify that ${completionsDir} is in your fpath by running:`,
|
|
295
|
+
' echo $fpath | grep "custom/completions"',
|
|
296
|
+
'',
|
|
297
|
+
'If not found, completions may not work. Restart your shell to ensure changes take effect.',
|
|
298
|
+
];
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Generate user instructions for enabling completions
|
|
302
|
+
*
|
|
303
|
+
* @param isOhMyZsh - Whether Oh My Zsh is being used
|
|
304
|
+
* @param installedPath - Path where the script was installed
|
|
305
|
+
* @returns Array of instruction strings
|
|
306
|
+
*/
|
|
307
|
+
generateInstructions(isOhMyZsh, installedPath) {
|
|
308
|
+
if (isOhMyZsh) {
|
|
309
|
+
return [
|
|
310
|
+
'Completion script installed to Oh My Zsh completions directory.',
|
|
311
|
+
'Restart your shell or run: exec zsh',
|
|
312
|
+
'Completions should activate automatically.',
|
|
313
|
+
];
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
const completionsDir = path.dirname(installedPath);
|
|
317
|
+
const zshrcPath = path.join(this.homeDir, '.zshrc');
|
|
318
|
+
return [
|
|
319
|
+
'Completion script installed to ~/.zsh/completions/',
|
|
320
|
+
'',
|
|
321
|
+
'To enable completions, add the following to your ~/.zshrc file:',
|
|
322
|
+
'',
|
|
323
|
+
` # Add completions directory to fpath`,
|
|
324
|
+
` fpath=(${completionsDir} $fpath)`,
|
|
325
|
+
'',
|
|
326
|
+
' # Initialize completion system',
|
|
327
|
+
' autoload -Uz compinit',
|
|
328
|
+
' compinit',
|
|
329
|
+
'',
|
|
330
|
+
'Then restart your shell or run: exec zsh',
|
|
331
|
+
'',
|
|
332
|
+
`Check if these lines already exist in ${zshrcPath} before adding.`,
|
|
333
|
+
];
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Uninstall the completion script
|
|
338
|
+
*
|
|
339
|
+
* @returns true if uninstalled successfully, false otherwise
|
|
340
|
+
*/
|
|
341
|
+
async uninstall() {
|
|
342
|
+
try {
|
|
343
|
+
const { path: targetPath, isOhMyZsh } = await this.getInstallationPath();
|
|
344
|
+
// Try to remove completion script
|
|
345
|
+
let scriptRemoved = false;
|
|
346
|
+
try {
|
|
347
|
+
await fs.access(targetPath);
|
|
348
|
+
await fs.unlink(targetPath);
|
|
349
|
+
scriptRemoved = true;
|
|
350
|
+
}
|
|
351
|
+
catch {
|
|
352
|
+
// Script not installed
|
|
353
|
+
}
|
|
354
|
+
// Try to remove .zshrc configuration (only for standard Zsh)
|
|
355
|
+
let zshrcWasPresent = false;
|
|
356
|
+
let zshrcCleaned = false;
|
|
357
|
+
if (!isOhMyZsh) {
|
|
358
|
+
zshrcWasPresent = await this.hasZshrcConfig();
|
|
359
|
+
if (zshrcWasPresent) {
|
|
360
|
+
zshrcCleaned = await this.removeZshrcConfig();
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (!scriptRemoved && !zshrcWasPresent) {
|
|
364
|
+
return {
|
|
365
|
+
success: false,
|
|
366
|
+
message: 'Completion script is not installed',
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
const messages = [];
|
|
370
|
+
if (scriptRemoved) {
|
|
371
|
+
messages.push(`Completion script removed from ${targetPath}`);
|
|
372
|
+
}
|
|
373
|
+
if (zshrcCleaned && !isOhMyZsh) {
|
|
374
|
+
messages.push('Removed synarcx configuration from ~/.zshrc');
|
|
375
|
+
}
|
|
376
|
+
return {
|
|
377
|
+
success: true,
|
|
378
|
+
message: messages.join('. '),
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
return {
|
|
383
|
+
success: false,
|
|
384
|
+
message: `Failed to uninstall completion script: ${error instanceof Error ? error.message : String(error)}`,
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Check if completion script is currently installed
|
|
390
|
+
*
|
|
391
|
+
* @returns true if the completion script exists
|
|
392
|
+
*/
|
|
393
|
+
async isInstalled() {
|
|
394
|
+
try {
|
|
395
|
+
const { path: targetPath } = await this.getInstallationPath();
|
|
396
|
+
await fs.access(targetPath);
|
|
397
|
+
return true;
|
|
398
|
+
}
|
|
399
|
+
catch {
|
|
400
|
+
return false;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Get information about the current installation
|
|
405
|
+
*
|
|
406
|
+
* @returns Installation status information
|
|
407
|
+
*/
|
|
408
|
+
async getInstallationInfo() {
|
|
409
|
+
const installed = await this.isInstalled();
|
|
410
|
+
if (!installed) {
|
|
411
|
+
return { installed: false };
|
|
412
|
+
}
|
|
413
|
+
const { path: targetPath, isOhMyZsh } = await this.getInstallationPath();
|
|
414
|
+
return {
|
|
415
|
+
installed: true,
|
|
416
|
+
path: targetPath,
|
|
417
|
+
isOhMyZsh,
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
//# sourceMappingURL=zsh-installer.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static template strings for Bash completion scripts.
|
|
3
|
+
* These are Bash-specific helper functions that never change.
|
|
4
|
+
*/
|
|
5
|
+
export declare const BASH_DYNAMIC_HELPERS = "# Dynamic completion helpers\n\n_synarcx_complete_changes() {\n local changes\n changes=$(synarcx __complete changes 2>/dev/null | cut -f1)\n COMPREPLY=($(compgen -W \"$changes\" -- \"$cur\"))\n}\n\n_synarcx_complete_specs() {\n local specs\n specs=$(synarcx __complete specs 2>/dev/null | cut -f1)\n COMPREPLY=($(compgen -W \"$specs\" -- \"$cur\"))\n}\n\n_synarcx_complete_items() {\n local items\n items=$(synarcx __complete changes 2>/dev/null | cut -f1; synarcx __complete specs 2>/dev/null | cut -f1)\n COMPREPLY=($(compgen -W \"$items\" -- \"$cur\"))\n}\n\n_synarcx_complete_schemas() {\n local schemas\n schemas=$(synarcx __complete schemas 2>/dev/null | cut -f1)\n COMPREPLY=($(compgen -W \"$schemas\" -- \"$cur\"))\n}";
|
|
6
|
+
//# sourceMappingURL=bash-templates.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static template strings for Bash completion scripts.
|
|
3
|
+
* These are Bash-specific helper functions that never change.
|
|
4
|
+
*/
|
|
5
|
+
export const BASH_DYNAMIC_HELPERS = `# Dynamic completion helpers
|
|
6
|
+
|
|
7
|
+
_synarcx_complete_changes() {
|
|
8
|
+
local changes
|
|
9
|
+
changes=$(synarcx __complete changes 2>/dev/null | cut -f1)
|
|
10
|
+
COMPREPLY=($(compgen -W "$changes" -- "$cur"))
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
_synarcx_complete_specs() {
|
|
14
|
+
local specs
|
|
15
|
+
specs=$(synarcx __complete specs 2>/dev/null | cut -f1)
|
|
16
|
+
COMPREPLY=($(compgen -W "$specs" -- "$cur"))
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
_synarcx_complete_items() {
|
|
20
|
+
local items
|
|
21
|
+
items=$(synarcx __complete changes 2>/dev/null | cut -f1; synarcx __complete specs 2>/dev/null | cut -f1)
|
|
22
|
+
COMPREPLY=($(compgen -W "$items" -- "$cur"))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_synarcx_complete_schemas() {
|
|
26
|
+
local schemas
|
|
27
|
+
schemas=$(synarcx __complete schemas 2>/dev/null | cut -f1)
|
|
28
|
+
COMPREPLY=($(compgen -W "$schemas" -- "$cur"))
|
|
29
|
+
}`;
|
|
30
|
+
//# sourceMappingURL=bash-templates.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static template strings for Fish completion scripts.
|
|
3
|
+
* These are Fish-specific helper functions that never change.
|
|
4
|
+
*/
|
|
5
|
+
export declare const FISH_STATIC_HELPERS = "# Helper function to check if a subcommand is present\nfunction __fish_synarcx_using_subcommand\n set -l cmd (commandline -opc)\n set -e cmd[1]\n for i in $argv\n if contains -- $i $cmd\n return 0\n end\n end\n return 1\nend\n\nfunction __fish_synarcx_no_subcommand\n set -l cmd (commandline -opc)\n test (count $cmd) -eq 1\nend";
|
|
6
|
+
export declare const FISH_DYNAMIC_HELPERS = "# Dynamic completion helpers\n\nfunction __fish_synarcx_changes\n synarcx __complete changes 2>/dev/null | while read -l id desc\n printf '%s\\t%s\\n' \"$id\" \"$desc\"\n end\nend\n\nfunction __fish_synarcx_specs\n synarcx __complete specs 2>/dev/null | while read -l id desc\n printf '%s\\t%s\\n' \"$id\" \"$desc\"\n end\nend\n\nfunction __fish_synarcx_items\n __fish_synarcx_changes\n __fish_synarcx_specs\nend\n\nfunction __fish_synarcx_schemas\n synarcx __complete schemas 2>/dev/null | while read -l id desc\n printf '%s\\t%s\\n' \"$id\" \"$desc\"\n end\nend";
|
|
7
|
+
//# sourceMappingURL=fish-templates.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static template strings for Fish completion scripts.
|
|
3
|
+
* These are Fish-specific helper functions that never change.
|
|
4
|
+
*/
|
|
5
|
+
export const FISH_STATIC_HELPERS = `# Helper function to check if a subcommand is present
|
|
6
|
+
function __fish_synarcx_using_subcommand
|
|
7
|
+
set -l cmd (commandline -opc)
|
|
8
|
+
set -e cmd[1]
|
|
9
|
+
for i in $argv
|
|
10
|
+
if contains -- $i $cmd
|
|
11
|
+
return 0
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
return 1
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
function __fish_synarcx_no_subcommand
|
|
18
|
+
set -l cmd (commandline -opc)
|
|
19
|
+
test (count $cmd) -eq 1
|
|
20
|
+
end`;
|
|
21
|
+
export const FISH_DYNAMIC_HELPERS = `# Dynamic completion helpers
|
|
22
|
+
|
|
23
|
+
function __fish_synarcx_changes
|
|
24
|
+
synarcx __complete changes 2>/dev/null | while read -l id desc
|
|
25
|
+
printf '%s\\t%s\\n' "$id" "$desc"
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
function __fish_synarcx_specs
|
|
30
|
+
synarcx __complete specs 2>/dev/null | while read -l id desc
|
|
31
|
+
printf '%s\\t%s\\n' "$id" "$desc"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
function __fish_synarcx_items
|
|
36
|
+
__fish_synarcx_changes
|
|
37
|
+
__fish_synarcx_specs
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
function __fish_synarcx_schemas
|
|
41
|
+
synarcx __complete schemas 2>/dev/null | while read -l id desc
|
|
42
|
+
printf '%s\\t%s\\n' "$id" "$desc"
|
|
43
|
+
end
|
|
44
|
+
end`;
|
|
45
|
+
//# sourceMappingURL=fish-templates.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static template strings for PowerShell completion scripts.
|
|
3
|
+
* These are PowerShell-specific helper functions that never change.
|
|
4
|
+
*/
|
|
5
|
+
export declare const POWERSHELL_DYNAMIC_HELPERS = "# Dynamic completion helpers\n\nfunction Get-SynarcxChanges {\n $output = synarcx __complete changes 2>$null\n if ($output) {\n $output | ForEach-Object {\n ($_ -split \"\\t\")[0]\n }\n }\n}\n\nfunction Get-SynarcxSpecs {\n $output = synarcx __complete specs 2>$null\n if ($output) {\n $output | ForEach-Object {\n ($_ -split \"\\t\")[0]\n }\n }\n}\n\nfunction Get-SynarcxSchemas {\n $output = synarcx __complete schemas 2>$null\n if ($output) {\n $output | ForEach-Object {\n ($_ -split \"\\t\")[0]\n }\n }\n}\n";
|
|
6
|
+
//# sourceMappingURL=powershell-templates.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static template strings for PowerShell completion scripts.
|
|
3
|
+
* These are PowerShell-specific helper functions that never change.
|
|
4
|
+
*/
|
|
5
|
+
export const POWERSHELL_DYNAMIC_HELPERS = `# Dynamic completion helpers
|
|
6
|
+
|
|
7
|
+
function Get-SynarcxChanges {
|
|
8
|
+
$output = synarcx __complete changes 2>$null
|
|
9
|
+
if ($output) {
|
|
10
|
+
$output | ForEach-Object {
|
|
11
|
+
($_ -split "\\t")[0]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function Get-SynarcxSpecs {
|
|
17
|
+
$output = synarcx __complete specs 2>$null
|
|
18
|
+
if ($output) {
|
|
19
|
+
$output | ForEach-Object {
|
|
20
|
+
($_ -split "\\t")[0]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function Get-SynarcxSchemas {
|
|
26
|
+
$output = synarcx __complete schemas 2>$null
|
|
27
|
+
if ($output) {
|
|
28
|
+
$output | ForEach-Object {
|
|
29
|
+
($_ -split "\\t")[0]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
//# sourceMappingURL=powershell-templates.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static template strings for Zsh completion scripts.
|
|
3
|
+
* These are Zsh-specific helper functions that never change.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ZSH_DYNAMIC_HELPERS = "# Dynamic completion helpers\n\n# Use synarcx __complete to get available changes\n_synarcx_complete_changes() {\n local -a changes\n while IFS=$'\\t' read -r id desc; do\n changes+=(\"$id:$desc\")\n done < <(synarcx __complete changes 2>/dev/null)\n _describe \"change\" changes\n}\n\n# Use synarcx __complete to get available specs\n_synarcx_complete_specs() {\n local -a specs\n while IFS=$'\\t' read -r id desc; do\n specs+=(\"$id:$desc\")\n done < <(synarcx __complete specs 2>/dev/null)\n _describe \"spec\" specs\n}\n\n# Get both changes and specs\n_synarcx_complete_items() {\n local -a items\n while IFS=$'\\t' read -r id desc; do\n items+=(\"$id:$desc\")\n done < <(synarcx __complete changes 2>/dev/null)\n while IFS=$'\\t' read -r id desc; do\n items+=(\"$id:$desc\")\n done < <(synarcx __complete specs 2>/dev/null)\n _describe \"item\" items\n}\n\n# Use synarcx __complete to get available schemas\n_synarcx_complete_schemas() {\n local -a schemas\n while IFS=$'\\t' read -r id desc; do\n schemas+=(\"$id:$desc\")\n done < <(synarcx __complete schemas 2>/dev/null)\n _describe \"schema\" schemas\n}";
|
|
6
|
+
//# sourceMappingURL=zsh-templates.d.ts.map
|