diff --git a/.github/workflows/process-chart.yml b/.github/workflows/process-chart.yml index 3cff1feac..9cf44fef1 100644 --- a/.github/workflows/process-chart.yml +++ b/.github/workflows/process-chart.yml @@ -6,7 +6,7 @@ env: HELM_DOCS_VERSION: 1.11.0 CHART_REPOSITORY: https://charts.botkube.io/ LATEST_PLUGIN_INDEX_URL: https://storage.googleapis.com/botkube-plugins-latest/plugins-index.yaml - LATEST_X_PLUGIN_TPLS_URL: github.com/kubeshop/botkube//cmd/executor/x/templates?ref=main + LATEST_X_PLUGIN_TPLS_URL: github.com/kubeshop/botkube//cmd/executor/exec/templates?ref=main on: workflow_call: @@ -54,7 +54,7 @@ jobs: find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s/${CHART_CURRENT_VERSION}/${{ inputs.next-version }}/g" {} + find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s/${CHART_DEV_VERSION}/${{ inputs.next-version }}/g" {} + find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s~${LATEST_PLUGIN_INDEX_URL}~https://github.com/kubeshop/botkube/releases/download/${{ inputs.next-version }}/plugins-index.yaml~g" {} + - find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s~${LATEST_X_PLUGIN_TPLS_URL}~github.com/kubeshop/botkube//cmd/executor/x/templates?ref=${{ inputs.next-version }}~g" {} + + find ${HELM_FOLDER} -name "*.yaml" -exec sed -i "s~${LATEST_X_PLUGIN_TPLS_URL}~github.com/kubeshop/botkube//cmd/executor/exec/templates?ref=${{ inputs.next-version }}~g" {} + - name: Set up chart-testing uses: helm/chart-testing-action@v2.2.1 diff --git a/.goreleaser.plugin.yaml b/.goreleaser.plugin.yaml index 747693288..4fa09388f 100644 --- a/.goreleaser.plugin.yaml +++ b/.goreleaser.plugin.yaml @@ -33,9 +33,9 @@ builds: goarch: *goarch goarm: *goarm - - id: x - main: cmd/executor/x/main.go - binary: executor_x_{{ .Os }}_{{ .Arch }} + - id: exec + main: cmd/executor/exec/main.go + binary: executor_exec_{{ .Os }}_{{ .Arch }} no_unique_dist_dir: true env: *env diff --git a/cmd/executor/x/main.go b/cmd/executor/exec/main.go similarity index 93% rename from cmd/executor/x/main.go rename to cmd/executor/exec/main.go index 57d41a6f9..f7e7bcdcb 100644 --- a/cmd/executor/x/main.go +++ b/cmd/executor/exec/main.go @@ -24,7 +24,7 @@ import ( // version is set via ldflags by GoReleaser. var version = "dev" -const pluginName = "x" +const pluginName = "exec" // XExecutor implements Botkube executor plugin. type XExecutor struct{} @@ -32,17 +32,17 @@ type XExecutor struct{} func (i *XExecutor) Help(_ context.Context) (api.Message, error) { help := heredoc.Doc(` Usage: - x run [COMMAND] [FLAGS] Run a specified command with optional flags - x install [SOURCE] Install a binary using the https://github.com/zyedidia/eget syntax. + exec run [COMMAND] [FLAGS] Run a specified command with optional flags + exec install [SOURCE] Install a binary using the https://github.com/zyedidia/eget syntax. Usage Examples: # Install the Helm CLI - x install https://get.helm.sh/helm-v3.10.3-linux-amd64.tar.gz --file helm + exec install https://get.helm.sh/helm-v3.10.3-linux-amd64.tar.gz --file helm # Run the 'helm list -A' command. - x run helm list -A + exec run helm list -A Options: -h, --help Show this help message`) @@ -151,7 +151,7 @@ func (i *XExecutor) Execute(ctx context.Context, in executor.ExecuteInput) (exec case cmd.Install != nil: var ( tool = Normalize(strings.Join(cmd.Install.Tool, " ")) - command = x.Parse(fmt.Sprintf("x install %s", tool)) + command = x.Parse(fmt.Sprintf("exec install %s", tool)) dir, isCustom = cfg.TmpDir.Get() downloadCmd = fmt.Sprintf("eget %s", tool) ) @@ -210,7 +210,7 @@ func jsonSchema() api.JSONSchema { return api.JSONSchema{ Value: heredoc.Docf(`{ "$schema": "http://json-schema.org/draft-07/schema#", - "title": "x", + "title": "exec", "description": "Install and run CLIs directly from the chat window without hassle. All magic included.", "type": "object", "properties": { @@ -247,7 +247,7 @@ func getDefaultTemplateSource() string { if ver == "dev" { ver = "main" } - return fmt.Sprintf("github.com/kubeshop/botkube//cmd/executor/x/templates?ref=%s", ver) + return fmt.Sprintf("github.com/kubeshop/botkube//cmd/executor/exec/templates?ref=%s", ver) } func Normalize(in string) string { diff --git a/cmd/executor/x/templates/argo.yaml b/cmd/executor/exec/templates/argo.yaml similarity index 100% rename from cmd/executor/x/templates/argo.yaml rename to cmd/executor/exec/templates/argo.yaml diff --git a/cmd/executor/x/templates/flux.yaml b/cmd/executor/exec/templates/flux.yaml similarity index 71% rename from cmd/executor/x/templates/flux.yaml rename to cmd/executor/exec/templates/flux.yaml index 28604d48d..89ee71c2e 100644 --- a/cmd/executor/x/templates/flux.yaml +++ b/cmd/executor/exec/templates/flux.yaml @@ -18,12 +18,12 @@ templates: - trigger: command: - prefix: "x install github.com/fluxcd/flux2" + prefix: "exec install github.com/fluxcd/flux2" type: "wrapper" message: buttons: - name: "Quickstart" - command: "{{BotName}} x run quickstart flux" + command: "{{BotName}} exec run quickstart flux" style: "primary" - trigger: @@ -36,14 +36,14 @@ templates: header: "Flux Quick Start tutorial" buttons: - name: "Check prerequisites" - command: "{{BotName}} x run flux check --pre" + command: "{{BotName}} exec run flux check --pre" description: "{{BotName}} flux check --pre" - name: "Install Flux" - command: "{{BotName}} x run flux install" + command: "{{BotName}} exec run flux install" description: "{{BotName}} flux install" - name: "Create Git source" command: | - {{BotName}} x run flux create source git webapp-latest + {{BotName}} exec run flux create source git webapp-latest --url=https://github.com/stefanprodan/podinfo --branch=master --interval=3m @@ -53,17 +53,17 @@ templates: --branch=master --interval=3m - name: "List Git sources" - command: "{{BotName}} x run flux get sources git" + command: "{{BotName}} exec run flux get sources git" description: "{{BotName}} flux get sources git" - name: "Reconcile Git source" - command: "{{BotName}} x run flux reconcile source git flux-system" + command: "{{BotName}} exec run flux reconcile source git flux-system" description: "{{BotName}} flux reconcile source git flux-system" - name: "Export Git sources" - command: "{{BotName}} x run flux export source git --all" + command: "{{BotName}} exec run flux export source git --all" description: "{{BotName}} flux export source git --all" - name: "Create Kustomization" command: | - {{BotName}} x run flux create kustomization webapp-dev + {{BotName}} exec run flux create kustomization webapp-dev --source=webapp-latest --path='./deploy/webapp/' --prune=true @@ -72,7 +72,7 @@ templates: --health-check='Deployment/frontend.webapp' --health-check-timeout=2m description: | - {{BotName}} x run flux create kustomization webapp-dev + {{BotName}} exec run flux create kustomization webapp-dev --source=webapp-latest --path='./deploy/webapp/' --prune=true @@ -81,29 +81,29 @@ templates: --health-check='Deployment/frontend.webapp' --health-check-timeout=2m - name: "Reconcile Kustomization" - command: "{{BotName}} x run flux reconcile kustomization webapp-dev --with-source" + command: "{{BotName}} exec run flux reconcile kustomization webapp-dev --with-source" description: "{{BotName}} flux reconcile kustomization webapp-dev --with-source" - name: "Suspend Kustomization" - command: "{{BotName}} x run flux suspend kustomization webapp-dev" + command: "{{BotName}} exec run flux suspend kustomization webapp-dev" description: "{{BotName}} flux suspend kustomization webapp-dev" - name: "Export Kustomizations" - command: "{{BotName}} x run flux export kustomization --all" + command: "{{BotName}} exec run flux export kustomization --all" description: "{{BotName}} flux export kustomization --all" - name: "Resume Kustomization" - command: "{{BotName}} x run flux resume kustomization webapp-dev" + command: "{{BotName}} exec run flux resume kustomization webapp-dev" description: "{{BotName}} flux resume kustomization webapp-dev" - name: "Delete Kustomization" - command: "{{BotName}} x run flux delete kustomization webapp-dev" + command: "{{BotName}} exec run flux delete kustomization webapp-dev" description: "{{BotName}} flux delete kustomization webapp-dev" - name: "Delete Git source" - command: "{{BotName}} x run flux delete source git webapp-latest" + command: "{{BotName}} exec run flux delete source git webapp-latest" description: "{{BotName}} flux delete source" - name: "Delete Kustomization" - command: "{{BotName}} x run flux delete kustomization webapp-dev" + command: "{{BotName}} exec run flux delete kustomization webapp-dev" description: "{{BotName}} flux delete kustomization webapp-dev" - name: "Delete Git source" - command: "{{BotName}} x run flux delete source git webapp-latest --silent" + command: "{{BotName}} exec run flux delete source git webapp-latest --silent" description: "{{BotName}} flux delete source git webapp-latest --silent" - name: "Uninstall Flux" - command: "{{BotName}} x run flux uninstall" + command: "{{BotName}} exec run flux uninstall" description: "{{BotName}} flux uninstall" diff --git a/cmd/executor/x/templates/helm.yaml b/cmd/executor/exec/templates/helm.yaml similarity index 67% rename from cmd/executor/x/templates/helm.yaml rename to cmd/executor/exec/templates/helm.yaml index 6c603b1f9..3b355e792 100644 --- a/cmd/executor/x/templates/helm.yaml +++ b/cmd/executor/exec/templates/helm.yaml @@ -19,12 +19,12 @@ templates: - trigger: command: - prefix: "x install https://get.helm.sh/helm-v" + prefix: "exec install https://get.helm.sh/helm-v" type: "wrapper" message: buttons: - name: "Quickstart" - command: "{{BotName}} x run quickstart helm" + command: "{{BotName}} exec run quickstart helm" style: "primary" - trigger: @@ -38,31 +38,31 @@ templates: buttons: - name: "Global Help" description: "{{BotName}} helm help" - command: "{{BotName}} x run helm help" + command: "{{BotName}} exec run helm help" - name: "Version" description: "{{BotName}} helm version" - command: "{{BotName}} x run helm version" + command: "{{BotName}} exec run helm version" - name: "Install help" description: "{{BotName}} helm install -h" - command: "{{BotName}} x run helm install -h" + command: "{{BotName}} exec run helm install -h" - name: "Install by absolute URL" description: "{{BotName}} helm install\n--repo https://charts.bitnami.com/bitnami psql postgresql\n--set clusterDomain='testing.local'" - command: "{{BotName}} x run helm install\n--repo https://charts.bitnami.com/bitnami psql postgresql\n--set clusterDomain='testing.local'" + command: "{{BotName}} exec run helm install\n--repo https://charts.bitnami.com/bitnami psql postgresql\n--set clusterDomain='testing.local'" - name: "Install by chart reference:" description: "{{BotName}} helm install https://charts.bitnami.com/bitnami/postgresql-12.1.0.tgz --create-namespace -n test --generate-name" - command: "{{BotName}} x run helm install https://charts.bitnami.com/bitnami/postgresql-12.1.0.tgz --create-namespace -n test --generate-name" + command: "{{BotName}} exec run helm install https://charts.bitnami.com/bitnami/postgresql-12.1.0.tgz --create-namespace -n test --generate-name" - name: "List" description: "{{BotName}} helm list -A" - command: "{{BotName}} x run helm list -A" + command: "{{BotName}} exec run helm list -A" - name: "List with filter" description: "{{BotName}} helm list -f 'p' -A" - command: "{{BotName}} x run helm list -f 'p' -A" + command: "{{BotName}} exec run helm list -f 'p' -A" - name: "Status" description: "{{BotName}} helm status psql" - command: "{{BotName}} x run helm status psql" + command: "{{BotName}} exec run helm status psql" - name: "Upgrade" description: "{{BotName}} helm upgrade --repo https://charts.bitnami.com/bitnami psql postgresql --set clusterDomain='cluster.local'" - command: "{{BotName}} x run helm upgrade --repo https://charts.bitnami.com/bitnami psql postgresql --set clusterDomain='cluster.local'" + command: "{{BotName}} exec run helm upgrade --repo https://charts.bitnami.com/bitnami psql postgresql --set clusterDomain='cluster.local'" - name: "History" description: "{{BotName}} helm history psql" - command: "{{BotName}} x run helm history psql" + command: "{{BotName}} exec run helm history psql" diff --git a/helm/botkube/README.md b/helm/botkube/README.md index 1b79289c7..9fb76b720 100644 --- a/helm/botkube/README.md +++ b/helm/botkube/README.md @@ -53,12 +53,12 @@ Controller for the Botkube Slack app which helps you monitor your Kubernetes clu | [sources.k8s-all-events.botkube/kubernetes.context.rbac](./values.yaml#L126) | object | `{"group":{"prefix":"","static":{"values":["botkube-plugins-default"]},"type":"Static"}}` | RBAC configuration for this plugin. | | [sources.k8s-err-events.botkube/kubernetes.context.rbac](./values.yaml#L126) | object | `{"group":{"prefix":"","static":{"values":["botkube-plugins-default"]},"type":"Static"}}` | RBAC configuration for this plugin. | | [sources.k8s-create-events.botkube/kubernetes.context.rbac](./values.yaml#L126) | object | `{"group":{"prefix":"","static":{"values":["botkube-plugins-default"]},"type":"Static"}}` | RBAC configuration for this plugin. | -| [executors.bins-management.botkube/x.context.rbac](./values.yaml#L126) | object | `{"group":{"prefix":"","static":{"values":["botkube-plugins-default"]},"type":"Static"}}` | RBAC configuration for this plugin. | +| [executors.bins-management.botkube/exec.context.rbac](./values.yaml#L126) | object | `{"group":{"prefix":"","static":{"values":["botkube-plugins-default"]},"type":"Static"}}` | RBAC configuration for this plugin. | | [executors.k8s-default-tools.botkube/helm.context.rbac](./values.yaml#L126) | object | `{"group":{"prefix":"","static":{"values":["botkube-plugins-default"]},"type":"Static"}}` | RBAC configuration for this plugin. | | [executors.ai.botkube/doctor.context.rbac](./values.yaml#L126) | object | `{"group":{"prefix":"","static":{"values":["botkube-plugins-default"]},"type":"Static"}}` | RBAC configuration for this plugin. | | [executors.k8s-default-tools.botkube/kubectl.context.rbac](./values.yaml#L126) | object | `{"group":{"prefix":"","static":{"values":["botkube-plugins-default"]},"type":"Static"}}` | RBAC configuration for this plugin. | | [sources.k8s-create-events.botkube/kubernetes.context.rbac.group.type](./values.yaml#L129) | string | `"Static"` | Static impersonation for a given username and groups. | -| [executors.bins-management.botkube/x.context.rbac.group.type](./values.yaml#L129) | string | `"Static"` | Static impersonation for a given username and groups. | +| [executors.bins-management.botkube/exec.context.rbac.group.type](./values.yaml#L129) | string | `"Static"` | Static impersonation for a given username and groups. | | [sources.k8s-err-events.botkube/kubernetes.context.rbac.group.type](./values.yaml#L129) | string | `"Static"` | Static impersonation for a given username and groups. | | [sources.k8s-all-events.botkube/kubernetes.context.rbac.group.type](./values.yaml#L129) | string | `"Static"` | Static impersonation for a given username and groups. | | [sources.k8s-err-events-with-ai-support.botkube/kubernetes.context.rbac.group.type](./values.yaml#L129) | string | `"Static"` | Static impersonation for a given username and groups. | @@ -74,11 +74,11 @@ Controller for the Botkube Slack app which helps you monitor your Kubernetes clu | [executors.ai.botkube/doctor.context.rbac.group.prefix](./values.yaml#L131) | string | `""` | Prefix that will be applied to .static.value[*]. | | [sources.k8s-err-events-with-ai-support.botkube/kubernetes.context.rbac.group.prefix](./values.yaml#L131) | string | `""` | Prefix that will be applied to .static.value[*]. | | [sources.k8s-all-events.botkube/kubernetes.context.rbac.group.prefix](./values.yaml#L131) | string | `""` | Prefix that will be applied to .static.value[*]. | -| [executors.bins-management.botkube/x.context.rbac.group.prefix](./values.yaml#L131) | string | `""` | Prefix that will be applied to .static.value[*]. | +| [executors.bins-management.botkube/exec.context.rbac.group.prefix](./values.yaml#L131) | string | `""` | Prefix that will be applied to .static.value[*]. | | [sources.k8s-create-events.botkube/kubernetes.context.rbac.group.prefix](./values.yaml#L131) | string | `""` | Prefix that will be applied to .static.value[*]. | | [executors.k8s-default-tools.botkube/kubectl.context.rbac.group.prefix](./values.yaml#L131) | string | `""` | Prefix that will be applied to .static.value[*]. | | [sources.k8s-create-events.botkube/kubernetes.context.rbac.group.static.values](./values.yaml#L134) | list | `["botkube-plugins-default"]` | Name of group.rbac.authorization.k8s.io the plugin will be bound to. | -| [executors.bins-management.botkube/x.context.rbac.group.static.values](./values.yaml#L134) | list | `["botkube-plugins-default"]` | Name of group.rbac.authorization.k8s.io the plugin will be bound to. | +| [executors.bins-management.botkube/exec.context.rbac.group.static.values](./values.yaml#L134) | list | `["botkube-plugins-default"]` | Name of group.rbac.authorization.k8s.io the plugin will be bound to. | | [sources.k8s-err-events-with-ai-support.botkube/kubernetes.context.rbac.group.static.values](./values.yaml#L134) | list | `["botkube-plugins-default"]` | Name of group.rbac.authorization.k8s.io the plugin will be bound to. | | [executors.ai.botkube/doctor.context.rbac.group.static.values](./values.yaml#L134) | list | `["botkube-plugins-default"]` | Name of group.rbac.authorization.k8s.io the plugin will be bound to. | | [sources.k8s-recommendation-events.botkube/kubernetes.context.rbac.group.static.values](./values.yaml#L134) | list | `["botkube-plugins-default"]` | Name of group.rbac.authorization.k8s.io the plugin will be bound to. | diff --git a/helm/botkube/values.yaml b/helm/botkube/values.yaml index c68211f54..afc5d8fb6 100644 --- a/helm/botkube/values.yaml +++ b/helm/botkube/values.yaml @@ -555,19 +555,19 @@ executors: context: *default-plugin-context bins-management: - ## X executor configuration. + ## Exec executor configuration. ## Plugin name syntax: /[@]. If version is not provided, the latest version from repository is used. - botkube/x: + botkube/exec: enabled: false context: *default-plugin-context - ## -- Custom x plugin configuration. + ## -- Custom exec plugin configuration. config: ## -- An array of templates that define how to convert the command output into an interactive message. templates: ## -- Link to templates source ## It uses the go-getter library, which supports multiple URL formats (such as HTTP, Git repositories, or S3) and is able to unpack archives. ## For more details, see the documentation at https://github.com/hashicorp/go-getter. - - ref: github.com/kubeshop/botkube//cmd/executor/x/templates?ref=main + - ref: github.com/kubeshop/botkube//cmd/executor/exec/templates?ref=main ai: ## Doctor executor configuration. diff --git a/internal/executor/x/cmd_parse_test.go b/internal/executor/x/cmd_parse_test.go index fdef13fc4..bc7ed9cd9 100644 --- a/internal/executor/x/cmd_parse_test.go +++ b/internal/executor/x/cmd_parse_test.go @@ -12,30 +12,30 @@ func TestParse(t *testing.T) { expected Command }{ { - input: "x run helm list -A", + input: "exec run helm list -A", expected: Command{ - ToExecute: "x run helm list -A", + ToExecute: "exec run helm list -A", IsRawRequired: false, }, }, { - input: "x run helm list -A @raw", + input: "exec run helm list -A @raw", expected: Command{ - ToExecute: "x run helm list -A", + ToExecute: "exec run helm list -A", IsRawRequired: true, }, }, { - input: "x run kubectl get pods @idx:123", + input: "exec run kubectl get pods @idx:123", expected: Command{ - ToExecute: "x run kubectl get pods", + ToExecute: "exec run kubectl get pods", IsRawRequired: false, }, }, { - input: "x run kubectl get pods @idx:abc", + input: "exec run kubectl get pods @idx:abc", expected: Command{ - ToExecute: "x run kubectl get pods @idx:abc", + ToExecute: "exec run kubectl get pods @idx:abc", IsRawRequired: false, PageIndex: 1, }, diff --git a/internal/executor/x/config.go b/internal/executor/x/config.go index 9ce0f0258..ae188f13d 100644 --- a/internal/executor/x/config.go +++ b/internal/executor/x/config.go @@ -7,14 +7,14 @@ import ( "github.com/kubeshop/botkube/pkg/config" ) -// Config holds x plugin configuration. +// Config holds exec plugin configuration. type Config struct { Templates []getter.Source `yaml:"templates"` TmpDir plugin.TmpDir `yaml:"tmpDir"` Logger config.Logger } -// GetPluginDependencies returns x plugin dependencies. +// GetPluginDependencies returns exec plugin dependencies. func GetPluginDependencies() map[string]api.Dependency { return map[string]api.Dependency{ "eget": { diff --git a/internal/executor/x/output/message_parser.go b/internal/executor/x/output/message_parser.go index 84981c907..216399e91 100644 --- a/internal/executor/x/output/message_parser.go +++ b/internal/executor/x/output/message_parser.go @@ -100,14 +100,14 @@ func (p *TableCommandParser) renderActions(msgCtx template.ParseMessage, table p return api.Section{ Buttons: []api.Button{ - btnBuilder.ForCommandWithoutDesc("Raw output", fmt.Sprintf("x run %s %s", cmd, x.RawOutputIndicator)), + btnBuilder.ForCommandWithoutDesc("Raw output", fmt.Sprintf("exec run %s %s", cmd, x.RawOutputIndicator)), }, Selects: api.Selects{ Items: []api.Select{ { Type: api.StaticSelect, Name: "Actions", - Command: fmt.Sprintf("%s x run", api.MessageBotNamePlaceholder), + Command: fmt.Sprintf("%s exec run", api.MessageBotNamePlaceholder), OptionGroups: []api.OptionGroup{ { Name: "Actions", @@ -209,7 +209,7 @@ func (p *TableCommandParser) selectDropdown(name, cmd, keyTpl string, table pars return nil, 0 } - dropdownID := fmt.Sprintf("x run %s", cmd) + dropdownID := fmt.Sprintf("exec run %s", cmd) idx := p.resolveSelectIdx(state, dropdownID) if idx >= len(options) { idx = len(options) - 1 diff --git a/internal/executor/x/output/message_tutorial.go b/internal/executor/x/output/message_tutorial.go index 97295fdd1..fe561d852 100644 --- a/internal/executor/x/output/message_tutorial.go +++ b/internal/executor/x/output/message_tutorial.go @@ -54,11 +54,11 @@ func (p *TutorialWrapper) getPaginationButtons(msg template.TutorialMessage, pag var out []api.Button if pageIndex > 0 { - out = append(out, btnsBuilder.ForCommandWithoutDesc("Prev", fmt.Sprintf("x run %s @page:%d", cmd, mathx.DecreaseWithMin(pageIndex, 0)))) + out = append(out, btnsBuilder.ForCommandWithoutDesc("Prev", fmt.Sprintf("exec run %s @page:%d", cmd, mathx.DecreaseWithMin(pageIndex, 0)))) } if pageIndex*msg.Paginate.Page < allItems-1 { - out = append(out, btnsBuilder.ForCommandWithoutDesc("Next", fmt.Sprintf("x run %s @page:%d", cmd, mathx.IncreaseWithMax(pageIndex, allItems-1)), api.ButtonStylePrimary)) + out = append(out, btnsBuilder.ForCommandWithoutDesc("Next", fmt.Sprintf("exec run %s @page:%d", cmd, mathx.IncreaseWithMax(pageIndex, allItems-1)), api.ButtonStylePrimary)) } return out }