Skip to content

Commit

Permalink
Fix: add instruction for slack (#1811)
Browse files Browse the repository at this point in the history
Signed-off-by: Daishan Peng <[email protected]>
  • Loading branch information
StrongMonkey authored Feb 21, 2025
1 parent 3564cd7 commit e19aea2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
3 changes: 3 additions & 0 deletions pkg/tools/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ func ResolveToolReferences(ctx context.Context, gptClient *gptscript.GPTScript,

peerTool := prg.ToolSet[peerToolID]
toolRef := reference
if strings.HasSuffix(filepath.Base(reference), ".gpt") {
toolRef = filepath.Dir(reference)
}
if !strings.HasPrefix(peerTool.Source.Location, "http://") && !strings.HasPrefix(peerTool.Source.Location, "https://") {
relPath, err := filepath.Rel(peerTool.WorkingDir, peerTool.Source.Location)
if err != nil {
Expand Down
38 changes: 32 additions & 6 deletions ui/admin/app/lib/model/oauthApps/providers/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const schema = z.object({
clientSecret: z.string().min(1, "Client Secret is required"),
});

const scopes = [
const userScopes = [
"channels:history",
"groups:history",
"im:history",
Expand All @@ -30,6 +30,8 @@ const scopes = [
"im:write",
];

const botScopes = ["chat:write", "im:write", "users:read"];

const steps: OAuthFormStep<typeof schema.shape>[] = [
{
type: "markdown",
Expand Down Expand Up @@ -75,18 +77,42 @@ const steps: OAuthFormStep<typeof schema.shape>[] = [
{
type: "markdown",
text:
"### Step 3: Add Scopes\n" +
"### Step 3: Add User Scopes\n" +
"- Navigate to the `OAuth & Permissions` tab from the sidebar.\n" +
"- Locate the `User Token Scopes` section and add the following scopes:\n",
},
{
type: "sectionGroup",
sections: [
{
title: "Scopes: ",
title: "User Scopes: ",
displayStepsInline: true,
defaultOpen: true,
steps: userScopes.map(
(scope) =>
({
type: "copy",
text: scope,
}) as OAuthFormStep<typeof schema.shape>
),
},
],
},
{
type: "markdown",
text:
"### Step 4: Add Bot Scopes\n" +
"- Navigate to the `OAuth & Permissions` tab from the sidebar.\n" +
"- Locate the `Bot Token Scopes` section and add the following scopes:\n",
},
{
type: "sectionGroup",
sections: [
{
title: "Bot Scopes: ",
displayStepsInline: true,
defaultOpen: true,
steps: scopes.map(
steps: botScopes.map(
(scope) =>
({
type: "copy",
Expand All @@ -99,14 +125,14 @@ const steps: OAuthFormStep<typeof schema.shape>[] = [
{
type: "markdown",
text:
"### Step 4: Install the App\n" +
"### Step 5: Install the App\n" +
"- Navigate to the `OAuth & Permissions` tab from the sidebar.\n" +
"- Click on the `Install App to Workspace` (or `Reinstall to <App Name>` if it's already installed) button.\n",
},
{
type: "markdown",
text:
"### Step 5: Register OAuth App in Obot\n" +
"### Step 6: Register OAuth App in Obot\n" +
"Click the `Basic Information` section in the side nav, locate the `Client ID` and `Client Secret` fields, copy/paste them into the form below, and click `Submit`.\n",
},
{ type: "input", input: "clientID", label: "Client ID" },
Expand Down

0 comments on commit e19aea2

Please sign in to comment.