intelligent-system-design-language 0.3.13

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 (209) hide show
  1. package/.claude/agents/langium-language-designer.md +38 -0
  2. package/.claude/agents/typescript-vscode-expert.md +29 -0
  3. package/.claude/agents/ui-ux-designer.md +36 -0
  4. package/.claude/settings.local.json +33 -0
  5. package/.idea/inspectionProfiles/Project_Default.xml +7 -0
  6. package/.idea/isdl.iml +14 -0
  7. package/.idea/modules.xml +9 -0
  8. package/.idea/vcs.xml +7 -0
  9. package/.idea/watcherTasks.xml +4 -0
  10. package/.vscodeignore +18 -0
  11. package/LICENSE +674 -0
  12. package/README.md +86 -0
  13. package/bin/cli.js +4 -0
  14. package/bin/lsp.js +8 -0
  15. package/isdl.png +0 -0
  16. package/out/_backgrounds.scss +91 -0
  17. package/out/_handlebars.scss +505 -0
  18. package/out/_isdlStyles.scss +1357 -0
  19. package/out/_vuetifyOverrides.scss +425 -0
  20. package/out/_vuetifyStyles.scss +31957 -0
  21. package/out/cli/cli-util.js +39 -0
  22. package/out/cli/cli-util.js.map +1 -0
  23. package/out/cli/components/_backgrounds.scss +91 -0
  24. package/out/cli/components/_handlebars.scss +505 -0
  25. package/out/cli/components/_isdlStyles.scss +1357 -0
  26. package/out/cli/components/_vuetifyOverrides.scss +425 -0
  27. package/out/cli/components/_vuetifyStyles.scss +31957 -0
  28. package/out/cli/components/active-effect-sheet-generator.js +643 -0
  29. package/out/cli/components/active-effect-sheet-generator.js.map +1 -0
  30. package/out/cli/components/base-actor-sheet-generator.js +125 -0
  31. package/out/cli/components/base-actor-sheet-generator.js.map +1 -0
  32. package/out/cli/components/base-sheet-generator.js +525 -0
  33. package/out/cli/components/base-sheet-generator.js.map +1 -0
  34. package/out/cli/components/chat-card-generator.js +683 -0
  35. package/out/cli/components/chat-card-generator.js.map +1 -0
  36. package/out/cli/components/css-generator.js +58 -0
  37. package/out/cli/components/css-generator.js.map +1 -0
  38. package/out/cli/components/damage-roll-generator.js +173 -0
  39. package/out/cli/components/damage-roll-generator.js.map +1 -0
  40. package/out/cli/components/datamodel-generator.js +672 -0
  41. package/out/cli/components/datamodel-generator.js.map +1 -0
  42. package/out/cli/components/derived-data-generator.js +1340 -0
  43. package/out/cli/components/derived-data-generator.js.map +1 -0
  44. package/out/cli/components/hotbar-drop-hook-generator.js +95 -0
  45. package/out/cli/components/hotbar-drop-hook-generator.js.map +1 -0
  46. package/out/cli/components/init-hook-generator.js +597 -0
  47. package/out/cli/components/init-hook-generator.js.map +1 -0
  48. package/out/cli/components/keywords-generator.js +220 -0
  49. package/out/cli/components/keywords-generator.js.map +1 -0
  50. package/out/cli/components/language-generator.js +110 -0
  51. package/out/cli/components/language-generator.js.map +1 -0
  52. package/out/cli/components/measured-template-preview.js +234 -0
  53. package/out/cli/components/measured-template-preview.js.map +1 -0
  54. package/out/cli/components/method-generator.js +1812 -0
  55. package/out/cli/components/method-generator.js.map +1 -0
  56. package/out/cli/components/ready-hook-generator.js +448 -0
  57. package/out/cli/components/ready-hook-generator.js.map +1 -0
  58. package/out/cli/components/token-generator.js +138 -0
  59. package/out/cli/components/token-generator.js.map +1 -0
  60. package/out/cli/components/utils.js +176 -0
  61. package/out/cli/components/utils.js.map +1 -0
  62. package/out/cli/components/vue/base-components/vue-attribute.js +148 -0
  63. package/out/cli/components/vue/base-components/vue-attribute.js.map +1 -0
  64. package/out/cli/components/vue/base-components/vue-boolean.js +77 -0
  65. package/out/cli/components/vue/base-components/vue-boolean.js.map +1 -0
  66. package/out/cli/components/vue/base-components/vue-calculator.js +106 -0
  67. package/out/cli/components/vue/base-components/vue-calculator.js.map +1 -0
  68. package/out/cli/components/vue/base-components/vue-damage-application.js +369 -0
  69. package/out/cli/components/vue/base-components/vue-damage-application.js.map +1 -0
  70. package/out/cli/components/vue/base-components/vue-damage-bonuses.js +225 -0
  71. package/out/cli/components/vue/base-components/vue-damage-bonuses.js.map +1 -0
  72. package/out/cli/components/vue/base-components/vue-damage-resistances.js +256 -0
  73. package/out/cli/components/vue/base-components/vue-damage-resistances.js.map +1 -0
  74. package/out/cli/components/vue/base-components/vue-damage-track.js +134 -0
  75. package/out/cli/components/vue/base-components/vue-damage-track.js.map +1 -0
  76. package/out/cli/components/vue/base-components/vue-date-time.js +55 -0
  77. package/out/cli/components/vue/base-components/vue-date-time.js.map +1 -0
  78. package/out/cli/components/vue/base-components/vue-dice.js +111 -0
  79. package/out/cli/components/vue/base-components/vue-dice.js.map +1 -0
  80. package/out/cli/components/vue/base-components/vue-die.js +86 -0
  81. package/out/cli/components/vue/base-components/vue-die.js.map +1 -0
  82. package/out/cli/components/vue/base-components/vue-document-choice.js +172 -0
  83. package/out/cli/components/vue/base-components/vue-document-choice.js.map +1 -0
  84. package/out/cli/components/vue/base-components/vue-document-choices.js +203 -0
  85. package/out/cli/components/vue/base-components/vue-document-choices.js.map +1 -0
  86. package/out/cli/components/vue/base-components/vue-document-link.js +73 -0
  87. package/out/cli/components/vue/base-components/vue-document-link.js.map +1 -0
  88. package/out/cli/components/vue/base-components/vue-extended-choice.js +101 -0
  89. package/out/cli/components/vue/base-components/vue-extended-choice.js.map +1 -0
  90. package/out/cli/components/vue/base-components/vue-inventory.js +532 -0
  91. package/out/cli/components/vue/base-components/vue-inventory.js.map +1 -0
  92. package/out/cli/components/vue/base-components/vue-macro-choice.js +150 -0
  93. package/out/cli/components/vue/base-components/vue-macro-choice.js.map +1 -0
  94. package/out/cli/components/vue/base-components/vue-measured-template.js +543 -0
  95. package/out/cli/components/vue/base-components/vue-measured-template.js.map +1 -0
  96. package/out/cli/components/vue/base-components/vue-money.js +496 -0
  97. package/out/cli/components/vue/base-components/vue-money.js.map +1 -0
  98. package/out/cli/components/vue/base-components/vue-number.js +184 -0
  99. package/out/cli/components/vue/base-components/vue-number.js.map +1 -0
  100. package/out/cli/components/vue/base-components/vue-paperdoll.js +56 -0
  101. package/out/cli/components/vue/base-components/vue-paperdoll.js.map +1 -0
  102. package/out/cli/components/vue/base-components/vue-parent-property-reference.js +89 -0
  103. package/out/cli/components/vue/base-components/vue-parent-property-reference.js.map +1 -0
  104. package/out/cli/components/vue/base-components/vue-prosemirror.js +31 -0
  105. package/out/cli/components/vue/base-components/vue-prosemirror.js.map +1 -0
  106. package/out/cli/components/vue/base-components/vue-resource.js +149 -0
  107. package/out/cli/components/vue/base-components/vue-resource.js.map +1 -0
  108. package/out/cli/components/vue/base-components/vue-roll-visualizer.js +121 -0
  109. package/out/cli/components/vue/base-components/vue-roll-visualizer.js.map +1 -0
  110. package/out/cli/components/vue/base-components/vue-self-property-reference.js +75 -0
  111. package/out/cli/components/vue/base-components/vue-self-property-reference.js.map +1 -0
  112. package/out/cli/components/vue/base-components/vue-string-choice.js +111 -0
  113. package/out/cli/components/vue/base-components/vue-string-choice.js.map +1 -0
  114. package/out/cli/components/vue/base-components/vue-string-choices.js +216 -0
  115. package/out/cli/components/vue/base-components/vue-string-choices.js.map +1 -0
  116. package/out/cli/components/vue/base-components/vue-string.js +73 -0
  117. package/out/cli/components/vue/base-components/vue-string.js.map +1 -0
  118. package/out/cli/components/vue/base-components/vue-text-field.js +66 -0
  119. package/out/cli/components/vue/base-components/vue-text-field.js.map +1 -0
  120. package/out/cli/components/vue/base-components/vue-tracker.js +444 -0
  121. package/out/cli/components/vue/base-components/vue-tracker.js.map +1 -0
  122. package/out/cli/components/vue/vue-action-component-generator.js +88 -0
  123. package/out/cli/components/vue/vue-action-component-generator.js.map +1 -0
  124. package/out/cli/components/vue/vue-active-effect-sheet-generator.js +1016 -0
  125. package/out/cli/components/vue/vue-active-effect-sheet-generator.js.map +1 -0
  126. package/out/cli/components/vue/vue-base-components-generator.js +59 -0
  127. package/out/cli/components/vue/vue-base-components-generator.js.map +1 -0
  128. package/out/cli/components/vue/vue-datatable-component-generator.js +307 -0
  129. package/out/cli/components/vue/vue-datatable-component-generator.js.map +1 -0
  130. package/out/cli/components/vue/vue-datatable-sheet-class-generator.js +342 -0
  131. package/out/cli/components/vue/vue-datatable-sheet-class-generator.js.map +1 -0
  132. package/out/cli/components/vue/vue-datatable2-component-generator.js +939 -0
  133. package/out/cli/components/vue/vue-datatable2-component-generator.js.map +1 -0
  134. package/out/cli/components/vue/vue-document-creation-app.js +140 -0
  135. package/out/cli/components/vue/vue-document-creation-app.js.map +1 -0
  136. package/out/cli/components/vue/vue-document-creation-sheet.js +105 -0
  137. package/out/cli/components/vue/vue-document-creation-sheet.js.map +1 -0
  138. package/out/cli/components/vue/vue-generator.js +240 -0
  139. package/out/cli/components/vue/vue-generator.js.map +1 -0
  140. package/out/cli/components/vue/vue-mixin.js +338 -0
  141. package/out/cli/components/vue/vue-mixin.js.map +1 -0
  142. package/out/cli/components/vue/vue-pinned-datatable-component-generator.js +306 -0
  143. package/out/cli/components/vue/vue-pinned-datatable-component-generator.js.map +1 -0
  144. package/out/cli/components/vue/vue-prompt-generator.js +201 -0
  145. package/out/cli/components/vue/vue-prompt-generator.js.map +1 -0
  146. package/out/cli/components/vue/vue-prompt-sheet-class-generator.js +252 -0
  147. package/out/cli/components/vue/vue-prompt-sheet-class-generator.js.map +1 -0
  148. package/out/cli/components/vue/vue-sheet-application-generator.js +2008 -0
  149. package/out/cli/components/vue/vue-sheet-application-generator.js.map +1 -0
  150. package/out/cli/components/vue/vue-sheet-class-generator.js +484 -0
  151. package/out/cli/components/vue/vue-sheet-class-generator.js.map +1 -0
  152. package/out/cli/generator.js +659 -0
  153. package/out/cli/generator.js.map +1 -0
  154. package/out/cli/main.js +43 -0
  155. package/out/cli/main.js.map +1 -0
  156. package/out/datatables.min.css +54 -0
  157. package/out/datatables.min.js +178 -0
  158. package/out/extension/github/githubAuthProvider.js +345 -0
  159. package/out/extension/github/githubAuthProvider.js.map +1 -0
  160. package/out/extension/github/githubConfig.js +132 -0
  161. package/out/extension/github/githubConfig.js.map +1 -0
  162. package/out/extension/github/githubGistActions.js +251 -0
  163. package/out/extension/github/githubGistActions.js.map +1 -0
  164. package/out/extension/github/githubGistManager.js +255 -0
  165. package/out/extension/github/githubGistManager.js.map +1 -0
  166. package/out/extension/github/githubManager.js +1735 -0
  167. package/out/extension/github/githubManager.js.map +1 -0
  168. package/out/extension/github/githubQuickActions.js +659 -0
  169. package/out/extension/github/githubQuickActions.js.map +1 -0
  170. package/out/extension/github/githubTreeProvider.js +181 -0
  171. package/out/extension/github/githubTreeProvider.js.map +1 -0
  172. package/out/extension/github/system-workflow.yml +48 -0
  173. package/out/extension/main.cjs +70315 -0
  174. package/out/extension/main.cjs.map +7 -0
  175. package/out/extension/main.js +237 -0
  176. package/out/extension/main.js.map +1 -0
  177. package/out/extension/package.json +426 -0
  178. package/out/isdl.png +0 -0
  179. package/out/language/generated/ast.js +2992 -0
  180. package/out/language/generated/ast.js.map +1 -0
  181. package/out/language/generated/grammar.js +13970 -0
  182. package/out/language/generated/grammar.js.map +1 -0
  183. package/out/language/generated/module.js +20 -0
  184. package/out/language/generated/module.js.map +1 -0
  185. package/out/language/intelligent-system-design-language-formatter.js +85 -0
  186. package/out/language/intelligent-system-design-language-formatter.js.map +1 -0
  187. package/out/language/intelligent-system-design-language-module.js +69 -0
  188. package/out/language/intelligent-system-design-language-module.js.map +1 -0
  189. package/out/language/intelligent-system-design-language-quickfixes.js +37 -0
  190. package/out/language/intelligent-system-design-language-quickfixes.js.map +1 -0
  191. package/out/language/intelligent-system-design-language-validator.js +515 -0
  192. package/out/language/intelligent-system-design-language-validator.js.map +1 -0
  193. package/out/language/isdl-hover-provider.js +77 -0
  194. package/out/language/isdl-hover-provider.js.map +1 -0
  195. package/out/language/isdl-scope-provider.js +149 -0
  196. package/out/language/isdl-scope-provider.js.map +1 -0
  197. package/out/language/main.cjs +47655 -0
  198. package/out/language/main.cjs.map +7 -0
  199. package/out/language/main.js +11 -0
  200. package/out/language/main.js.map +1 -0
  201. package/out/missing-character.png +0 -0
  202. package/out/package.json +426 -0
  203. package/out/paperdoll_default.png +0 -0
  204. package/out/progressbar.min.js +7 -0
  205. package/out/styles.scss +722 -0
  206. package/out/test/formatting/formatter.test.js +46 -0
  207. package/out/test/formatting/formatter.test.js.map +1 -0
  208. package/out/vuetify.esm.js +30279 -0
  209. package/package.json +426 -0
@@ -0,0 +1,659 @@
1
+ import * as vscode from 'vscode';
2
+ import * as fs from 'fs';
3
+ import * as path from 'path';
4
+ import { createIntelligentSystemDesignLanguageServices } from '../../language/intelligent-system-design-language-module.js';
5
+ import { extractAstNode } from '../../cli/cli-util.js';
6
+ import { NodeFileSystem } from 'langium/node';
7
+ import { isConfigExpression } from '../../language/generated/ast.js';
8
+ export class GitHubQuickActions {
9
+ constructor(githubManager) {
10
+ this.githubManager = githubManager;
11
+ }
12
+ /**
13
+ * Quick repository selection with search
14
+ */
15
+ async selectRepository() {
16
+ const repositories = await this.githubManager.listRepositories();
17
+ if (repositories.length === 0) {
18
+ const action = await vscode.window.showInformationMessage('No repositories found in your GitHub account.', 'Create Repository', 'Cancel');
19
+ if (action === 'Create Repository') {
20
+ await this.createRepository();
21
+ }
22
+ return;
23
+ }
24
+ // Create quick pick items
25
+ const items = [
26
+ {
27
+ label: '$(repo-create) Create New Repository',
28
+ description: 'Create a fresh repository for this system',
29
+ alwaysShow: true
30
+ },
31
+ {
32
+ label: '',
33
+ kind: vscode.QuickPickItemKind.Separator
34
+ }
35
+ ];
36
+ // Add recommended repositories (those with ISDL/Foundry keywords)
37
+ const recommended = repositories.filter(repo => repo.topics.some(topic => ['foundry-vtt', 'isdl', 'tabletop-rpg'].includes(topic)) ||
38
+ repo.description.toLowerCase().includes('foundry') ||
39
+ repo.description.toLowerCase().includes('isdl'));
40
+ if (recommended.length > 0) {
41
+ items.push({
42
+ label: 'Recommended',
43
+ kind: vscode.QuickPickItemKind.Separator
44
+ });
45
+ recommended.forEach(repo => {
46
+ items.push({
47
+ label: `$(repo) ${repo.name}`,
48
+ description: repo.private ? '$(lock) Private' : '$(unlock) Public',
49
+ detail: repo.description || 'No description',
50
+ repository: repo
51
+ });
52
+ });
53
+ }
54
+ // Add other repositories
55
+ const others = repositories.filter(repo => !recommended.includes(repo));
56
+ if (others.length > 0) {
57
+ items.push({
58
+ label: 'All Repositories',
59
+ kind: vscode.QuickPickItemKind.Separator
60
+ });
61
+ others.forEach(repo => {
62
+ items.push({
63
+ label: `$(repo) ${repo.name}`,
64
+ description: repo.private ? '$(lock) Private' : '$(unlock) Public',
65
+ detail: repo.description || 'No description',
66
+ repository: repo
67
+ });
68
+ });
69
+ }
70
+ const selection = await vscode.window.showQuickPick(items, {
71
+ title: 'Select GitHub Repository',
72
+ placeHolder: 'Choose a repository for your ISDL system',
73
+ matchOnDescription: true,
74
+ matchOnDetail: true,
75
+ ignoreFocusOut: true
76
+ });
77
+ if (!selection)
78
+ return;
79
+ if (selection.label.includes('Create New Repository')) {
80
+ await this.createRepository();
81
+ }
82
+ else if (selection.repository) {
83
+ await this.githubManager.setRepository(selection.repository);
84
+ vscode.window.showInformationMessage(`Connected to repository '${selection.repository.name}'`);
85
+ }
86
+ }
87
+ /**
88
+ * Quick repository creation with enhanced validation and options
89
+ */
90
+ async createRepository() {
91
+ var _a;
92
+ // Get repository name with validation
93
+ const workspaceFolder = (_a = vscode.workspace.workspaceFolders) === null || _a === void 0 ? void 0 : _a[0];
94
+ const defaultName = workspaceFolder ?
95
+ workspaceFolder.name.toLowerCase().replace(/[^a-z0-9-]/g, '-') : '';
96
+ const name = await vscode.window.showInputBox({
97
+ title: 'Create GitHub Repository - Step 1 of 4',
98
+ prompt: 'Repository name',
99
+ value: defaultName,
100
+ validateInput: async (value) => {
101
+ if (!value)
102
+ return 'Repository name is required';
103
+ if (!/^[a-zA-Z0-9._-]+$/.test(value))
104
+ return 'Invalid characters in repository name';
105
+ if (value.length > 100)
106
+ return 'Repository name too long (max 100 characters)';
107
+ // Check if repository already exists
108
+ const exists = await this.checkRepositoryExists(value);
109
+ if (exists)
110
+ return `Repository '${value}' already exists in your account`;
111
+ return undefined;
112
+ }
113
+ });
114
+ if (!name)
115
+ return;
116
+ // Get description
117
+ const description = await vscode.window.showInputBox({
118
+ title: 'Create GitHub Repository - Step 2 of 4',
119
+ prompt: 'Repository description (optional)',
120
+ placeHolder: 'A Foundry VTT system built with ISDL'
121
+ }) || 'A Foundry VTT system built with ISDL';
122
+ // Get visibility
123
+ const visibility = await vscode.window.showQuickPick([
124
+ {
125
+ label: '$(unlock) Public',
126
+ description: 'Anyone can see this repository',
127
+ detail: 'Required for publishing systems that others can install',
128
+ picked: true
129
+ },
130
+ {
131
+ label: '$(lock) Private',
132
+ description: 'Only you and those you add can see this repository',
133
+ detail: 'Good for work-in-progress systems'
134
+ }
135
+ ], {
136
+ title: 'Create GitHub Repository - Step 3 of 4',
137
+ placeHolder: 'Choose repository visibility'
138
+ });
139
+ if (!visibility)
140
+ return;
141
+ const isPrivate = visibility.label.includes('Private');
142
+ // Get initialization options
143
+ const options = await vscode.window.showQuickPick([
144
+ {
145
+ label: '$(book) Include README',
146
+ description: 'Generate an initial README.md',
147
+ picked: true
148
+ },
149
+ {
150
+ label: '$(package) Initialize with System Files',
151
+ description: 'Upload current ISDL system files',
152
+ picked: false
153
+ }
154
+ ], {
155
+ title: 'Create GitHub Repository - Step 4 of 4',
156
+ placeHolder: 'Select initialization options (use Space to toggle)',
157
+ canPickMany: true
158
+ });
159
+ if (!options)
160
+ return;
161
+ // Get license type if selected
162
+ let licenseTemplate;
163
+ licenseTemplate = await this.selectLicense();
164
+ if (!licenseTemplate)
165
+ return;
166
+ // Prepare repository options
167
+ const repoOptions = {
168
+ name,
169
+ description,
170
+ isPrivate,
171
+ includeReadme: options.some(opt => opt.label.includes('README')),
172
+ includeLicense: licenseTemplate,
173
+ includeGitignore: true,
174
+ initializeWithSystemFiles: options.some(opt => opt.label.includes('System Files'))
175
+ };
176
+ // Create repository with enhanced options
177
+ const repository = await this.createRepositoryWithOptions(repoOptions);
178
+ if (repository) {
179
+ vscode.window.showInformationMessage(`Repository '${name}' created successfully!`, 'Open in GitHub', 'Publish System').then(action => {
180
+ if (action === 'Open in GitHub') {
181
+ vscode.env.openExternal(vscode.Uri.parse(repository.html_url));
182
+ }
183
+ else if (action === 'Publish System') {
184
+ vscode.commands.executeCommand('isdl.github.publish');
185
+ }
186
+ });
187
+ }
188
+ }
189
+ /**
190
+ * Quick publish with progress
191
+ */
192
+ async publishSystem() {
193
+ const currentRepo = this.githubManager.getCurrentRepository();
194
+ if (!currentRepo) {
195
+ const action = await vscode.window.showInformationMessage('No repository connected. Please select a repository first.', 'Select Repository', 'Create Repository');
196
+ if (action === 'Select Repository') {
197
+ await this.selectRepository();
198
+ }
199
+ else if (action === 'Create Repository') {
200
+ await this.createRepository();
201
+ }
202
+ return;
203
+ }
204
+ await this.githubManager.publishSystem();
205
+ // The publishSystem method now handles its own success notifications
206
+ // including creating releases and providing appropriate action buttons
207
+ }
208
+ /**
209
+ * Quick update without release
210
+ */
211
+ async updateSystem() {
212
+ const currentRepo = this.githubManager.getCurrentRepository();
213
+ if (!currentRepo) {
214
+ const action = await vscode.window.showInformationMessage('No repository connected. Please select a repository first.', 'Select Repository', 'Create Repository');
215
+ if (action === 'Select Repository') {
216
+ await this.selectRepository();
217
+ }
218
+ else if (action === 'Create Repository') {
219
+ await this.createRepository();
220
+ }
221
+ return;
222
+ }
223
+ await this.githubManager.updateSystem();
224
+ // The updateSystem method handles its own success notifications
225
+ }
226
+ /**
227
+ * Disconnect repository with confirmation
228
+ */
229
+ async disconnectRepository() {
230
+ const currentRepo = this.githubManager.getCurrentRepository();
231
+ if (!currentRepo)
232
+ return;
233
+ const confirm = await vscode.window.showWarningMessage(`Disconnect from repository '${currentRepo.name}'?`, { modal: true }, 'Disconnect');
234
+ if (confirm === 'Disconnect') {
235
+ await this.githubManager.disconnectRepository();
236
+ vscode.window.showInformationMessage('Repository disconnected');
237
+ }
238
+ }
239
+ /**
240
+ * Check if repository exists in user's account
241
+ */
242
+ async checkRepositoryExists(name) {
243
+ try {
244
+ const repositories = await this.githubManager.listRepositories();
245
+ return repositories.some(repo => repo.name.toLowerCase() === name.toLowerCase());
246
+ }
247
+ catch (error) {
248
+ // If we can't check, assume it doesn't exist to allow creation
249
+ return false;
250
+ }
251
+ }
252
+ /**
253
+ * Show license selection dialog
254
+ */
255
+ async selectLicense() {
256
+ const licenseOptions = [
257
+ {
258
+ label: "lGPL-3.0 License",
259
+ description: 'Lesser General Public License',
260
+ detail: 'Allows Modules written against your System to be whatever License they choose, but requires modifications to your System to be open source',
261
+ value: 'lgpl-3.0'
262
+ },
263
+ {
264
+ label: 'MIT License',
265
+ description: 'Permissive license',
266
+ detail: 'Short and simple permissive license with conditions only requiring preservation of copyright and license notices',
267
+ value: 'mit'
268
+ },
269
+ {
270
+ label: 'The Unlicense',
271
+ description: 'Public domain',
272
+ detail: 'Releases your work into the public domain with no restrictions',
273
+ value: 'unlicense'
274
+ }
275
+ ];
276
+ const selection = await vscode.window.showQuickPick(licenseOptions, {
277
+ title: 'Select License',
278
+ placeHolder: 'Choose a license for your repository',
279
+ ignoreFocusOut: true
280
+ });
281
+ return selection === null || selection === void 0 ? void 0 : selection.value;
282
+ }
283
+ /**
284
+ * Create repository with enhanced options
285
+ */
286
+ async createRepositoryWithOptions(options) {
287
+ return await vscode.window.withProgress({
288
+ location: vscode.ProgressLocation.Notification,
289
+ title: `Creating repository ${options.name}...`,
290
+ cancellable: false
291
+ }, async (progress) => {
292
+ try {
293
+ progress.report({ message: 'Creating repository...', increment: 25 });
294
+ // Create the repository with license
295
+ const repository = await this.githubManager.createRepository(options.name, options.description, options.isPrivate, options.includeLicense);
296
+ if (!repository)
297
+ return undefined;
298
+ progress.report({ message: 'Setting up repository features...', increment: 25 });
299
+ // Add topics for better discoverability
300
+ const topics = ['foundry-vtt', 'foundryvtt', 'isdl', 'tabletop-rpg', 'game-system'];
301
+ await this.githubManager.addRepositoryTopics(repository, topics);
302
+ progress.report({ message: 'Initializing main branch...', increment: 25 });
303
+ // Initialize the main branch using Git Data API
304
+ await this.githubManager.initializeMainBranch(repository);
305
+ progress.report({ message: 'Adding initial files...', increment: 25 });
306
+ // Now add additional files if requested
307
+ if (options.includeReadme) {
308
+ const readmeContent = this.generateReadmeContent(repository, options.description);
309
+ await this.githubManager.createFile(repository, 'README.md', readmeContent, 'Add initial README');
310
+ }
311
+ // Initialize with system files if requested
312
+ if (options.initializeWithSystemFiles) {
313
+ await this.initializeWithSystemFiles(repository);
314
+ }
315
+ return repository;
316
+ }
317
+ catch (error) {
318
+ vscode.window.showErrorMessage(`Failed to create repository: ${error.message}`);
319
+ return undefined;
320
+ }
321
+ });
322
+ }
323
+ /**
324
+ * Generate comprehensive README content
325
+ */
326
+ generateReadmeContent(repository, description) {
327
+ return `# ${repository.name}
328
+
329
+ ${description}
330
+
331
+ [![Foundry VTT](https://img.shields.io/badge/Foundry-v12-informational?logo=foundryvirtualtabletop)](https://foundryvtt.com/)
332
+ [![License](https://img.shields.io/github/license/${repository.full_name})](LICENSE)
333
+ [![Latest Release](https://img.shields.io/github/v/release/${repository.full_name})](https://github.com/${repository.full_name}/releases)
334
+
335
+ ## 🎲 About
336
+
337
+ This is a **Foundry Virtual Tabletop** system built using **ISDL** (Intelligent System Design Language). ISDL allows for rapid development of complex tabletop RPG systems with modern, reactive character sheets and comprehensive game mechanics.
338
+
339
+ ## 📦 Installation
340
+
341
+ ### Automatic Installation (Recommended)
342
+ 1. Open Foundry VTT
343
+ 2. Go to the **"Game Systems"** tab
344
+ 3. Click **"Install System"**
345
+ 4. Enter this manifest URL:
346
+ \`\`\`
347
+ https://github.com/${repository.full_name}/releases/latest/download/system.json
348
+ \`\`\`
349
+ 5. Click **"Install"**
350
+
351
+ ### Manual Installation
352
+ 1. Download the latest release from [Releases](https://github.com/${repository.full_name}/releases)
353
+ 2. Extract the contents to your Foundry \`Data/systems/${repository.name}\` folder
354
+ 3. Restart Foundry VTT
355
+
356
+ ## 🚀 Features
357
+
358
+ - **🎨 Modern UI**: Responsive Vue.js components with Vuetify Material Design
359
+ - **⚡ Reactive Sheets**: Real-time updates and smooth interactions
360
+ - **🔧 Highly Configurable**: Extensive customization options for different playstyles
361
+ - **📱 Mobile Friendly**: Optimized for both desktop and tablet play
362
+ - **🎯 Dice Integration**: Advanced dice rolling with custom formulas
363
+ - **👥 Actor Management**: Comprehensive character, NPC, and creature support
364
+ - **📋 Item System**: Flexible items with custom properties and actions
365
+ - **🎭 Active Effects**: Dynamic character modifications and status tracking
366
+ - **🎪 Automation**: Built-in automation for common tasks and calculations
367
+
368
+ ## 🛠️ Development
369
+
370
+ This system was created using the ISDL VS Code extension. To modify or contribute:
371
+
372
+ ### Prerequisites
373
+ - [VS Code](https://code.visualstudio.com/)
374
+ - [ISDL Extension](https://marketplace.visualstudio.com/items?itemName=IronMooseDevelopment.isdl)
375
+ - [Node.js](https://nodejs.org/) (v18+)
376
+ - [Foundry VTT](https://foundryvtt.com/) (v12-v13)
377
+
378
+ ### Setup
379
+ \`\`\`bash
380
+ # Clone the repository
381
+ git clone https://github.com/${repository.full_name}.git
382
+ cd ${repository.name}
383
+
384
+ # Install dependencies (if any)
385
+ npm install
386
+
387
+ # Open in VS Code
388
+ code .
389
+ \`\`\`
390
+
391
+ ### Making Changes
392
+ 1. Open the \`.isdl\` files in VS Code
393
+ 2. Make your modifications using ISDL syntax
394
+ 3. Run **"ISDL: Generate System"** command (\`Ctrl+Shift+P\`)
395
+ 4. Test changes in Foundry VTT
396
+ 5. Create a pull request with your improvements
397
+
398
+
399
+ ## 📁 Project Structure
400
+
401
+ \`\`\`
402
+ ${repository.name}/
403
+ ├── system.json # System manifest
404
+ ├── template.json # Data templates
405
+ ├── *.isdl # Source ISDL files
406
+ ├── scripts/ # Generated JavaScript
407
+ ├── styles/ # Generated CSS
408
+ ├── templates/ # Handlebars templates
409
+ ├── lang/ # Localization files
410
+ └── assets/ # Images and media
411
+ \`\`\`
412
+
413
+
414
+ ## 🤝 Contributing
415
+
416
+ We welcome contributions! Here's how you can help:
417
+
418
+ 1. **🐛 Report Bugs**: Use the [issue tracker](https://github.com/${repository.full_name}/issues)
419
+ 2. **💡 Suggest Features**: Share your ideas for improvements
420
+ 3. **📝 Improve Documentation**: Help make our docs clearer
421
+ 4. **🔧 Submit Code**: Fork, modify, and create pull requests
422
+ 5. **🌍 Translate**: Help localize the system
423
+
424
+ ### Development Guidelines
425
+ - Follow ISDL best practices
426
+ - Test thoroughly before submitting
427
+ - Update documentation as needed
428
+ - Use descriptive commit messages
429
+
430
+ ## 📜 License
431
+
432
+ This project is licensed under the terms specified in the [LICENSE](LICENSE) file.
433
+
434
+ ## 🆘 Support
435
+
436
+ ### Getting Help
437
+ - **📖 Documentation**: Check the [Wiki](https://github.com/${repository.full_name}/wiki)
438
+ - **💬 Community**: Join our [Discord](https://discord.gg/foundryvtt)
439
+ - **🐛 Issues**: Report bugs on [GitHub Issues](https://github.com/${repository.full_name}/issues)
440
+ - **❓ Questions**: Use [GitHub Discussions](https://github.com/${repository.full_name}/discussions)
441
+
442
+ ---
443
+
444
+ **Built with ❤️ using [ISDL](https://marketplace.visualstudio.com/items?itemName=IronMooseDevelopment.isdl)**
445
+
446
+ *Ready to create your own ISDL system? [Get started here!](https://github.com/IronMooseDevelopment/isdl-docs)*
447
+ `;
448
+ }
449
+ /**
450
+ * Initialize repository with current system files
451
+ */
452
+ async initializeWithSystemFiles(repository) {
453
+ // Check if we have generated system files
454
+ const config = vscode.workspace.getConfiguration('isdl');
455
+ const lastSelectedFolder = config.get('lastSelectedFolder');
456
+ if (!lastSelectedFolder) {
457
+ vscode.window.showWarningMessage('No generated system files found. Generate your system first to upload files.', 'Generate System').then(action => {
458
+ if (action === 'Generate System') {
459
+ vscode.commands.executeCommand('isdl.generate');
460
+ }
461
+ });
462
+ return;
463
+ }
464
+ // Check if folder exists
465
+ if (!fs.existsSync(lastSelectedFolder)) {
466
+ vscode.window.showErrorMessage(`System files folder not found: ${lastSelectedFolder}`);
467
+ return;
468
+ }
469
+ try {
470
+ // Select which .isdl file to use if multiple exist
471
+ const selectedFile = await this.selectIsdlFile();
472
+ if (!selectedFile) {
473
+ return;
474
+ }
475
+ // Collect system files from the folder
476
+ const services = createIntelligentSystemDesignLanguageServices(NodeFileSystem).IntelligentSystemDesignLanguage;
477
+ const model = await extractAstNode(selectedFile, services);
478
+ const id = model.config.body.find(x => isConfigExpression(x) && x.type == "id").value;
479
+ const systemFiles = await this.collectSystemFiles(`${lastSelectedFolder}/${id}`);
480
+ // Add the source ISDL file to the repository
481
+ try {
482
+ const isdlContent = fs.readFileSync(selectedFile, 'utf8');
483
+ const isdlFileName = path.basename(selectedFile);
484
+ systemFiles.push({
485
+ path: isdlFileName,
486
+ content: isdlContent
487
+ });
488
+ console.log(`📝 Added source ISDL file: ${isdlFileName}`);
489
+ }
490
+ catch (error) {
491
+ console.warn(`Failed to read ISDL file ${selectedFile}:`, error);
492
+ }
493
+ if (systemFiles.length === 0) {
494
+ vscode.window.showWarningMessage('No system files found in the selected folder.');
495
+ return;
496
+ }
497
+ // Upload files with progress tracking
498
+ await vscode.window.withProgress({
499
+ location: vscode.ProgressLocation.Notification,
500
+ title: `Uploading ${systemFiles.length} system files...`,
501
+ cancellable: false
502
+ }, async (progress) => {
503
+ let lastProgress = 0;
504
+ const success = await this.githubManager.uploadFiles(repository, systemFiles, `Add ${id} system files (${systemFiles.length} files)`, (progressPercent, currentStep) => {
505
+ const increment = progressPercent - lastProgress;
506
+ lastProgress = progressPercent;
507
+ progress.report({
508
+ message: currentStep,
509
+ increment: increment
510
+ });
511
+ });
512
+ if (success) {
513
+ // Always ensure workflow file exists after uploading system files
514
+ progress.report({ message: 'Adding GitHub workflow...', increment: 10 });
515
+ await this.githubManager.ensureWorkflowFile(repository);
516
+ vscode.window.showInformationMessage(`Successfully uploaded ${systemFiles.length} system files to ${repository.name} in a single commit!`);
517
+ }
518
+ else {
519
+ vscode.window.showWarningMessage('Failed to upload system files. Check the output for details.');
520
+ }
521
+ });
522
+ }
523
+ catch (error) {
524
+ vscode.window.showErrorMessage(`Failed to upload system files: ${error.message}`);
525
+ }
526
+ }
527
+ /**
528
+ * Collect all system files from the generated folder
529
+ */
530
+ async collectSystemFiles(folderPath) {
531
+ const systemFiles = [];
532
+ try {
533
+ await this.collectFilesRecursively(folderPath, folderPath, systemFiles);
534
+ }
535
+ catch (error) {
536
+ console.error('Error collecting system files:', error);
537
+ }
538
+ return systemFiles;
539
+ }
540
+ /**
541
+ * Recursively collect files from directory
542
+ */
543
+ async collectFilesRecursively(currentPath, basePath, files) {
544
+ const items = fs.readdirSync(currentPath, { withFileTypes: true });
545
+ for (const item of items) {
546
+ const fullPath = path.join(currentPath, item.name);
547
+ if (item.isDirectory()) {
548
+ // Skip common directories that shouldn't be uploaded
549
+ if (this.shouldSkipDirectory(item.name)) {
550
+ continue;
551
+ }
552
+ // Recursively process subdirectories
553
+ await this.collectFilesRecursively(fullPath, basePath, files);
554
+ }
555
+ else if (item.isFile()) {
556
+ // Skip files that shouldn't be uploaded
557
+ if (this.shouldSkipFile(item.name)) {
558
+ continue;
559
+ }
560
+ try {
561
+ const content = fs.readFileSync(fullPath, 'utf8');
562
+ const relativePath = path.relative(basePath, fullPath).replace(/\\/g, '/');
563
+ files.push({
564
+ path: relativePath,
565
+ content: content
566
+ });
567
+ }
568
+ catch (error) {
569
+ console.warn(`Failed to read file ${fullPath}:`, error);
570
+ }
571
+ }
572
+ }
573
+ }
574
+ /**
575
+ * Determine if a directory should be skipped
576
+ */
577
+ shouldSkipDirectory(dirName) {
578
+ const skipDirs = [
579
+ 'node_modules',
580
+ '.git',
581
+ '.vscode',
582
+ 'dist',
583
+ 'build',
584
+ 'out',
585
+ '.next',
586
+ '.cache',
587
+ 'coverage',
588
+ '.nyc_output',
589
+ 'logs',
590
+ '*.log'
591
+ ];
592
+ return skipDirs.some(pattern => {
593
+ if (pattern.includes('*')) {
594
+ return dirName.match(new RegExp(pattern.replace('*', '.*')));
595
+ }
596
+ return dirName === pattern;
597
+ });
598
+ }
599
+ /**
600
+ * Select .isdl file to use for system generation
601
+ */
602
+ async selectIsdlFile() {
603
+ // Find all .isdl files in the workspace
604
+ const isdlFiles = await vscode.workspace.findFiles('**/*.isdl');
605
+ if (isdlFiles.length === 0) {
606
+ vscode.window.showErrorMessage('No .isdl files found in the workspace.');
607
+ return undefined;
608
+ }
609
+ // If only one file, use it
610
+ if (isdlFiles.length === 1) {
611
+ return isdlFiles[0].fsPath;
612
+ }
613
+ // Multiple files - prompt user to select
614
+ const items = isdlFiles.map(uri => {
615
+ const relativePath = vscode.workspace.asRelativePath(uri);
616
+ return {
617
+ label: path.basename(uri.fsPath),
618
+ description: relativePath,
619
+ detail: uri.fsPath,
620
+ uri: uri
621
+ };
622
+ });
623
+ const selection = await vscode.window.showQuickPick(items, {
624
+ title: 'Select ISDL File',
625
+ placeHolder: 'Choose which .isdl file to use for system generation',
626
+ ignoreFocusOut: true
627
+ });
628
+ if (!selection) {
629
+ return undefined;
630
+ }
631
+ return selection.uri.fsPath;
632
+ }
633
+ /**
634
+ * Determine if a file should be skipped
635
+ */
636
+ shouldSkipFile(fileName) {
637
+ const skipFiles = [
638
+ '.DS_Store',
639
+ 'Thumbs.db',
640
+ '*.log',
641
+ '*.tmp',
642
+ '*.temp',
643
+ '.env',
644
+ '.env.local',
645
+ '.env.production',
646
+ '*.key',
647
+ '*.pem',
648
+ '*.p12',
649
+ '*.pfx'
650
+ ];
651
+ return skipFiles.some(pattern => {
652
+ if (pattern.includes('*')) {
653
+ return fileName.match(new RegExp(pattern.replace('*', '.*')));
654
+ }
655
+ return fileName === pattern;
656
+ });
657
+ }
658
+ }
659
+ //# sourceMappingURL=githubQuickActions.js.map