abapgit-agent 1.1.6 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.github/workflows/release.yml +3 -1
  2. package/CLAUDE.md +248 -0
  3. package/README.md +16 -2
  4. package/RELEASE_NOTES.md +80 -8
  5. package/abap/CLAUDE.md +72 -6
  6. package/abap/copilot-instructions.md +51 -0
  7. package/abap/zcl_abgagt_cmd_factory.clas.abap +2 -0
  8. package/abap/zcl_abgagt_command_tree.clas.abap +237 -0
  9. package/abap/zcl_abgagt_command_tree.clas.xml +15 -0
  10. package/abap/zcl_abgagt_command_view.clas.abap +238 -0
  11. package/abap/zcl_abgagt_command_view.clas.xml +15 -0
  12. package/abap/zcl_abgagt_resource_tree.clas.abap +70 -0
  13. package/abap/zcl_abgagt_resource_tree.clas.xml +15 -0
  14. package/abap/zcl_abgagt_resource_view.clas.abap +68 -0
  15. package/abap/zcl_abgagt_resource_view.clas.xml +15 -0
  16. package/abap/zcl_abgagt_rest_handler.clas.abap +2 -0
  17. package/abap/zcl_abgagt_viewer_clas.clas.abap +58 -0
  18. package/abap/zcl_abgagt_viewer_clas.clas.xml +15 -0
  19. package/abap/zcl_abgagt_viewer_dtel.clas.abap +98 -0
  20. package/abap/zcl_abgagt_viewer_dtel.clas.xml +15 -0
  21. package/abap/zcl_abgagt_viewer_factory.clas.abap +41 -0
  22. package/abap/zcl_abgagt_viewer_factory.clas.xml +15 -0
  23. package/abap/zcl_abgagt_viewer_intf.clas.abap +58 -0
  24. package/abap/zcl_abgagt_viewer_intf.clas.xml +15 -0
  25. package/abap/zcl_abgagt_viewer_stru.clas.abap +59 -0
  26. package/abap/zcl_abgagt_viewer_stru.clas.xml +15 -0
  27. package/abap/zcl_abgagt_viewer_tabl.clas.abap +59 -0
  28. package/abap/zcl_abgagt_viewer_tabl.clas.xml +15 -0
  29. package/abap/zif_abgagt_command.intf.abap +3 -1
  30. package/abap/zif_abgagt_viewer.intf.abap +11 -0
  31. package/abap/zif_abgagt_viewer.intf.xml +15 -0
  32. package/bin/abapgit-agent +397 -0
  33. package/docs/commands.md +27 -8
  34. package/docs/tree-command.md +303 -0
  35. package/docs/view-command.md +409 -0
  36. package/package.json +1 -1
  37. package/src/abap-client.js +22 -0
  38. package/src/agent.js +27 -0
@@ -356,6 +356,28 @@ class ABAPClient {
356
356
 
357
357
  return await this.request('POST', '/import', data, { csrfToken: this.csrfToken });
358
358
  }
359
+
360
+ /**
361
+ * Get package hierarchy tree
362
+ * @param {string} packageName - ABAP package name
363
+ * @param {number} depth - Maximum depth to traverse (default: 3, max: 10)
364
+ * @param {boolean} includeObjects - Include object counts breakdown
365
+ * @returns {object} Tree result with hierarchy and summary
366
+ */
367
+ async tree(packageName, depth = 3, includeObjects = false) {
368
+ // Fetch CSRF token first
369
+ await this.fetchCsrfToken();
370
+
371
+ const data = {
372
+ package: packageName,
373
+ depth: Math.min(Math.max(1, depth), 10),
374
+ include_objects: includeObjects
375
+ };
376
+
377
+ logger.info('Getting package tree', { package: packageName, depth: data.depth, includeObjects, service: 'abapgit-agent' });
378
+
379
+ return await this.request('POST', '/tree', data, { csrfToken: this.csrfToken });
380
+ }
359
381
  }
360
382
 
361
383
  // Singleton instance
package/src/agent.js CHANGED
@@ -164,6 +164,33 @@ class ABAPGitAgent {
164
164
  throw new Error(`Import failed: ${error.message}`);
165
165
  }
166
166
  }
167
+
168
+ /**
169
+ * Get package hierarchy tree
170
+ * @param {string} packageName - ABAP package name
171
+ * @param {number} depth - Maximum depth to traverse (default: 3)
172
+ * @param {boolean} includeObjects - Include object counts breakdown
173
+ * @returns {object} Tree result with hierarchy, summary, and metadata
174
+ */
175
+ async tree(packageName, depth = 3, includeObjects = false) {
176
+ logger.info('Getting package tree', { package: packageName, depth, includeObjects });
177
+
178
+ try {
179
+ const result = await this.abap.tree(packageName, depth, includeObjects);
180
+ return {
181
+ success: result.SUCCESS === 'X' || result.success === 'X' || result.success === true,
182
+ command: result.COMMAND || result.command || 'TREE',
183
+ package: result.PACKAGE || result.package,
184
+ message: result.MESSAGE || result.message || '',
185
+ hierarchy: result.HIERARCHY || result.hierarchy || null,
186
+ summary: result.SUMMARY || result.summary || null,
187
+ error: result.ERROR || result.error || null
188
+ };
189
+ } catch (error) {
190
+ logger.error('Tree command failed', { error: error.message });
191
+ throw new Error(`Tree command failed: ${error.message}`);
192
+ }
193
+ }
167
194
  }
168
195
 
169
196
  module.exports = {