@kana-ai/edgar-ext-slack 0.1.2 → 0.1.3
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.
- package/README.md +37 -16
- package/dist/src/api/setup.d.ts +5 -0
- package/dist/src/api/setup.js +40 -0
- package/dist/src/inbound/files.d.ts +8 -0
- package/dist/src/inbound/files.js +24 -0
- package/dist/src/inbound/read-link.d.ts +2 -0
- package/dist/src/inbound/read-link.js +28 -0
- package/dist/src/inbound/route.d.ts +36 -4
- package/dist/src/inbound/route.js +128 -58
- package/dist/src/inbound/socket.d.ts +1 -1
- package/dist/src/inbound/socket.js +72 -12
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/outbound/layout.js +16 -8
- package/dist/src/outbound/messages.d.ts +2 -2
- package/dist/src/outbound/progress.js +101 -8
- package/dist/src/outbound/tools.js +3 -0
- package/dist/src/outbound/words.d.ts +11 -2
- package/dist/src/outbound/words.js +18 -3
- package/dist/src/schemas/config.d.ts +1 -1
- package/dist/src/schemas/config.js +61 -15
- package/dist/src/schemas/events.d.ts +21 -1
- package/dist/src/schemas/events.js +15 -1
- package/dist/src/schemas/slack.d.ts +33 -2
- package/dist/src/schemas/slack.js +29 -2
- package/edgar-extension.json +14 -1
- package/package.json +3 -3
- package/schemas/config.json +15 -0
- package/slack-app.json +1 -0
|
@@ -11,21 +11,34 @@ export const connection = z.looseObject({ url: z.string().startsWith("wss://") }
|
|
|
11
11
|
export const posted = z.looseObject({ channel: z.string(), ts: z.string() });
|
|
12
12
|
/** The answer of `conversations.open`. */
|
|
13
13
|
export const opened = z.looseObject({ channel: z.looseObject({ id: z.string() }) });
|
|
14
|
-
/** The answer of `users.info` and `users.lookupByEmail
|
|
14
|
+
/** The answer of `users.info` and `users.lookupByEmail`: `team_id` is the person's own workspace, `is_restricted` and `is_ultra_restricted` mark a guest, and `is_stranger` a person of a workspace the app's does not share a channel with. */
|
|
15
15
|
export const userInfo = z.looseObject({
|
|
16
16
|
user: z.looseObject({
|
|
17
17
|
id: z.string(),
|
|
18
18
|
name: z.string().optional(),
|
|
19
19
|
real_name: z.string().optional(),
|
|
20
|
+
team_id: z.string().optional(),
|
|
20
21
|
is_bot: z.boolean().optional(),
|
|
21
22
|
is_restricted: z.boolean().optional(),
|
|
22
23
|
is_ultra_restricted: z.boolean().optional(),
|
|
24
|
+
is_stranger: z.boolean().optional(),
|
|
25
|
+
enterprise_user: z.looseObject({ enterprise_id: z.string().optional() }).optional(),
|
|
23
26
|
profile: z.looseObject({ email: z.string().optional() }).optional(),
|
|
24
27
|
}),
|
|
25
28
|
});
|
|
26
|
-
/** The
|
|
29
|
+
/** The envelope of an Events API event: the workspace the app is installed in and, on Enterprise Grid, its organization. */
|
|
30
|
+
export const home = z.looseObject({
|
|
31
|
+
team_id: z.string().optional(),
|
|
32
|
+
enterprise_id: z.string().nullish(),
|
|
33
|
+
});
|
|
34
|
+
/** The answer of `auth.test`: the bot user's name, as `/invite @<user>` takes it. */
|
|
35
|
+
export const identity = z.looseObject({ user: z.string() });
|
|
36
|
+
/** The answer of `conversations.info`: what kind of conversation a channel id names, and whether the bot can post there. */
|
|
27
37
|
export const channelInfo = z.looseObject({
|
|
28
38
|
channel: z.looseObject({
|
|
39
|
+
name: z.string().optional(),
|
|
40
|
+
is_member: z.boolean().optional(),
|
|
41
|
+
is_archived: z.boolean().optional(),
|
|
29
42
|
is_private: z.boolean().optional(),
|
|
30
43
|
is_im: z.boolean().optional(),
|
|
31
44
|
is_mpim: z.boolean().optional(),
|
|
@@ -58,7 +71,20 @@ export const envelope = z.looseObject({
|
|
|
58
71
|
reason: z.string().optional(),
|
|
59
72
|
payload: z.unknown().optional(),
|
|
60
73
|
});
|
|
74
|
+
/** The payload of an Events API envelope, as far as its id goes: Slack keeps `event_id` on each redelivery of one event, and the legacy verification `token`, which EDGAR does not store. */
|
|
75
|
+
export const delivered = z.looseObject({
|
|
76
|
+
event_id: z.string().min(1).optional(),
|
|
77
|
+
token: z.unknown().optional(),
|
|
78
|
+
});
|
|
61
79
|
/** A message, a thread reply or a mention, as `message.im`, `message.channels`, `message.groups` and `app_mention` deliver it. */
|
|
80
|
+
/** A file of a message, as far as a chat reads it; Slack leaves out the link of a file it hides. */
|
|
81
|
+
export const sharedFile = z.looseObject({
|
|
82
|
+
id: z.string().min(1),
|
|
83
|
+
name: z.string().min(1).optional(),
|
|
84
|
+
mimetype: z.string().optional(),
|
|
85
|
+
size: z.number().int().nonnegative().optional(),
|
|
86
|
+
url_private_download: z.string().startsWith("https://").optional(),
|
|
87
|
+
});
|
|
62
88
|
export const said = z.looseObject({
|
|
63
89
|
type: z.enum(["message", "app_mention"]),
|
|
64
90
|
channel: z.string(),
|
|
@@ -69,6 +95,7 @@ export const said = z.looseObject({
|
|
|
69
95
|
channel_type: z.string().optional(),
|
|
70
96
|
bot_id: z.string().optional(),
|
|
71
97
|
subtype: z.string().optional(),
|
|
98
|
+
files: z.array(z.unknown()).optional(),
|
|
72
99
|
});
|
|
73
100
|
/** A person pressed the stop button of an agent session. */
|
|
74
101
|
export const stopped = z.looseObject({
|
package/edgar-extension.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "slack",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"config_schema": "schemas/config.json",
|
|
6
6
|
"secrets": [
|
|
7
7
|
{
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"secrets": ["SLACK_BOT_TOKEN"],
|
|
26
26
|
"capabilities": ["network:slack.com"],
|
|
27
27
|
"side_effect": true,
|
|
28
|
+
"publishes": true,
|
|
28
29
|
"compensate": "delete_message",
|
|
29
30
|
"lookup": "find_message",
|
|
30
31
|
"approval": "never",
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"secrets": ["SLACK_BOT_TOKEN"],
|
|
39
40
|
"capabilities": ["network:slack.com"],
|
|
40
41
|
"side_effect": true,
|
|
42
|
+
"publishes": true,
|
|
41
43
|
"compensate": "delete_message",
|
|
42
44
|
"lookup": "find_message",
|
|
43
45
|
"approval": "never",
|
|
@@ -51,6 +53,7 @@
|
|
|
51
53
|
"secrets": ["SLACK_BOT_TOKEN"],
|
|
52
54
|
"capabilities": ["network:slack.com"],
|
|
53
55
|
"side_effect": true,
|
|
56
|
+
"publishes": true,
|
|
54
57
|
"undo": "none",
|
|
55
58
|
"undo_reason": "a question stays in its thread, since a person may already have read or answered it",
|
|
56
59
|
"approval": "never",
|
|
@@ -94,6 +97,7 @@
|
|
|
94
97
|
"attempt_started",
|
|
95
98
|
"attempt_outcome",
|
|
96
99
|
"approval_requested",
|
|
100
|
+
"waiting_for_slot",
|
|
97
101
|
"run_outcome"
|
|
98
102
|
],
|
|
99
103
|
"secrets": ["SLACK_BOT_TOKEN"],
|
|
@@ -103,5 +107,14 @@
|
|
|
103
107
|
"service": {
|
|
104
108
|
"secrets": ["SLACK_BOT_TOKEN", "SLACK_APP_TOKEN"],
|
|
105
109
|
"capabilities": ["network:slack.com", "network:*.slack.com"]
|
|
110
|
+
},
|
|
111
|
+
"read_link": {
|
|
112
|
+
"hosts": ["*.slack.com"],
|
|
113
|
+
"secrets": ["SLACK_BOT_TOKEN"],
|
|
114
|
+
"capabilities": ["network:slack.com"]
|
|
115
|
+
},
|
|
116
|
+
"chat_files": {
|
|
117
|
+
"hosts": ["files.slack.com"],
|
|
118
|
+
"secret": "SLACK_BOT_TOKEN"
|
|
106
119
|
}
|
|
107
120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kana-ai/edgar-ext-slack",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "EDGAR extension for Slack: a DM or a mention opens a card, the thread shows each stage, and tools post the summary, send a DM, ask a person and delete a message.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
".": "./dist/src/index.js"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@kana-ai/edgar-contracts": "0.1.
|
|
26
|
-
"@kana-ai/edgar-sdk": "0.1.
|
|
25
|
+
"@kana-ai/edgar-contracts": "0.1.3",
|
|
26
|
+
"@kana-ai/edgar-sdk": "0.1.3",
|
|
27
27
|
"zod": "4.6.7"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
package/schemas/config.json
CHANGED
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
"properties": {
|
|
5
5
|
"inbound": {
|
|
6
6
|
"default": "socket",
|
|
7
|
+
"description": "How Slack reaches EDGAR: socket or events. With events, the service only waits, because EDGAR has no Slack webhook receiver yet. Default socket.",
|
|
7
8
|
"type": "string",
|
|
8
9
|
"enum": ["socket", "events"]
|
|
9
10
|
},
|
|
10
11
|
"open_card_on": {
|
|
11
12
|
"default": ["dm", "mention"],
|
|
13
|
+
"description": "Which messages open a card: a DM, a mention, or both. Default both.",
|
|
12
14
|
"type": "array",
|
|
13
15
|
"items": {
|
|
14
16
|
"type": "string",
|
|
@@ -17,20 +19,24 @@
|
|
|
17
19
|
},
|
|
18
20
|
"card_column": {
|
|
19
21
|
"default": "intake",
|
|
22
|
+
"description": "The engine state of a card that a Slack message opens. Default intake.",
|
|
20
23
|
"type": "string",
|
|
21
24
|
"minLength": 1
|
|
22
25
|
},
|
|
23
26
|
"context_messages": {
|
|
24
27
|
"default": 20,
|
|
28
|
+
"description": "How many of the thread's newest messages go onto the card when the message is a mention in a thread, from 0 to 100. Default 20.",
|
|
25
29
|
"type": "integer",
|
|
26
30
|
"minimum": 0,
|
|
27
31
|
"maximum": 100
|
|
28
32
|
},
|
|
29
33
|
"allow": {
|
|
34
|
+
"description": "Who may open a card; a bot never does. Not set: everyone.",
|
|
30
35
|
"type": "object",
|
|
31
36
|
"properties": {
|
|
32
37
|
"domains": {
|
|
33
38
|
"default": [],
|
|
39
|
+
"description": "Only a person whose email is in one of these domains opens a card. Default empty: any domain.",
|
|
34
40
|
"type": "array",
|
|
35
41
|
"items": {
|
|
36
42
|
"type": "string",
|
|
@@ -39,6 +45,7 @@
|
|
|
39
45
|
},
|
|
40
46
|
"guests": {
|
|
41
47
|
"default": false,
|
|
48
|
+
"description": "Whether a guest account may open a card. Default false.",
|
|
42
49
|
"type": "boolean"
|
|
43
50
|
}
|
|
44
51
|
},
|
|
@@ -46,6 +53,8 @@
|
|
|
46
53
|
},
|
|
47
54
|
"operators": {
|
|
48
55
|
"default": {},
|
|
56
|
+
"deprecated": true,
|
|
57
|
+
"description": "Write each person's Slack user id in `[people.<name>] ids = { slack = \"U0123ABCD\" }` and their name in `[roles] operator` instead; while this table has an entry, it still decides who may answer, approve, deny and stop.",
|
|
49
58
|
"type": "object",
|
|
50
59
|
"propertyNames": {
|
|
51
60
|
"type": "string",
|
|
@@ -57,11 +66,13 @@
|
|
|
57
66
|
}
|
|
58
67
|
},
|
|
59
68
|
"channel": {
|
|
69
|
+
"description": "The channel id where post_summary posts when the call names none, where a card that did not come from Slack gets its thread, and where the note of a run that opened a pull request is shown.",
|
|
60
70
|
"type": "string",
|
|
61
71
|
"pattern": "^[CDG][A-Z0-9]{2,}$"
|
|
62
72
|
},
|
|
63
73
|
"dm": {
|
|
64
74
|
"default": [],
|
|
75
|
+
"description": "Who gets the end note of each run in a DM, by Slack user id or email. Default none.",
|
|
65
76
|
"type": "array",
|
|
66
77
|
"items": {
|
|
67
78
|
"anyOf": [
|
|
@@ -79,6 +90,7 @@
|
|
|
79
90
|
},
|
|
80
91
|
"people": {
|
|
81
92
|
"default": {},
|
|
93
|
+
"description": "Who the end note and an approval question mention: the name of a card's assignee, as the tracker gives it, to their Slack user id or email. Default none.",
|
|
82
94
|
"type": "object",
|
|
83
95
|
"propertyNames": {
|
|
84
96
|
"type": "string",
|
|
@@ -100,14 +112,17 @@
|
|
|
100
112
|
},
|
|
101
113
|
"close_on_done": {
|
|
102
114
|
"default": false,
|
|
115
|
+
"description": "With true, a run that ends done sets the Slack session status to closed; otherwise it goes back to active. Default false.",
|
|
103
116
|
"type": "boolean"
|
|
104
117
|
},
|
|
105
118
|
"console_url": {
|
|
119
|
+
"description": "The console address that the progress message, an approval question and the end note link, at an address their readers can open. Not set: no console link.",
|
|
106
120
|
"type": "string",
|
|
107
121
|
"format": "uri"
|
|
108
122
|
},
|
|
109
123
|
"status": {
|
|
110
124
|
"default": {},
|
|
125
|
+
"description": "The phrase of the status line while a stage works, by stage name, such as fix = \"is reading the code\". A stage with no phrase shows \"is on it:\" and its label.",
|
|
111
126
|
"type": "object",
|
|
112
127
|
"propertyNames": {
|
|
113
128
|
"type": "string"
|