@kana-ai/edgar-ext-slack 0.1.2 → 0.1.4

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.
@@ -33,6 +33,13 @@ export const questionOutcome = z.looseObject({
33
33
  output: z.looseObject({ question: z.string().trim().min(1) }),
34
34
  }),
35
35
  });
36
+ /** A done stage whose output names the chat channel that a person asked to get the result in: the `post_in` of a classification. */
37
+ export const postOutcome = z.looseObject({
38
+ outcome: z.looseObject({
39
+ outcome: z.literal("done"),
40
+ output: z.looseObject({ post_in: z.string().trim().min(1) }),
41
+ }),
42
+ });
36
43
  /** Why a run ended other than done: the message of a `run_outcome` payload. */
37
44
  export const failedOutcome = z.looseObject({
38
45
  outcome: z.looseObject({ message: z.string().min(1) }),
@@ -65,12 +72,19 @@ export const approvalRequested = z.looseObject({
65
72
  input: z.unknown().optional(),
66
73
  assignee: z.string().min(1).optional(),
67
74
  });
75
+ /** Why a queued run does not start yet, from its `waiting_for_slot` payload: `limit` runs already hold a start for `value`, the value its input has at `key`; with no `value`, the project's `key`, `slots` or `sandboxes`, is full at `limit`. */
76
+ export const waitingForSlot = z.looseObject({
77
+ key: z.string(),
78
+ value: z.string().optional(),
79
+ limit: z.number().int(),
80
+ });
68
81
  /** The state of one stage on the plan message. */
69
82
  export const taskState = z.enum(["working", "done", "failed", "waiting"]);
70
- /** The plan of one run, kept in its message's metadata so each event updates it in place: the run's card as the line that links it, each stage that started in the order of its start, each pull request a stage opened, and the outcome word once the run is over. A stage that read what people decided on the pull request has that as its `label`. */
83
+ /** The plan of one run, kept in its message's metadata so each event updates it in place: the run's card as the line that links it, what the run waits on while it is queued with the run's workflow, each stage that started in the order of its start, each pull request a stage opened, and the outcome word once the run is over. A stage that read what people decided on the pull request has that as its `label`. */
71
84
  export const planState = z.object({
72
85
  run: z.string(),
73
86
  card: z.string().optional(),
87
+ queued: waitingForSlot.extend({ workflow: z.string().optional() }).optional(),
74
88
  tasks: z.array(z.object({ stage: z.string(), state: taskState, label: z.string().optional() })),
75
89
  pulls: z.array(z.object({ url: z.string(), label: z.string() })).default([]),
76
90
  ended: z.string().optional(),
@@ -20,23 +20,40 @@ export declare const opened: z.ZodObject<{
20
20
  id: z.ZodString;
21
21
  }, z.core.$loose>;
22
22
  }, z.core.$loose>;
23
- /** The answer of `users.info` and `users.lookupByEmail`. */
23
+ /** 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. */
24
24
  export declare const userInfo: z.ZodObject<{
25
25
  user: z.ZodObject<{
26
26
  id: z.ZodString;
27
27
  name: z.ZodOptional<z.ZodString>;
28
28
  real_name: z.ZodOptional<z.ZodString>;
29
+ team_id: z.ZodOptional<z.ZodString>;
29
30
  is_bot: z.ZodOptional<z.ZodBoolean>;
30
31
  is_restricted: z.ZodOptional<z.ZodBoolean>;
31
32
  is_ultra_restricted: z.ZodOptional<z.ZodBoolean>;
33
+ is_stranger: z.ZodOptional<z.ZodBoolean>;
34
+ enterprise_user: z.ZodOptional<z.ZodObject<{
35
+ enterprise_id: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$loose>>;
32
37
  profile: z.ZodOptional<z.ZodObject<{
33
38
  email: z.ZodOptional<z.ZodString>;
34
39
  }, z.core.$loose>>;
35
40
  }, z.core.$loose>;
36
41
  }, z.core.$loose>;
37
- /** The answer of `conversations.info`: what kind of conversation a channel id names. */
42
+ /** The envelope of an Events API event: the workspace the app is installed in and, on Enterprise Grid, its organization. */
43
+ export declare const home: z.ZodObject<{
44
+ team_id: z.ZodOptional<z.ZodString>;
45
+ enterprise_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
+ }, z.core.$loose>;
47
+ /** The answer of `auth.test`: the bot user's name, as `/invite @<user>` takes it. */
48
+ export declare const identity: z.ZodObject<{
49
+ user: z.ZodString;
50
+ }, z.core.$loose>;
51
+ /** The answer of `conversations.info`: what kind of conversation a channel id names, and whether the bot can post there. */
38
52
  export declare const channelInfo: z.ZodObject<{
39
53
  channel: z.ZodObject<{
54
+ name: z.ZodOptional<z.ZodString>;
55
+ is_member: z.ZodOptional<z.ZodBoolean>;
56
+ is_archived: z.ZodOptional<z.ZodBoolean>;
40
57
  is_private: z.ZodOptional<z.ZodBoolean>;
41
58
  is_im: z.ZodOptional<z.ZodBoolean>;
42
59
  is_mpim: z.ZodOptional<z.ZodBoolean>;
@@ -85,7 +102,20 @@ export declare const envelope: z.ZodObject<{
85
102
  reason: z.ZodOptional<z.ZodString>;
86
103
  payload: z.ZodOptional<z.ZodUnknown>;
87
104
  }, z.core.$loose>;
105
+ /** 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. */
106
+ export declare const delivered: z.ZodObject<{
107
+ event_id: z.ZodOptional<z.ZodString>;
108
+ token: z.ZodOptional<z.ZodUnknown>;
109
+ }, z.core.$loose>;
88
110
  /** A message, a thread reply or a mention, as `message.im`, `message.channels`, `message.groups` and `app_mention` deliver it. */
111
+ /** A file of a message, as far as a chat reads it; Slack leaves out the link of a file it hides. */
112
+ export declare const sharedFile: z.ZodObject<{
113
+ id: z.ZodString;
114
+ name: z.ZodOptional<z.ZodString>;
115
+ mimetype: z.ZodOptional<z.ZodString>;
116
+ size: z.ZodOptional<z.ZodNumber>;
117
+ url_private_download: z.ZodOptional<z.ZodString>;
118
+ }, z.core.$loose>;
89
119
  export declare const said: z.ZodObject<{
90
120
  type: z.ZodEnum<{
91
121
  app_mention: "app_mention";
@@ -99,6 +129,7 @@ export declare const said: z.ZodObject<{
99
129
  channel_type: z.ZodOptional<z.ZodString>;
100
130
  bot_id: z.ZodOptional<z.ZodString>;
101
131
  subtype: z.ZodOptional<z.ZodString>;
132
+ files: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
102
133
  }, z.core.$loose>;
103
134
  /** A person pressed the stop button of an agent session. */
104
135
  export declare const stopped: z.ZodObject<{
@@ -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 answer of `conversations.info`: what kind of conversation a channel id names. */
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({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "contract": 1,
3
3
  "name": "slack",
4
- "version": "0.1.2",
4
+ "version": "0.1.4",
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.2",
3
+ "version": "0.1.4",
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.2",
26
- "@kana-ai/edgar-sdk": "0.1.2",
25
+ "@kana-ai/edgar-contracts": "0.1.4",
26
+ "@kana-ai/edgar-sdk": "0.1.4",
27
27
  "zod": "4.6.7"
28
28
  },
29
29
  "devDependencies": {
@@ -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"
package/slack-app.json CHANGED
@@ -25,6 +25,7 @@
25
25
  "channels:history",
26
26
  "channels:read",
27
27
  "chat:write",
28
+ "files:read",
28
29
  "groups:history",
29
30
  "im:history",
30
31
  "im:read",