noteconnection 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/LICENSE +674 -21
  2. package/README.md +242 -62
  3. package/dist/src/agent_workspace.contract.parity.test.js +475 -0
  4. package/dist/src/agent_workspace.frontend.test.js +9989 -0
  5. package/dist/src/agent_workspace.locale.contract.test.js +95 -0
  6. package/dist/src/agent_workspace.runtime.behavior.test.js +5072 -0
  7. package/dist/src/copy.assets.contract.test.js +130 -0
  8. package/dist/src/core/PathBridge.js +28 -3
  9. package/dist/src/export/WorkspaceExportBundle.js +1130 -0
  10. package/dist/src/export/WorkspaceExportBundle.test.js +1480 -0
  11. package/dist/src/export/index.js +18 -0
  12. package/dist/src/export/types.js +2 -0
  13. package/dist/src/fixrisk.issue.verifier.contract.test.js +3 -1
  14. package/dist/src/foundation.ann.runtime.contract.test.js +81 -0
  15. package/dist/src/foundation.release.evidence.contract.test.js +406 -0
  16. package/dist/src/foundation.sqlite.runtime.contract.test.js +82 -0
  17. package/dist/src/frontend/README.md +242 -62
  18. package/dist/src/frontend/agent_workspace.js +5353 -0
  19. package/dist/src/frontend/agent_workspace_runtime.js +4434 -0
  20. package/dist/src/frontend/analysis.js +31 -4
  21. package/dist/src/frontend/app.js +2178 -62
  22. package/dist/src/frontend/focus_mode_interactions.js +33 -0
  23. package/dist/src/frontend/godot_future_path_renderer.js +540 -0
  24. package/dist/src/frontend/godot_tree_interactions.js +178 -0
  25. package/dist/src/frontend/graph_state.mjs +105 -0
  26. package/dist/src/frontend/hosted_future_path_runtime.js +157 -0
  27. package/dist/src/frontend/i18n.mjs +186 -0
  28. package/dist/src/frontend/index.html +641 -266
  29. package/dist/src/frontend/layout_gpu.js +12 -4
  30. package/dist/src/frontend/locales/en.json +721 -5
  31. package/dist/src/frontend/locales/zh.json +721 -5
  32. package/dist/src/frontend/main.mjs +60 -0
  33. package/dist/src/frontend/markdown_runtime.js +827 -0
  34. package/dist/src/frontend/notemd.css +49 -0
  35. package/dist/src/frontend/notemd.html +7 -1
  36. package/dist/src/frontend/notemd.js +64 -0
  37. package/dist/src/frontend/path.html +107 -0
  38. package/dist/src/frontend/path_app.js +2108 -130
  39. package/dist/src/frontend/path_layout.mjs +143 -0
  40. package/dist/src/frontend/path_mermaid_utils.mjs +108 -0
  41. package/dist/src/frontend/path_modules_bridge.js +486 -0
  42. package/dist/src/frontend/path_state.mjs +118 -0
  43. package/dist/src/frontend/path_styles.css +146 -0
  44. package/dist/src/frontend/path_worker_bridge.mjs +85 -0
  45. package/dist/src/frontend/reader.js +393 -33
  46. package/dist/src/frontend/runtime_bridge.js +67 -54
  47. package/dist/src/frontend/runtime_bridge.mjs +279 -0
  48. package/dist/src/frontend/settings.js +130 -12
  49. package/dist/src/frontend/source_manager.js +190 -21
  50. package/dist/src/frontend/styles.css +2720 -72
  51. package/dist/src/frontend/workbench_state.mjs +101 -0
  52. package/dist/src/frontend/workspace_panes.js +10168 -0
  53. package/dist/src/frontend.locale.contract.test.js +62 -0
  54. package/dist/src/godot.sidecar.bootstrap.contract.test.js +244 -0
  55. package/dist/src/indexing/IndexLifecycle.js +195 -0
  56. package/dist/src/indexing/IndexLifecycle.test.js +49 -0
  57. package/dist/src/indexing/SegmentBuilder.js +64 -0
  58. package/dist/src/indexing/UnitBuilder.js +48 -0
  59. package/dist/src/indexing/types.js +2 -0
  60. package/dist/src/knowledge.api.contract.test.js +170 -0
  61. package/dist/src/learning/KnowledgeLearningPlatform.js +10386 -0
  62. package/dist/src/learning/KnowledgeLearningPlatform.persistence.test.js +327 -0
  63. package/dist/src/learning/KnowledgeLearningPlatform.program-f.test.js +99 -0
  64. package/dist/src/learning/KnowledgeLearningPlatform.test.js +2971 -0
  65. package/dist/src/learning/KnowledgeWorkspaceConversationRegression.js +2974 -0
  66. package/dist/src/learning/KnowledgeWorkspaceConversationRegression.test.js +3928 -0
  67. package/dist/src/learning/answerReleaseReview.js +4319 -0
  68. package/dist/src/learning/answerReleaseReview.test.js +2888 -0
  69. package/dist/src/learning/api.js +2 -0
  70. package/dist/src/learning/conversationComposer.js +1480 -0
  71. package/dist/src/learning/conversationComposer.test.js +1817 -0
  72. package/dist/src/learning/domains/ConversationManager.js +53 -0
  73. package/dist/src/learning/domains/KnowledgeIngestor.js +238 -0
  74. package/dist/src/learning/domains/KnowledgeQuerier.js +187 -0
  75. package/dist/src/learning/domains/MasteryEngine.js +387 -0
  76. package/dist/src/learning/domains/MemoryPolicyManager.js +408 -0
  77. package/dist/src/learning/domains/QualityEvaluator.js +307 -0
  78. package/dist/src/learning/domains/TutorRouter.js +313 -0
  79. package/dist/src/learning/domains/index.js +33 -0
  80. package/dist/src/learning/domains/types.js +7 -0
  81. package/dist/src/learning/errors.js +29 -0
  82. package/dist/src/learning/evidenceContextAssembler.js +1176 -0
  83. package/dist/src/learning/evidenceContextAssembler.test.js +6332 -0
  84. package/dist/src/learning/graphContextAssembler.js +870 -0
  85. package/dist/src/learning/graphContextAssembler.test.js +1033 -0
  86. package/dist/src/learning/index.js +28 -0
  87. package/dist/src/learning/queryBackend.js +1898 -0
  88. package/dist/src/learning/queryBackend.test.js +955 -0
  89. package/dist/src/learning/ragContextPack.js +257 -0
  90. package/dist/src/learning/ragContextPack.test.js +160 -0
  91. package/dist/src/learning/ragPublicText.js +38 -0
  92. package/dist/src/learning/ragSufficiencyJudge.js +161 -0
  93. package/dist/src/learning/ragSufficiencyJudge.test.js +177 -0
  94. package/dist/src/learning/ragSufficiencyProviderJudge.js +227 -0
  95. package/dist/src/learning/ragSufficiencyProviderJudge.test.js +156 -0
  96. package/dist/src/learning/requestNormalization.js +198 -0
  97. package/dist/src/learning/runtimeCapability.js +4677 -0
  98. package/dist/src/learning/runtimeCapability.test.js +3635 -0
  99. package/dist/src/learning/store.js +1240 -0
  100. package/dist/src/learning/store.test.js +1126 -0
  101. package/dist/src/learning/tutorAdapter.js +2 -0
  102. package/dist/src/learning/types.js +2 -0
  103. package/dist/src/learning/vectorAccelerationAdapter.js +942 -0
  104. package/dist/src/learning/vectorAccelerationAdapter.test.js +382 -0
  105. package/dist/src/lfs.asset.policy.contract.test.js +153 -0
  106. package/dist/src/license.policy.contract.test.js +66 -0
  107. package/dist/src/memory/MemoryGovernance.js +74 -0
  108. package/dist/src/memory/MemoryGovernance.test.js +46 -0
  109. package/dist/src/memory/types.js +2 -0
  110. package/dist/src/mermaid.frontend.guard.contract.test.js +77 -0
  111. package/dist/src/middleware/auth.js +17 -0
  112. package/dist/src/middleware/body-parser.js +45 -0
  113. package/dist/src/middleware/cors.js +44 -0
  114. package/dist/src/middleware/index.js +21 -0
  115. package/dist/src/middleware/request-trace.js +96 -0
  116. package/dist/src/notemd/AppConfigToml.js +6 -4
  117. package/dist/src/notemd/MermaidProcessor.js +400 -50
  118. package/dist/src/notemd/NotemdService.js +498 -13
  119. package/dist/src/notemd/PromptManager.js +15 -0
  120. package/dist/src/notemd/cli/commands.js +357 -0
  121. package/dist/src/notemd/cli/dispatcher.js +225 -0
  122. package/dist/src/notemd/cli/index.js +169 -0
  123. package/dist/src/notemd/cli/parser.js +68 -0
  124. package/dist/src/notemd/cli/types.js +2 -0
  125. package/dist/src/notemd/constants.js +43 -0
  126. package/dist/src/notemd/diagram/diagramGenerationService.js +78 -0
  127. package/dist/src/notemd/diagram/diagramSpec.js +79 -0
  128. package/dist/src/notemd/diagram/diagramSpecResponseParser.js +131 -0
  129. package/dist/src/notemd/diagram/intent.js +95 -0
  130. package/dist/src/notemd/diagram/planner.js +71 -0
  131. package/dist/src/notemd/diagram/prompts/diagramSpecPrompt.js +42 -0
  132. package/dist/src/notemd/diagram/types.js +18 -0
  133. package/dist/src/notemd/index.js +26 -0
  134. package/dist/src/notemd/operations/capabilityManifest.js +23 -0
  135. package/dist/src/notemd/operations/cliContracts.js +17 -0
  136. package/dist/src/notemd/operations/configProfileCommands.js +85 -0
  137. package/dist/src/notemd/operations/registry.contract.test.js +95 -0
  138. package/dist/src/notemd/operations/registry.js +991 -0
  139. package/dist/src/notemd/operations/types.js +2 -0
  140. package/dist/src/notemd/providerDiagnostics.js +220 -0
  141. package/dist/src/notemd/providerProfiles.js +42 -0
  142. package/dist/src/notemd/providerTemplates.js +231 -0
  143. package/dist/src/notemd/search/DuckDuckGoProvider.js +39 -0
  144. package/dist/src/notemd/search/SearchManager.js +13 -0
  145. package/dist/src/notemd/search/SearchProvider.js +2 -0
  146. package/dist/src/notemd/search/TavilyProvider.js +44 -0
  147. package/dist/src/notemd.agent.manifest.test.js +85 -0
  148. package/dist/src/notemd.api.contract.test.js +14 -1
  149. package/dist/src/notemd.app_config_toml.test.js +2 -1
  150. package/dist/src/notemd.batch.workflow.test.js +117 -0
  151. package/dist/src/notemd.cli.e2e.test.js +136 -0
  152. package/dist/src/notemd.core.test.js +51 -0
  153. package/dist/src/notemd.diagram.pipeline.test.js +233 -0
  154. package/dist/src/notemd.providerTemplates.test.js +34 -0
  155. package/dist/src/notemd.server.integration.test.js +143 -35
  156. package/dist/src/notemd.workflow.pipeline.test.js +162 -0
  157. package/dist/src/pathbridge.handshake.contract.test.js +16 -2
  158. package/dist/src/pathmode.background.contract.test.js +69 -0
  159. package/dist/src/pathmode.settings.api.contract.test.js +9 -0
  160. package/dist/src/pkg.sidecar.contract.test.js +9 -3
  161. package/dist/src/platform/ExportProfile.js +58 -0
  162. package/dist/src/platform/PlatformCapabilities.js +45 -0
  163. package/dist/src/platform/PlatformCapabilities.test.js +30 -0
  164. package/dist/src/platform/RenderMaterializer.js +33 -0
  165. package/dist/src/platform/RenderMaterializer.test.js +32 -0
  166. package/dist/src/query_backend.external_http.integration.test.js +410 -0
  167. package/dist/src/reader_renderer.js +404 -3
  168. package/dist/src/reader_renderer.test.js +87 -0
  169. package/dist/src/release.godot.mirror.contract.test.js +73 -0
  170. package/dist/src/resources/ResourceRegistry.js +223 -0
  171. package/dist/src/resources/ResourceRegistry.test.js +61 -0
  172. package/dist/src/resources/types.js +2 -0
  173. package/dist/src/routes/agentWorkspaceDiagnostics.js +173 -0
  174. package/dist/src/routes/data.js +267 -0
  175. package/dist/src/routes/diagnostics.js +51 -0
  176. package/dist/src/routes/index.js +23 -0
  177. package/dist/src/routes/knowledge.js +968 -0
  178. package/dist/src/routes/markdown.js +287 -0
  179. package/dist/src/routes/notemd.js +565 -0
  180. package/dist/src/routes/registry.contract.test.js +130 -0
  181. package/dist/src/routes/render.js +285 -0
  182. package/dist/src/routes/runtimeRunbookRouteOps.js +149 -0
  183. package/dist/src/routes/runtimeRunbookRouteOps.test.js +194 -0
  184. package/dist/src/routes/settings.js +6 -0
  185. package/dist/src/routes/staticFiles.js +94 -0
  186. package/dist/src/routes/types.js +2 -0
  187. package/dist/src/runtime.transport.adapter.contract.test.js +81 -0
  188. package/dist/src/server.js +11090 -1549
  189. package/dist/src/server.migration.test.js +193 -21
  190. package/dist/src/server.port.fallback.contract.test.js +63 -0
  191. package/dist/src/session/SessionStateStore.js +81 -0
  192. package/dist/src/session/SessionStateStore.test.js +58 -0
  193. package/dist/src/session/types.js +2 -0
  194. package/dist/src/settings.runtime.contract.test.js +50 -0
  195. package/dist/src/shared/types.contract.test.js +107 -0
  196. package/dist/src/shared/types.js +22 -0
  197. package/dist/src/sidecar.replacement.boundary.contract.test.js +128 -0
  198. package/dist/src/sidecar.supply.readiness.contract.test.js +144 -0
  199. package/dist/src/source_manager.loadflow.test.js +46 -0
  200. package/dist/src/startup.layout.snapshot.contract.test.js +57 -0
  201. package/dist/src/tauri.frontend.build.contract.test.js +60 -0
  202. package/dist/src/tauri.sidecar.cleanup.contract.test.js +21 -0
  203. package/dist/src/utils/RuntimePaths.js +4 -13
  204. package/dist/src/utils/platform.js +153 -0
  205. package/dist/src/workflows/WorkflowArtifactStore.js +96 -0
  206. package/dist/src/workflows/WorkflowArtifactStore.test.js +80 -0
  207. package/dist/src/workflows/types.js +2 -0
  208. package/dist/src/workspace/WorkspaceRegistry.js +122 -0
  209. package/dist/src/workspace/WorkspaceRegistry.test.js +29 -0
  210. package/dist/src/workspace/types.js +2 -0
  211. package/package.json +53 -10
@@ -0,0 +1,991 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listOperationDefinitions = listOperationDefinitions;
4
+ exports.getOperationDefinition = getOperationDefinition;
5
+ const COMMAND_TRIGGER_SURFACES = ['command-palette', 'hotkey', 'official-cli-command'];
6
+ function staticBinding(commandId, metadata, overrides = {}) {
7
+ return {
8
+ commandId,
9
+ automationLevel: metadata.automationLevel,
10
+ requiredContext: metadata.requiredContext,
11
+ sideEffectClass: metadata.sideEffectClass,
12
+ surfaces: [...COMMAND_TRIGGER_SURFACES],
13
+ mappingKind: 'exact',
14
+ ...overrides
15
+ };
16
+ }
17
+ // ── Schema helpers ──
18
+ const STRING_ARRAY_SCHEMA = {
19
+ type: 'array',
20
+ items: { type: 'string' }
21
+ };
22
+ const ERROR_ARRAY_SCHEMA = {
23
+ type: 'array',
24
+ items: {
25
+ type: 'object',
26
+ properties: {
27
+ file: { type: 'string' },
28
+ message: { type: 'string' }
29
+ }
30
+ }
31
+ };
32
+ const EMPTY_OBJECT_INPUT_SCHEMA = {
33
+ type: 'object',
34
+ properties: {}
35
+ };
36
+ const PROVIDER_DIAGNOSTIC_INPUT_SCHEMA = {
37
+ type: 'object',
38
+ required: ['providerName', 'model', 'callMode', 'timeoutMs', 'stabilityRuns'],
39
+ properties: {
40
+ providerName: { type: 'string' },
41
+ model: { type: 'string' },
42
+ callMode: { type: 'string' },
43
+ timeoutMs: { type: 'number' },
44
+ stabilityRuns: { type: 'number' }
45
+ }
46
+ };
47
+ const PROVIDER_DIAGNOSTIC_RESULT_SCHEMA = {
48
+ type: 'object',
49
+ required: ['success', 'elapsedMs', 'callMode', 'requestedCallMode', 'logs', 'report'],
50
+ properties: {
51
+ success: { type: 'boolean' },
52
+ elapsedMs: { type: 'number' },
53
+ callMode: { type: 'string' },
54
+ requestedCallMode: { type: 'string' },
55
+ responseText: { type: 'string' },
56
+ errorMessage: { type: 'string' },
57
+ debugInfo: { type: 'string' },
58
+ logs: { type: 'array' },
59
+ report: { type: 'string' }
60
+ }
61
+ };
62
+ const PROVIDER_DIAGNOSTIC_STABILITY_RESULT_SCHEMA = {
63
+ type: 'object',
64
+ required: ['runs', 'callMode', 'requestedCallMode', 'successCount', 'failureCount', 'totalElapsedMs', 'runResults', 'report'],
65
+ properties: {
66
+ runs: { type: 'number' },
67
+ callMode: { type: 'string' },
68
+ requestedCallMode: { type: 'string' },
69
+ successCount: { type: 'number' },
70
+ failureCount: { type: 'number' },
71
+ totalElapsedMs: { type: 'number' },
72
+ runResults: { type: 'array' },
73
+ report: { type: 'string' }
74
+ }
75
+ };
76
+ const PROVIDER_CONNECTION_TEST_INPUT_SCHEMA = {
77
+ type: 'object',
78
+ properties: {
79
+ providerName: { type: 'string' },
80
+ enableApiErrorDebugMode: { type: 'boolean' }
81
+ }
82
+ };
83
+ const PROVIDER_CONNECTION_TEST_RESULT_SCHEMA = {
84
+ type: 'object',
85
+ properties: {
86
+ kind: { type: 'string', enum: ['success', 'failure', 'error'] },
87
+ statusMessage: { type: 'string' },
88
+ providerName: { type: 'string' },
89
+ success: { type: 'boolean' },
90
+ message: { type: 'string' },
91
+ errorMessage: { type: 'string' },
92
+ errorDetails: { type: 'string' }
93
+ }
94
+ };
95
+ const DIAGRAM_GENERATE_INPUT_SCHEMA = {
96
+ type: 'object',
97
+ required: ['sourceMarkdown', 'compatibilityMode', 'outputMode'],
98
+ properties: {
99
+ sourcePath: { type: 'string' },
100
+ sourceMarkdown: { type: 'string' },
101
+ requestedIntent: { type: 'string' },
102
+ compatibilityMode: { type: 'string', enum: ['best-fit', 'legacy-mermaid'] },
103
+ outputMode: { type: 'string', enum: ['artifact', 'mermaid'] },
104
+ targetLanguage: { type: 'string' }
105
+ }
106
+ };
107
+ const DIAGRAM_GENERATE_RESULT_SCHEMA = {
108
+ type: 'object',
109
+ required: ['kind', 'executionMode', 'sourcePath', 'actionLabel'],
110
+ properties: {
111
+ kind: { type: 'string', enum: ['success', 'error'] },
112
+ executionMode: { type: 'string', enum: ['save-mermaid', 'save-artifact', 'preview-artifact'] },
113
+ sourcePath: { type: 'string' },
114
+ actionLabel: { type: 'string' },
115
+ operationInput: { type: 'object' },
116
+ generation: { type: 'object' },
117
+ outputPath: { type: 'string' },
118
+ previewOpened: { type: 'boolean' },
119
+ errorMessage: { type: 'string' }
120
+ }
121
+ };
122
+ const DIAGRAM_PREVIEW_INPUT_SCHEMA = {
123
+ type: 'object',
124
+ required: ['sourceMarkdown'],
125
+ properties: {
126
+ sourcePath: { type: 'string' },
127
+ sourceMarkdown: { type: 'string' }
128
+ }
129
+ };
130
+ const DIAGRAM_PREVIEW_RESULT_SCHEMA = {
131
+ type: 'object',
132
+ required: ['kind', 'sourcePath', 'actionLabel'],
133
+ properties: {
134
+ kind: { type: 'string', enum: ['success', 'error'] },
135
+ sourcePath: { type: 'string' },
136
+ actionLabel: { type: 'string' },
137
+ artifact: { type: 'object' },
138
+ previewOpened: { type: 'boolean' },
139
+ errorMessage: { type: 'string' }
140
+ }
141
+ };
142
+ const PROCESS_FILE_INPUT_SCHEMA = {
143
+ type: 'object',
144
+ properties: { sourcePath: { type: 'string' } }
145
+ };
146
+ const PROCESS_FILE_RESULT_SCHEMA = {
147
+ type: 'object',
148
+ properties: {
149
+ sourcePath: { type: 'string' },
150
+ requestedOutputFolderPath: { type: 'string' },
151
+ outputFolderPath: { type: 'string' },
152
+ outputFolderCreated: { type: 'boolean' },
153
+ usedCustomOutputFolder: { type: 'boolean' },
154
+ outputPath: { type: 'string' },
155
+ created: { type: 'boolean' },
156
+ overwritten: { type: 'boolean' },
157
+ movedOriginalFile: { type: 'boolean' },
158
+ moveOriginalFile: { type: 'boolean' },
159
+ chunkCount: { type: 'number' },
160
+ conceptCount: { type: 'number' },
161
+ conceptNoteFolderPath: { type: 'string' },
162
+ removedCodeFences: { type: 'boolean' }
163
+ }
164
+ };
165
+ const PROCESS_FOLDER_INPUT_SCHEMA = {
166
+ type: 'object',
167
+ properties: { folderPath: { type: 'string' } }
168
+ };
169
+ const PROCESS_FOLDER_RESULT_SCHEMA = {
170
+ type: 'object',
171
+ properties: {
172
+ folderPath: { type: 'string' },
173
+ processedFileCount: { type: 'number' },
174
+ savedCount: { type: 'number' },
175
+ cancelled: { type: 'boolean' },
176
+ fileResults: { type: 'array', items: PROCESS_FILE_RESULT_SCHEMA },
177
+ errors: ERROR_ARRAY_SCHEMA
178
+ }
179
+ };
180
+ const GENERATE_FROM_TITLE_INPUT_SCHEMA = {
181
+ type: 'object',
182
+ properties: { sourcePath: { type: 'string' } }
183
+ };
184
+ const GENERATE_FROM_TITLE_RESULT_SCHEMA = {
185
+ type: 'object',
186
+ properties: {
187
+ sourcePath: { type: 'string' },
188
+ outputPath: { type: 'string' },
189
+ title: { type: 'string' },
190
+ researchEnabled: { type: 'boolean' },
191
+ researchContextUsed: { type: 'boolean' },
192
+ modified: { type: 'boolean' }
193
+ }
194
+ };
195
+ const BATCH_GENERATE_FROM_TITLES_INPUT_SCHEMA = {
196
+ type: 'object',
197
+ properties: { folderPath: { type: 'string' } }
198
+ };
199
+ const BATCH_GENERATE_FROM_TITLES_RESULT_SCHEMA = {
200
+ type: 'object',
201
+ properties: {
202
+ sourceFolderPath: { type: 'string' },
203
+ completeFolderPath: { type: 'string' },
204
+ completeFolderCreated: { type: 'boolean' },
205
+ processedFileCount: { type: 'number' },
206
+ generatedCount: { type: 'number' },
207
+ movedCount: { type: 'number' },
208
+ cancelled: { type: 'boolean' },
209
+ fileResults: {
210
+ type: 'array',
211
+ items: {
212
+ type: 'object',
213
+ properties: {
214
+ sourcePath: { type: 'string' },
215
+ outputPath: { type: 'string' },
216
+ title: { type: 'string' },
217
+ researchEnabled: { type: 'boolean' },
218
+ researchContextUsed: { type: 'boolean' },
219
+ modified: { type: 'boolean' },
220
+ completeDestinationPath: { type: 'string' },
221
+ movedToCompleteFolder: { type: 'boolean' },
222
+ skippedMoveBecauseDestinationExists: { type: 'boolean' },
223
+ skippedMoveBecauseSourceMissing: { type: 'boolean' }
224
+ }
225
+ }
226
+ },
227
+ errors: ERROR_ARRAY_SCHEMA
228
+ }
229
+ };
230
+ const RESEARCH_SUMMARIZE_INPUT_SCHEMA = {
231
+ type: 'object',
232
+ properties: {
233
+ sourcePath: { type: 'string' },
234
+ topic: { type: 'string' }
235
+ }
236
+ };
237
+ const RESEARCH_SUMMARIZE_RESULT_SCHEMA = {
238
+ type: 'object',
239
+ properties: {
240
+ sourcePath: { type: 'string' },
241
+ topic: { type: 'string' }
242
+ }
243
+ };
244
+ const TRANSLATE_FILE_INPUT_SCHEMA = {
245
+ type: 'object',
246
+ properties: {
247
+ sourcePath: { type: 'string' },
248
+ targetLanguage: { type: 'string' },
249
+ openOutputFile: { type: 'boolean' }
250
+ }
251
+ };
252
+ const TRANSLATE_FILE_RESULT_SCHEMA = {
253
+ type: 'object',
254
+ properties: {
255
+ sourcePath: { type: 'string' },
256
+ targetLanguage: { type: 'string' },
257
+ requestedOutputFolderPath: { type: 'string' },
258
+ outputFolderPath: { type: 'string' },
259
+ outputFolderCreated: { type: 'boolean' },
260
+ usedFallbackOutputFolder: { type: 'boolean' },
261
+ outputPath: { type: 'string' },
262
+ created: { type: 'boolean' },
263
+ overwritten: { type: 'boolean' },
264
+ openedInWorkspace: { type: 'boolean' },
265
+ chunkCount: { type: 'number' }
266
+ }
267
+ };
268
+ const TRANSLATE_FOLDER_INPUT_SCHEMA = {
269
+ type: 'object',
270
+ properties: {
271
+ folderPath: { type: 'string' },
272
+ targetLanguage: { type: 'string' }
273
+ }
274
+ };
275
+ const TRANSLATE_FOLDER_RESULT_SCHEMA = {
276
+ type: 'object',
277
+ properties: {
278
+ folderPath: { type: 'string' },
279
+ requestedOutputFolderPath: { type: 'string' },
280
+ outputFolderPath: { type: 'string' },
281
+ outputFolderCreated: { type: 'boolean' },
282
+ targetLanguage: { type: 'string' },
283
+ processedFileCount: { type: 'number' },
284
+ translatedCount: { type: 'number' },
285
+ cancelled: { type: 'boolean' },
286
+ fileResults: { type: 'array', items: TRANSLATE_FILE_RESULT_SCHEMA },
287
+ errors: ERROR_ARRAY_SCHEMA
288
+ }
289
+ };
290
+ const EXTRACT_CONCEPTS_FILE_INPUT_SCHEMA = {
291
+ type: 'object',
292
+ properties: {
293
+ sourcePath: { type: 'string' },
294
+ conceptFolderPath: { type: 'string' }
295
+ }
296
+ };
297
+ const EXTRACT_CONCEPTS_FILE_RESULT_SCHEMA = {
298
+ type: 'object',
299
+ properties: {
300
+ sourcePath: { type: 'string' },
301
+ conceptCount: { type: 'number' },
302
+ createdNotePaths: STRING_ARRAY_SCHEMA
303
+ }
304
+ };
305
+ const EXTRACT_CONCEPTS_FOLDER_INPUT_SCHEMA = {
306
+ type: 'object',
307
+ properties: {
308
+ folderPath: { type: 'string' },
309
+ conceptFolderPath: { type: 'string' }
310
+ }
311
+ };
312
+ const EXTRACT_CONCEPTS_FOLDER_RESULT_SCHEMA = {
313
+ type: 'object',
314
+ properties: {
315
+ folderPath: { type: 'string' },
316
+ processedFileCount: { type: 'number' },
317
+ conceptCount: { type: 'number' },
318
+ createdNotePaths: STRING_ARRAY_SCHEMA,
319
+ errors: ERROR_ARRAY_SCHEMA
320
+ }
321
+ };
322
+ const EXTRACT_ORIGINAL_TEXT_INPUT_SCHEMA = {
323
+ type: 'object',
324
+ properties: {
325
+ sourcePath: { type: 'string' },
326
+ outputDirectory: { type: 'string' },
327
+ outputSuffix: { type: 'string' },
328
+ questions: STRING_ARRAY_SCHEMA
329
+ }
330
+ };
331
+ const EXTRACT_ORIGINAL_TEXT_RESULT_SCHEMA = {
332
+ type: 'object',
333
+ properties: {
334
+ sourcePath: { type: 'string' },
335
+ outputPath: { type: 'string' },
336
+ outputDirectory: { type: 'string' },
337
+ outputSuffix: { type: 'string' },
338
+ questionCount: { type: 'number' },
339
+ mergedMode: { type: 'boolean' }
340
+ }
341
+ };
342
+ const EXTRACT_AND_GENERATE_INPUT_SCHEMA = {
343
+ type: 'object',
344
+ properties: {
345
+ sourcePath: { type: 'string' },
346
+ conceptFolderPath: { type: 'string' }
347
+ }
348
+ };
349
+ const EXTRACT_AND_GENERATE_RESULT_SCHEMA = {
350
+ type: 'object',
351
+ properties: {
352
+ sourcePath: { type: 'string' },
353
+ conceptFolderPath: { type: 'string' },
354
+ completeFolderPath: { type: 'string' }
355
+ }
356
+ };
357
+ const DUPLICATE_CHECK_FILE_INPUT_SCHEMA = {
358
+ type: 'object',
359
+ properties: { sourcePath: { type: 'string' } }
360
+ };
361
+ const DUPLICATE_CHECK_FILE_RESULT_SCHEMA = {
362
+ type: 'object',
363
+ properties: {
364
+ sourcePath: { type: 'string' },
365
+ duplicateCount: { type: 'number' },
366
+ duplicates: STRING_ARRAY_SCHEMA
367
+ }
368
+ };
369
+ const CONCEPT_DEDUPE_INPUT_SCHEMA = {
370
+ type: 'object',
371
+ properties: {
372
+ conceptFolderPath: { type: 'string' },
373
+ duplicateCheckScopeMode: { type: 'string' }
374
+ }
375
+ };
376
+ const CONCEPT_DEDUPE_RESULT_SCHEMA = {
377
+ type: 'object',
378
+ properties: {
379
+ conceptFolderPath: { type: 'string' },
380
+ duplicateCheckScopeMode: { type: 'string' },
381
+ conceptNoteCount: { type: 'number' },
382
+ comparedNoteCount: { type: 'number' },
383
+ candidateCount: { type: 'number' },
384
+ deletionRequested: { type: 'boolean' },
385
+ deletionConfirmed: { type: 'boolean' },
386
+ removedCount: { type: 'number' },
387
+ cancelled: { type: 'boolean' },
388
+ candidates: { type: 'array', items: { type: 'object', properties: { path: { type: 'string' }, reason: { type: 'string' }, counterparts: STRING_ARRAY_SCHEMA } } },
389
+ fileResults: { type: 'array', items: { type: 'object', properties: { path: { type: 'string' }, deleted: { type: 'boolean' }, skippedBecauseMissing: { type: 'boolean' } } } },
390
+ errors: ERROR_ARRAY_SCHEMA
391
+ }
392
+ };
393
+ const BATCH_MERMAID_FIX_INPUT_SCHEMA = {
394
+ type: 'object',
395
+ properties: { folderPath: { type: 'string' } }
396
+ };
397
+ const BATCH_MERMAID_FIX_RESULT_SCHEMA = {
398
+ type: 'object',
399
+ properties: {
400
+ folderPath: { type: 'string' },
401
+ processedFileCount: { type: 'number' },
402
+ modifiedCount: { type: 'number' },
403
+ movedErrorFileCount: { type: 'number' },
404
+ remainingErrorFileCount: { type: 'number' },
405
+ reportPath: { type: 'string' },
406
+ reportCreated: { type: 'boolean' },
407
+ cancelled: { type: 'boolean' },
408
+ fileResults: {
409
+ type: 'array',
410
+ items: {
411
+ type: 'object',
412
+ properties: {
413
+ sourcePath: { type: 'string' },
414
+ currentPath: { type: 'string' },
415
+ modified: { type: 'boolean' },
416
+ initialErrorCount: { type: 'number' },
417
+ finalErrorCount: { type: 'number' },
418
+ deepDebugApplied: { type: 'boolean' },
419
+ movedToErrorFolder: { type: 'boolean' },
420
+ errorFolderDestinationPath: { type: 'string' },
421
+ skippedMoveBecauseDestinationExists: { type: 'boolean' }
422
+ }
423
+ }
424
+ },
425
+ errors: ERROR_ARRAY_SCHEMA
426
+ }
427
+ };
428
+ const FIX_FORMULA_FILE_INPUT_SCHEMA = {
429
+ type: 'object',
430
+ properties: { sourcePath: { type: 'string' } }
431
+ };
432
+ const FIX_FORMULA_FILE_RESULT_SCHEMA = {
433
+ type: 'object',
434
+ properties: {
435
+ sourcePath: { type: 'string' },
436
+ outputPath: { type: 'string' },
437
+ modified: { type: 'boolean' },
438
+ replacementCount: { type: 'number' }
439
+ }
440
+ };
441
+ const BATCH_FIX_FORMULA_INPUT_SCHEMA = {
442
+ type: 'object',
443
+ properties: { folderPath: { type: 'string' } }
444
+ };
445
+ const BATCH_FIX_FORMULA_RESULT_SCHEMA = {
446
+ type: 'object',
447
+ properties: {
448
+ folderPath: { type: 'string' },
449
+ processedFileCount: { type: 'number' },
450
+ modifiedCount: { type: 'number' },
451
+ cancelled: { type: 'boolean' },
452
+ fileResults: { type: 'array', items: FIX_FORMULA_FILE_RESULT_SCHEMA },
453
+ errors: ERROR_ARRAY_SCHEMA
454
+ }
455
+ };
456
+ const CREATE_LINK_AND_GENERATE_INPUT_SCHEMA = {
457
+ type: 'object',
458
+ properties: {
459
+ sourcePath: { type: 'string' },
460
+ selectionText: { type: 'string' },
461
+ conceptFolderPath: { type: 'string' }
462
+ }
463
+ };
464
+ const CREATE_LINK_AND_GENERATE_RESULT_SCHEMA = {
465
+ type: 'object',
466
+ properties: {
467
+ notePath: { type: 'string' },
468
+ word: { type: 'string' },
469
+ created: { type: 'boolean' }
470
+ }
471
+ };
472
+ const PROVIDER_PROFILE_IMPORT_INPUT_SCHEMA = {
473
+ type: 'object',
474
+ properties: { inputPath: { type: 'string' } }
475
+ };
476
+ const PROVIDER_PROFILE_EXPORT_RESULT_SCHEMA = {
477
+ type: 'object',
478
+ properties: {
479
+ outputPath: { type: 'string' },
480
+ profile: { type: 'object' }
481
+ }
482
+ };
483
+ const PROVIDER_PROFILE_IMPORT_RESULT_SCHEMA = {
484
+ type: 'object',
485
+ properties: {
486
+ inputPath: { type: 'string' },
487
+ importedProviders: { type: 'array' },
488
+ activeProvider: { type: 'string' },
489
+ activeProviderReset: { type: 'boolean' },
490
+ newCount: { type: 'number' },
491
+ updatedCount: { type: 'number' }
492
+ }
493
+ };
494
+ const CLI_CAPABILITY_MANIFEST_EXPORT_RESULT_SCHEMA = {
495
+ type: 'object',
496
+ properties: {
497
+ outputPath: { type: 'string' },
498
+ manifest: { type: 'object' }
499
+ }
500
+ };
501
+ const CLI_INVOCATION_CONTRACT_EXPORT_RESULT_SCHEMA = {
502
+ type: 'object',
503
+ properties: {
504
+ outputPath: { type: 'string' },
505
+ contract: { type: 'object' }
506
+ }
507
+ };
508
+ // ── Operation Definitions ──
509
+ const OPERATION_DEFINITIONS = [
510
+ {
511
+ version: 1,
512
+ capabilityLevel: 'tool',
513
+ id: 'provider.diagnostic.run',
514
+ automationLevel: 'safe',
515
+ requiredContext: 'none',
516
+ sideEffectClass: 'read-only',
517
+ commandBindings: [
518
+ staticBinding('run-developer-provider-diagnostic', {
519
+ automationLevel: 'safe',
520
+ requiredContext: 'none',
521
+ sideEffectClass: 'read-only'
522
+ })
523
+ ],
524
+ inputSchema: PROVIDER_DIAGNOSTIC_INPUT_SCHEMA,
525
+ resultSchema: PROVIDER_DIAGNOSTIC_RESULT_SCHEMA
526
+ },
527
+ {
528
+ version: 1,
529
+ capabilityLevel: 'tool',
530
+ id: 'provider.diagnostic.stability-run',
531
+ automationLevel: 'safe',
532
+ requiredContext: 'none',
533
+ sideEffectClass: 'read-only',
534
+ commandBindings: [
535
+ staticBinding('run-developer-provider-stability-diagnostic', {
536
+ automationLevel: 'safe',
537
+ requiredContext: 'none',
538
+ sideEffectClass: 'read-only'
539
+ })
540
+ ],
541
+ inputSchema: PROVIDER_DIAGNOSTIC_INPUT_SCHEMA,
542
+ resultSchema: PROVIDER_DIAGNOSTIC_STABILITY_RESULT_SCHEMA
543
+ },
544
+ {
545
+ version: 1,
546
+ capabilityLevel: 'tool',
547
+ id: 'diagram.generate',
548
+ automationLevel: 'safe',
549
+ requiredContext: 'none',
550
+ sideEffectClass: 'read-only',
551
+ commandBindings: [
552
+ staticBinding('notemd-generate-diagram', {
553
+ automationLevel: 'safe',
554
+ requiredContext: 'none',
555
+ sideEffectClass: 'read-only'
556
+ }, { defaultInput: { outputMode: 'artifact' } }),
557
+ staticBinding('notemd-summarize-as-mermaid', {
558
+ automationLevel: 'safe',
559
+ requiredContext: 'none',
560
+ sideEffectClass: 'read-only'
561
+ }, { defaultInput: { outputMode: 'mermaid', compatibilityMode: 'legacy-mermaid' } }),
562
+ staticBinding('notemd-generate-experimental-diagram', {
563
+ automationLevel: 'safe',
564
+ requiredContext: 'none',
565
+ sideEffectClass: 'read-only'
566
+ }, { mappingKind: 'legacy-alias', includeInCapabilityManifest: false, defaultInput: { outputMode: 'artifact' } })
567
+ ],
568
+ inputSchema: DIAGRAM_GENERATE_INPUT_SCHEMA,
569
+ resultSchema: DIAGRAM_GENERATE_RESULT_SCHEMA
570
+ },
571
+ {
572
+ version: 1,
573
+ capabilityLevel: 'tool',
574
+ id: 'diagram.preview',
575
+ automationLevel: 'interactive-ui',
576
+ requiredContext: 'preview-ui',
577
+ sideEffectClass: 'preview-ui',
578
+ commandBindings: [
579
+ staticBinding('notemd-preview-diagram', {
580
+ automationLevel: 'interactive-ui',
581
+ requiredContext: 'preview-ui',
582
+ sideEffectClass: 'preview-ui'
583
+ }),
584
+ staticBinding('notemd-preview-experimental-diagram', {
585
+ automationLevel: 'interactive-ui',
586
+ requiredContext: 'preview-ui',
587
+ sideEffectClass: 'preview-ui'
588
+ }, { mappingKind: 'legacy-alias', includeInCapabilityManifest: false })
589
+ ],
590
+ inputSchema: DIAGRAM_PREVIEW_INPUT_SCHEMA,
591
+ resultSchema: DIAGRAM_PREVIEW_RESULT_SCHEMA
592
+ },
593
+ {
594
+ version: 1,
595
+ capabilityLevel: 'tool',
596
+ id: 'provider.connection.test',
597
+ automationLevel: 'safe',
598
+ requiredContext: 'none',
599
+ sideEffectClass: 'read-only',
600
+ commandBindings: [
601
+ staticBinding('test-llm-connection', {
602
+ automationLevel: 'safe',
603
+ requiredContext: 'none',
604
+ sideEffectClass: 'read-only'
605
+ })
606
+ ],
607
+ inputSchema: PROVIDER_CONNECTION_TEST_INPUT_SCHEMA,
608
+ resultSchema: PROVIDER_CONNECTION_TEST_RESULT_SCHEMA
609
+ },
610
+ {
611
+ version: 1,
612
+ capabilityLevel: 'tool',
613
+ id: 'editor.create-link-and-generate',
614
+ automationLevel: 'requires-selection',
615
+ requiredContext: 'editor-selection',
616
+ sideEffectClass: 'write-file',
617
+ commandBindings: [
618
+ staticBinding('create-wiki-link-and-generate-from-selection', {
619
+ automationLevel: 'requires-selection',
620
+ requiredContext: 'editor-selection',
621
+ sideEffectClass: 'write-file'
622
+ })
623
+ ],
624
+ inputSchema: CREATE_LINK_AND_GENERATE_INPUT_SCHEMA,
625
+ resultSchema: CREATE_LINK_AND_GENERATE_RESULT_SCHEMA
626
+ },
627
+ {
628
+ version: 1,
629
+ capabilityLevel: 'tool',
630
+ id: 'file.process-add-links',
631
+ automationLevel: 'requires-active-file',
632
+ requiredContext: 'active-file',
633
+ sideEffectClass: 'write-file',
634
+ commandBindings: [
635
+ staticBinding('process-with-notemd', {
636
+ automationLevel: 'requires-active-file',
637
+ requiredContext: 'active-file',
638
+ sideEffectClass: 'write-file'
639
+ })
640
+ ],
641
+ inputSchema: PROCESS_FILE_INPUT_SCHEMA,
642
+ resultSchema: PROCESS_FILE_RESULT_SCHEMA
643
+ },
644
+ {
645
+ version: 1,
646
+ capabilityLevel: 'capability',
647
+ id: 'file.process-folder-add-links',
648
+ automationLevel: 'interactive-ui',
649
+ requiredContext: 'folder-selection',
650
+ sideEffectClass: 'batch-write',
651
+ commandBindings: [
652
+ staticBinding('process-folder-with-notemd', {
653
+ automationLevel: 'interactive-ui',
654
+ requiredContext: 'folder-selection',
655
+ sideEffectClass: 'batch-write'
656
+ })
657
+ ],
658
+ inputSchema: PROCESS_FOLDER_INPUT_SCHEMA,
659
+ resultSchema: PROCESS_FOLDER_RESULT_SCHEMA
660
+ },
661
+ {
662
+ version: 1,
663
+ capabilityLevel: 'capability',
664
+ id: 'content.generate-from-title',
665
+ automationLevel: 'requires-active-file',
666
+ requiredContext: 'active-file',
667
+ sideEffectClass: 'write-file',
668
+ commandBindings: [
669
+ staticBinding('generate-content-from-title', {
670
+ automationLevel: 'requires-active-file',
671
+ requiredContext: 'active-file',
672
+ sideEffectClass: 'write-file'
673
+ })
674
+ ],
675
+ inputSchema: GENERATE_FROM_TITLE_INPUT_SCHEMA,
676
+ resultSchema: GENERATE_FROM_TITLE_RESULT_SCHEMA
677
+ },
678
+ {
679
+ version: 1,
680
+ capabilityLevel: 'capability',
681
+ id: 'content.batch-generate-from-titles',
682
+ automationLevel: 'interactive-ui',
683
+ requiredContext: 'folder-selection',
684
+ sideEffectClass: 'batch-write',
685
+ commandBindings: [
686
+ staticBinding('batch-generate-content-from-titles', {
687
+ automationLevel: 'interactive-ui',
688
+ requiredContext: 'folder-selection',
689
+ sideEffectClass: 'batch-write'
690
+ })
691
+ ],
692
+ inputSchema: BATCH_GENERATE_FROM_TITLES_INPUT_SCHEMA,
693
+ resultSchema: BATCH_GENERATE_FROM_TITLES_RESULT_SCHEMA
694
+ },
695
+ {
696
+ version: 1,
697
+ capabilityLevel: 'capability',
698
+ id: 'research.summarize-topic',
699
+ automationLevel: 'requires-selection',
700
+ requiredContext: 'editor-selection',
701
+ sideEffectClass: 'write-file',
702
+ commandBindings: [
703
+ staticBinding('research-and-summarize-topic', {
704
+ automationLevel: 'requires-selection',
705
+ requiredContext: 'editor-selection',
706
+ sideEffectClass: 'write-file'
707
+ })
708
+ ],
709
+ inputSchema: RESEARCH_SUMMARIZE_INPUT_SCHEMA,
710
+ resultSchema: RESEARCH_SUMMARIZE_RESULT_SCHEMA
711
+ },
712
+ {
713
+ version: 1,
714
+ capabilityLevel: 'tool',
715
+ id: 'translate.file',
716
+ automationLevel: 'requires-active-file',
717
+ requiredContext: 'active-file',
718
+ sideEffectClass: 'write-file',
719
+ commandBindings: [
720
+ staticBinding('translate-file', {
721
+ automationLevel: 'requires-active-file',
722
+ requiredContext: 'active-file',
723
+ sideEffectClass: 'write-file'
724
+ })
725
+ ],
726
+ inputSchema: TRANSLATE_FILE_INPUT_SCHEMA,
727
+ resultSchema: TRANSLATE_FILE_RESULT_SCHEMA
728
+ },
729
+ {
730
+ version: 1,
731
+ capabilityLevel: 'capability',
732
+ id: 'translate.folder-batch',
733
+ automationLevel: 'interactive-ui',
734
+ requiredContext: 'folder-selection',
735
+ sideEffectClass: 'batch-write',
736
+ commandBindings: [
737
+ staticBinding('batch-translate-folder', {
738
+ automationLevel: 'interactive-ui',
739
+ requiredContext: 'folder-selection',
740
+ sideEffectClass: 'batch-write'
741
+ })
742
+ ],
743
+ inputSchema: TRANSLATE_FOLDER_INPUT_SCHEMA,
744
+ resultSchema: TRANSLATE_FOLDER_RESULT_SCHEMA
745
+ },
746
+ {
747
+ version: 1,
748
+ capabilityLevel: 'capability',
749
+ id: 'concept.extract-file',
750
+ automationLevel: 'requires-active-file',
751
+ requiredContext: 'active-file',
752
+ sideEffectClass: 'write-file',
753
+ commandBindings: [
754
+ staticBinding('extract-concepts-from-current-file', {
755
+ automationLevel: 'requires-active-file',
756
+ requiredContext: 'active-file',
757
+ sideEffectClass: 'write-file'
758
+ })
759
+ ],
760
+ inputSchema: EXTRACT_CONCEPTS_FILE_INPUT_SCHEMA,
761
+ resultSchema: EXTRACT_CONCEPTS_FILE_RESULT_SCHEMA
762
+ },
763
+ {
764
+ version: 1,
765
+ capabilityLevel: 'capability',
766
+ id: 'concept.extract-folder',
767
+ automationLevel: 'interactive-ui',
768
+ requiredContext: 'folder-selection',
769
+ sideEffectClass: 'batch-write',
770
+ commandBindings: [
771
+ staticBinding('batch-extract-concepts-from-folder', {
772
+ automationLevel: 'interactive-ui',
773
+ requiredContext: 'folder-selection',
774
+ sideEffectClass: 'batch-write'
775
+ })
776
+ ],
777
+ inputSchema: EXTRACT_CONCEPTS_FOLDER_INPUT_SCHEMA,
778
+ resultSchema: EXTRACT_CONCEPTS_FOLDER_RESULT_SCHEMA
779
+ },
780
+ {
781
+ version: 1,
782
+ capabilityLevel: 'capability',
783
+ id: 'content.extract-original-text',
784
+ automationLevel: 'requires-active-file',
785
+ requiredContext: 'active-file',
786
+ sideEffectClass: 'write-file',
787
+ commandBindings: [
788
+ staticBinding('extract-original-text', {
789
+ automationLevel: 'requires-active-file',
790
+ requiredContext: 'active-file',
791
+ sideEffectClass: 'write-file'
792
+ })
793
+ ],
794
+ inputSchema: EXTRACT_ORIGINAL_TEXT_INPUT_SCHEMA,
795
+ resultSchema: EXTRACT_ORIGINAL_TEXT_RESULT_SCHEMA
796
+ },
797
+ {
798
+ version: 1,
799
+ capabilityLevel: 'capability',
800
+ id: 'workflow.extract-and-generate',
801
+ automationLevel: 'requires-active-file',
802
+ requiredContext: 'active-file',
803
+ sideEffectClass: 'batch-write',
804
+ commandBindings: [
805
+ staticBinding('extract-concepts-and-generate-titles', {
806
+ automationLevel: 'requires-active-file',
807
+ requiredContext: 'active-file',
808
+ sideEffectClass: 'batch-write'
809
+ })
810
+ ],
811
+ inputSchema: EXTRACT_AND_GENERATE_INPUT_SCHEMA,
812
+ resultSchema: EXTRACT_AND_GENERATE_RESULT_SCHEMA
813
+ },
814
+ {
815
+ version: 1,
816
+ capabilityLevel: 'capability',
817
+ id: 'workflow.batch',
818
+ automationLevel: 'interactive-ui',
819
+ requiredContext: 'folder-selection',
820
+ sideEffectClass: 'batch-write',
821
+ commandBindings: [
822
+ staticBinding('batch-workflow', {
823
+ automationLevel: 'interactive-ui',
824
+ requiredContext: 'folder-selection',
825
+ sideEffectClass: 'batch-write'
826
+ })
827
+ ],
828
+ inputSchema: PROCESS_FOLDER_INPUT_SCHEMA,
829
+ resultSchema: PROCESS_FOLDER_RESULT_SCHEMA
830
+ },
831
+ {
832
+ version: 1,
833
+ capabilityLevel: 'capability',
834
+ id: 'duplicate.check-file',
835
+ automationLevel: 'requires-active-file',
836
+ requiredContext: 'active-file',
837
+ sideEffectClass: 'read-only',
838
+ commandBindings: [
839
+ staticBinding('check-for-duplicates', {
840
+ automationLevel: 'requires-active-file',
841
+ requiredContext: 'active-file',
842
+ sideEffectClass: 'read-only'
843
+ })
844
+ ],
845
+ inputSchema: DUPLICATE_CHECK_FILE_INPUT_SCHEMA,
846
+ resultSchema: DUPLICATE_CHECK_FILE_RESULT_SCHEMA
847
+ },
848
+ {
849
+ version: 1,
850
+ capabilityLevel: 'capability',
851
+ id: 'concept.dedupe',
852
+ automationLevel: 'interactive-ui',
853
+ requiredContext: 'folder-selection',
854
+ sideEffectClass: 'destructive',
855
+ commandBindings: [
856
+ staticBinding('check-and-remove-duplicate-concept-notes', {
857
+ automationLevel: 'interactive-ui',
858
+ requiredContext: 'folder-selection',
859
+ sideEffectClass: 'destructive'
860
+ })
861
+ ],
862
+ inputSchema: CONCEPT_DEDUPE_INPUT_SCHEMA,
863
+ resultSchema: CONCEPT_DEDUPE_RESULT_SCHEMA
864
+ },
865
+ {
866
+ version: 1,
867
+ capabilityLevel: 'capability',
868
+ id: 'mermaid.batch-fix',
869
+ automationLevel: 'interactive-ui',
870
+ requiredContext: 'folder-selection',
871
+ sideEffectClass: 'batch-write',
872
+ commandBindings: [
873
+ staticBinding('batch-mermaid-fix', {
874
+ automationLevel: 'interactive-ui',
875
+ requiredContext: 'folder-selection',
876
+ sideEffectClass: 'batch-write'
877
+ })
878
+ ],
879
+ inputSchema: BATCH_MERMAID_FIX_INPUT_SCHEMA,
880
+ resultSchema: BATCH_MERMAID_FIX_RESULT_SCHEMA
881
+ },
882
+ {
883
+ version: 1,
884
+ capabilityLevel: 'capability',
885
+ id: 'formula.fix-file',
886
+ automationLevel: 'requires-active-file',
887
+ requiredContext: 'active-file',
888
+ sideEffectClass: 'write-file',
889
+ commandBindings: [
890
+ staticBinding('fix-formula-formats', {
891
+ automationLevel: 'requires-active-file',
892
+ requiredContext: 'active-file',
893
+ sideEffectClass: 'write-file'
894
+ })
895
+ ],
896
+ inputSchema: FIX_FORMULA_FILE_INPUT_SCHEMA,
897
+ resultSchema: FIX_FORMULA_FILE_RESULT_SCHEMA
898
+ },
899
+ {
900
+ version: 1,
901
+ capabilityLevel: 'capability',
902
+ id: 'formula.batch-fix',
903
+ automationLevel: 'interactive-ui',
904
+ requiredContext: 'folder-selection',
905
+ sideEffectClass: 'batch-write',
906
+ commandBindings: [
907
+ staticBinding('batch-fix-formula-formats', {
908
+ automationLevel: 'interactive-ui',
909
+ requiredContext: 'folder-selection',
910
+ sideEffectClass: 'batch-write'
911
+ })
912
+ ],
913
+ inputSchema: BATCH_FIX_FORMULA_INPUT_SCHEMA,
914
+ resultSchema: BATCH_FIX_FORMULA_RESULT_SCHEMA
915
+ },
916
+ {
917
+ version: 1,
918
+ capabilityLevel: 'capability',
919
+ id: 'cli.capability-manifest.export',
920
+ automationLevel: 'safe',
921
+ requiredContext: 'none',
922
+ sideEffectClass: 'write-file',
923
+ commandBindings: [
924
+ staticBinding('export-cli-capability-manifest', {
925
+ automationLevel: 'safe',
926
+ requiredContext: 'none',
927
+ sideEffectClass: 'write-file'
928
+ })
929
+ ],
930
+ inputSchema: EMPTY_OBJECT_INPUT_SCHEMA,
931
+ resultSchema: CLI_CAPABILITY_MANIFEST_EXPORT_RESULT_SCHEMA
932
+ },
933
+ {
934
+ version: 1,
935
+ capabilityLevel: 'tool',
936
+ id: 'cli.invocation-contract.export',
937
+ automationLevel: 'safe',
938
+ requiredContext: 'none',
939
+ sideEffectClass: 'write-file',
940
+ commandBindings: [
941
+ staticBinding('export-cli-invocation-contract', {
942
+ automationLevel: 'safe',
943
+ requiredContext: 'none',
944
+ sideEffectClass: 'write-file'
945
+ })
946
+ ],
947
+ inputSchema: EMPTY_OBJECT_INPUT_SCHEMA,
948
+ resultSchema: CLI_INVOCATION_CONTRACT_EXPORT_RESULT_SCHEMA
949
+ },
950
+ {
951
+ version: 1,
952
+ capabilityLevel: 'tool',
953
+ id: 'provider.profile.export',
954
+ automationLevel: 'safe',
955
+ requiredContext: 'none',
956
+ sideEffectClass: 'write-file',
957
+ commandBindings: [
958
+ staticBinding('export-provider-profiles', {
959
+ automationLevel: 'safe',
960
+ requiredContext: 'none',
961
+ sideEffectClass: 'write-file'
962
+ })
963
+ ],
964
+ inputSchema: EMPTY_OBJECT_INPUT_SCHEMA,
965
+ resultSchema: PROVIDER_PROFILE_EXPORT_RESULT_SCHEMA
966
+ },
967
+ {
968
+ version: 1,
969
+ capabilityLevel: 'tool',
970
+ id: 'provider.profile.import',
971
+ automationLevel: 'safe',
972
+ requiredContext: 'none',
973
+ sideEffectClass: 'write-file',
974
+ commandBindings: [
975
+ staticBinding('import-provider-profiles', {
976
+ automationLevel: 'safe',
977
+ requiredContext: 'none',
978
+ sideEffectClass: 'write-file'
979
+ })
980
+ ],
981
+ inputSchema: PROVIDER_PROFILE_IMPORT_INPUT_SCHEMA,
982
+ resultSchema: PROVIDER_PROFILE_IMPORT_RESULT_SCHEMA
983
+ }
984
+ ];
985
+ const OPERATION_DEFINITION_MAP = new Map(OPERATION_DEFINITIONS.map(definition => [definition.id, definition]));
986
+ function listOperationDefinitions() {
987
+ return [...OPERATION_DEFINITIONS];
988
+ }
989
+ function getOperationDefinition(id) {
990
+ return OPERATION_DEFINITION_MAP.get(id);
991
+ }