Skip to content

Commit

Permalink
fix: add id to tool groups (#1636)
Browse files Browse the repository at this point in the history
  • Loading branch information
RutZap authored Oct 17, 2024
1 parent a0c5c8e commit e49abb9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
1 change: 1 addition & 0 deletions tools/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ func (g *Generator) generateEmbeddedActionLinks() {
displayOrder++
// embed the tool as a tool group
tool.Config.EmbeddedTools = append(tool.Config.EmbeddedTools, &toolsproto.ToolGroup{
Id: f.Name,
Title: &toolsproto.StringTemplate{Template: f.Name}, // e.g. `orderItems` on a getOrder action
DisplayOrder: int32(displayOrder),
Tools: []*toolsproto.ToolGroup_GroupActionLink{
Expand Down
26 changes: 18 additions & 8 deletions tools/proto/tools.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions tools/proto/tools.proto
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,17 @@ message ToolGroup {
// this embed group
repeated ResponseOverrides response_overrides = 2;
}

// A reference that persists for this tool group from build to build
string id = 1;

// Title of the group
StringTemplate title = 1;
StringTemplate title = 2;

int32 display_order = 2;
int32 display_order = 3;

// A list of decorated ActionLinks which will be embedded within this group
repeated GroupActionLink tools = 3;
repeated GroupActionLink tools = 4;
}

message ResponseOverrides {
Expand Down
1 change: 1 addition & 0 deletions tools/testdata/blog/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@
"createEntryAction": { "toolId": "createPost" },
"embeddedTools": [
{
"id": "comments",
"title": { "template": "comments" },
"displayOrder": 1,
"tools": [
Expand Down
1 change: 1 addition & 0 deletions tools/testdata/one_to_many_links/tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
],
"embeddedTools": [
{
"id": "items",
"title": { "template": "items" },
"displayOrder": 1,
"tools": [
Expand Down

0 comments on commit e49abb9

Please sign in to comment.