@wirecat/slack-cli 0.0.0-stage → 0.2.0
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/CHANGELOG.md +121 -0
- package/LICENSE +204 -0
- package/README.md +131 -2
- package/contracts/wirecat.json +5526 -0
- package/dist/bin/slack.d.ts +3 -0
- package/dist/bin/slack.d.ts.map +1 -0
- package/dist/bin/slack.js +40 -0
- package/dist/bin/slack.js.map +1 -0
- package/dist/bundle/agent-GOFXFUQP.js +37 -0
- package/dist/bundle/all-profiles-4C7VOT2D.js +320 -0
- package/dist/bundle/anthropic-ZD66TC5S.js +91 -0
- package/dist/bundle/app-server-QNCVEDMY.js +249 -0
- package/dist/bundle/bun-2FULBYXS.js +169 -0
- package/dist/bundle/bun-sqlite-PMS26ZUT.js +76 -0
- package/dist/bundle/chunk-2LB5BWC4.js +362 -0
- package/dist/bundle/chunk-2ZEYRHZV.js +18 -0
- package/dist/bundle/chunk-3IJ3THPV.js +7 -0
- package/dist/bundle/chunk-3IZF5ENR.js +61 -0
- package/dist/bundle/chunk-4HSVEQ3R.js +29 -0
- package/dist/bundle/chunk-4QPMHVM5.js +1007 -0
- package/dist/bundle/chunk-53LIHHXC.js +16 -0
- package/dist/bundle/chunk-5F36CXDM.js +794 -0
- package/dist/bundle/chunk-5LPREGD3.js +12636 -0
- package/dist/bundle/chunk-5R5YRYIP.js +1148 -0
- package/dist/bundle/chunk-5RSQTG7L.js +388 -0
- package/dist/bundle/chunk-5SXZETJF.js +170 -0
- package/dist/bundle/chunk-6PDQP5RM.js +50 -0
- package/dist/bundle/chunk-75BLNPN3.js +1197 -0
- package/dist/bundle/chunk-7BEO72EN.js +131 -0
- package/dist/bundle/chunk-7F6RNAIM.js +230 -0
- package/dist/bundle/chunk-AG7FP64Z.js +77 -0
- package/dist/bundle/chunk-BRXTN5LJ.js +338 -0
- package/dist/bundle/chunk-CABZAU37.js +319 -0
- package/dist/bundle/chunk-CCOSG3F2.js +24616 -0
- package/dist/bundle/chunk-CDTZSFTN.js +58 -0
- package/dist/bundle/chunk-CMZBCWND.js +1246 -0
- package/dist/bundle/chunk-CRQEEJNF.js +185 -0
- package/dist/bundle/chunk-CWYU4R65.js +358 -0
- package/dist/bundle/chunk-CZFR6JQX.js +52 -0
- package/dist/bundle/chunk-D72URWJE.js +532 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DVHX7R54.js +4072 -0
- package/dist/bundle/chunk-DYKOG7QR.js +9596 -0
- package/dist/bundle/chunk-ECDI42G6.js +100 -0
- package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
- package/dist/bundle/chunk-ELY2TLCY.js +259 -0
- package/dist/bundle/chunk-ERRVUVKR.js +156 -0
- package/dist/bundle/chunk-FBWR4E5D.js +353 -0
- package/dist/bundle/chunk-GKS6KL57.js +6848 -0
- package/dist/bundle/chunk-H2COZZ55.js +2787 -0
- package/dist/bundle/chunk-HGXTEK7R.js +82 -0
- package/dist/bundle/chunk-HXLXM7HV.js +726 -0
- package/dist/bundle/chunk-IPP4N6HD.js +24 -0
- package/dist/bundle/chunk-IWTVR7S7.js +53 -0
- package/dist/bundle/chunk-IYJH75D4.js +63 -0
- package/dist/bundle/chunk-JCZLRT4Z.js +39 -0
- package/dist/bundle/chunk-JGRWMR5H.js +123 -0
- package/dist/bundle/chunk-JYRYQJBN.js +633 -0
- package/dist/bundle/chunk-KIKLDI74.js +161 -0
- package/dist/bundle/chunk-L4WO3XH6.js +2020 -0
- package/dist/bundle/chunk-LQDNUAK3.js +274 -0
- package/dist/bundle/chunk-LV5ONLQH.js +38 -0
- package/dist/bundle/chunk-M27Z23OZ.js +23 -0
- package/dist/bundle/chunk-M5XTZHXM.js +142 -0
- package/dist/bundle/chunk-MJBEGUIZ.js +76 -0
- package/dist/bundle/chunk-N4WOLGIV.js +2333 -0
- package/dist/bundle/chunk-N5K4OHPT.js +206 -0
- package/dist/bundle/chunk-NYAPUET7.js +108 -0
- package/dist/bundle/chunk-P4IFLOIK.js +218 -0
- package/dist/bundle/chunk-P6G2QTCD.js +288 -0
- package/dist/bundle/chunk-PL5P7UKW.js +25216 -0
- package/dist/bundle/chunk-PU7R6XNV.js +80 -0
- package/dist/bundle/chunk-QLLBACDR.js +72 -0
- package/dist/bundle/chunk-QP7XN5KX.js +407 -0
- package/dist/bundle/chunk-QY2F6A3D.js +557 -0
- package/dist/bundle/chunk-RLIT7VAZ.js +66 -0
- package/dist/bundle/chunk-S4UUN6LD.js +1410 -0
- package/dist/bundle/chunk-SKGAKI62.js +86 -0
- package/dist/bundle/chunk-SQMZP5MA.js +66653 -0
- package/dist/bundle/chunk-UB6NTICY.js +95 -0
- package/dist/bundle/chunk-UBHQO5HV.js +778 -0
- package/dist/bundle/chunk-UM4RKO24.js +106 -0
- package/dist/bundle/chunk-VAHFY732.js +1068 -0
- package/dist/bundle/chunk-VGDM4C3F.js +188 -0
- package/dist/bundle/chunk-VOUAKCPM.js +41181 -0
- package/dist/bundle/chunk-WCCFJ4Q6.js +3736 -0
- package/dist/bundle/chunk-WV6EXRDV.js +46 -0
- package/dist/bundle/chunk-WVAT5TGY.js +334 -0
- package/dist/bundle/chunk-WW76JMKE.js +1243 -0
- package/dist/bundle/chunk-XXOMUKC6.js +54 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YDO6RJ2P.js +1337 -0
- package/dist/bundle/chunk-ZBCFZCJW.js +388 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/command-contract-BWGRUY6L.js +37 -0
- package/dist/bundle/command-server-entry-BATOWE3Y.js +166 -0
- package/dist/bundle/decode-MZQGYXJH.js +297 -0
- package/dist/bundle/definitions-3EONB23J.js +8600 -0
- package/dist/bundle/dispatch-NYC4ARWX.js +411 -0
- package/dist/bundle/dist-AMLBQVKM.js +7577 -0
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/echarts-7OYGL2GW.js +42501 -0
- package/dist/bundle/embed-4I25DVKZ.js +38 -0
- package/dist/bundle/embedder-YXKQHAZO.js +111 -0
- package/dist/bundle/emoji-4LYX3GOS.js +4271 -0
- package/dist/bundle/failure-3YOVYZTX.js +25 -0
- package/dist/bundle/first-run-2VL2BOV7.js +29 -0
- package/dist/bundle/first-screen-C7FIWZL2.js +37 -0
- package/dist/bundle/instructions-UMNDHXG2.js +11 -0
- package/dist/bundle/mcp-V27RHILF.js +167 -0
- package/dist/bundle/meeting-combined-LS6XO4JH.js +24 -0
- package/dist/bundle/meeting-model-VIR465CY.js +25 -0
- package/dist/bundle/meeting-semantic-H5J3OOF2.js +22 -0
- package/dist/bundle/node-JJ3WDCNJ.js +2340 -0
- package/dist/bundle/node-PYFPGL4E.js +176 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-sqlite-LFWPGDVP.js +74 -0
- package/dist/bundle/oauth-42VCSIVL.js +20 -0
- package/dist/bundle/open-XJ5R5LHC.js +23 -0
- package/dist/bundle/openai-RZBLV4HG.js +238 -0
- package/dist/bundle/process-DD6H3K7L.js +91 -0
- package/dist/bundle/program-OIYIBNSA.js +35443 -0
- package/dist/bundle/prompt-NQRDM5LY.js +17 -0
- package/dist/bundle/recognize-EM7H2IZS.js +26 -0
- package/dist/bundle/remote-Z6NU6QQA.js +31 -0
- package/dist/bundle/rerank-PNPCSPNF.js +52 -0
- package/dist/bundle/schemas-JMKNP4U3.js +2765 -0
- package/dist/bundle/serve-SQVGX76J.js +199 -0
- package/dist/bundle/server-NPJH45FZ.js +212 -0
- package/dist/bundle/server-Z4ZMGRAH.js +79 -0
- package/dist/bundle/slack.js +184 -0
- package/dist/bundle/sqlite-runtime-F3AJGAPN.js +20 -0
- package/dist/bundle/state-JT7ZFSXN.js +36 -0
- package/dist/bundle/store-FXGMHRF3.js +181 -0
- package/dist/bundle/store-J5ZL2USR.js +295 -0
- package/dist/bundle/store-maintenance-command-TIHOIKLZ.js +66 -0
- package/dist/bundle/surface-NW6T5OR6.js +65 -0
- package/dist/commands/api.d.ts +7 -0
- package/dist/commands/api.d.ts.map +1 -0
- package/dist/commands/api.js +49 -0
- package/dist/commands/api.js.map +1 -0
- package/dist/commands/session.d.ts +7 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +26 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/config.d.ts +24 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +75 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +59 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +75 -0
- package/dist/context.js.map +1 -0
- package/dist/generated/definitions.d.ts +3 -0
- package/dist/generated/definitions.d.ts.map +1 -0
- package/dist/generated/definitions.js +8596 -0
- package/dist/generated/definitions.js.map +1 -0
- package/dist/generated/emoji.d.ts +2 -0
- package/dist/generated/emoji.d.ts.map +1 -0
- package/dist/generated/emoji.js +4265 -0
- package/dist/generated/emoji.js.map +1 -0
- package/dist/generated/manifest.d.ts +6 -0
- package/dist/generated/manifest.d.ts.map +1 -0
- package/dist/generated/manifest.js +6139 -0
- package/dist/generated/manifest.js.map +1 -0
- package/dist/generated/schemas.d.ts +631 -0
- package/dist/generated/schemas.d.ts.map +1 -0
- package/dist/generated/schemas.js +2426 -0
- package/dist/generated/schemas.js.map +1 -0
- package/dist/generated/types.d.ts +3220 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +5 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/identity.d.ts +29 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +32 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/messenger.d.ts +12 -0
- package/dist/messenger.d.ts.map +1 -0
- package/dist/messenger.js +184 -0
- package/dist/messenger.js.map +1 -0
- package/dist/program.d.ts +6 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +116 -0
- package/dist/program.js.map +1 -0
- package/dist/reasons.d.ts +7 -0
- package/dist/reasons.d.ts.map +1 -0
- package/dist/reasons.js +20 -0
- package/dist/reasons.js.map +1 -0
- package/dist/setup/flow.d.ts +2 -0
- package/dist/setup/flow.d.ts.map +1 -0
- package/dist/setup/flow.js +83 -0
- package/dist/setup/flow.js.map +1 -0
- package/dist/setup/guide.d.ts +6 -0
- package/dist/setup/guide.d.ts.map +1 -0
- package/dist/setup/guide.js +13 -0
- package/dist/setup/guide.js.map +1 -0
- package/dist/setup/texts.d.ts +24 -0
- package/dist/setup/texts.d.ts.map +1 -0
- package/dist/setup/texts.js +24 -0
- package/dist/setup/texts.js.map +1 -0
- package/dist/slack/adapter.d.ts +36 -0
- package/dist/slack/adapter.d.ts.map +1 -0
- package/dist/slack/adapter.js +574 -0
- package/dist/slack/adapter.js.map +1 -0
- package/dist/slack/app-manifest.d.ts +25 -0
- package/dist/slack/app-manifest.d.ts.map +1 -0
- package/dist/slack/app-manifest.js +51 -0
- package/dist/slack/app-manifest.js.map +1 -0
- package/dist/slack/client.d.ts +45 -0
- package/dist/slack/client.d.ts.map +1 -0
- package/dist/slack/client.js +236 -0
- package/dist/slack/client.js.map +1 -0
- package/dist/slack/map.d.ts +437 -0
- package/dist/slack/map.d.ts.map +1 -0
- package/dist/slack/map.js +411 -0
- package/dist/slack/map.js.map +1 -0
- package/dist/slack/mrkdwn.d.ts +9 -0
- package/dist/slack/mrkdwn.d.ts.map +1 -0
- package/dist/slack/mrkdwn.js +56 -0
- package/dist/slack/mrkdwn.js.map +1 -0
- package/dist/slack/search.d.ts +24 -0
- package/dist/slack/search.d.ts.map +1 -0
- package/dist/slack/search.js +99 -0
- package/dist/slack/search.js.map +1 -0
- package/dist/slack/threads.d.ts +28 -0
- package/dist/slack/threads.d.ts.map +1 -0
- package/dist/slack/threads.js +56 -0
- package/dist/slack/threads.js.map +1 -0
- package/dist/slack/tokens.d.ts +17 -0
- package/dist/slack/tokens.d.ts.map +1 -0
- package/dist/slack/tokens.js +27 -0
- package/dist/slack/tokens.js.map +1 -0
- package/dist/slack/writes.d.ts +43 -0
- package/dist/slack/writes.d.ts.map +1 -0
- package/dist/slack/writes.js +277 -0
- package/dist/slack/writes.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/wcat.d.ts +3 -0
- package/dist/wcat.d.ts.map +1 -0
- package/dist/wcat.js +4 -0
- package/dist/wcat.js.map +1 -0
- package/package.json +89 -4
- package/skills/slack-cli/SKILL.md +117 -0
- package/skills/slack-cli/references/api/api-admin.md +541 -0
- package/skills/slack-cli/references/api/api-api.md +13 -0
- package/skills/slack-cli/references/api/api-apps.md +78 -0
- package/skills/slack-cli/references/api/api-auth.md +18 -0
- package/skills/slack-cli/references/api/api-bots.md +12 -0
- package/skills/slack-cli/references/api/api-calls.md +68 -0
- package/skills/slack-cli/references/api/api-chat.md +123 -0
- package/skills/slack-cli/references/api/api-conversations.md +230 -0
- package/skills/slack-cli/references/api/api-dialog.md +13 -0
- package/skills/slack-cli/references/api/api-dnd.md +31 -0
- package/skills/slack-cli/references/api/api-emoji.md +8 -0
- package/skills/slack-cli/references/api/api-files.md +120 -0
- package/skills/slack-cli/references/api/api-migration.md +14 -0
- package/skills/slack-cli/references/api/api-pins.md +37 -0
- package/skills/slack-cli/references/api/api-reactions.md +58 -0
- package/skills/slack-cli/references/api/api-reminders.md +51 -0
- package/skills/slack-cli/references/api/api-search.md +18 -0
- package/skills/slack-cli/references/api/api-stars.md +42 -0
- package/skills/slack-cli/references/api/api-team.md +55 -0
- package/skills/slack-cli/references/api/api-usergroups.md +80 -0
- package/skills/slack-cli/references/api/api-users.md +101 -0
- package/skills/slack-cli/references/api/api-views.md +46 -0
- package/skills/slack-cli/references/api/api-workflows.md +36 -0
- package/skills/slack-cli/references/api.md +35 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const APP_MANIFEST: {
|
|
2
|
+
readonly _metadata: {
|
|
3
|
+
readonly major_version: 2;
|
|
4
|
+
readonly minor_version: 1;
|
|
5
|
+
};
|
|
6
|
+
readonly display_information: {
|
|
7
|
+
readonly name: "WireCat slk";
|
|
8
|
+
readonly description: "Your own Slack, read and written as you by the slk CLI on your computer.";
|
|
9
|
+
};
|
|
10
|
+
readonly oauth_config: {
|
|
11
|
+
readonly scopes: {
|
|
12
|
+
readonly user: readonly ["channels:history", "groups:history", "im:history", "mpim:history", "channels:read", "groups:read", "im:read", "mpim:read", "users:read", "users:read.email", "search:read", "reactions:read", "files:read", "pins:read", "usergroups:read", "chat:write", "reactions:write", "files:write", "pins:write", "channels:write", "groups:write", "im:write", "mpim:write"];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly settings: {
|
|
16
|
+
readonly org_deploy_enabled: false;
|
|
17
|
+
readonly socket_mode_enabled: false;
|
|
18
|
+
readonly token_rotation_enabled: false;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/** Slack's "Create New App" with the manifest filled in (https://docs.slack.dev/app-manifests/configuring-apps-with-app-manifests#sharing). */
|
|
22
|
+
export declare const APP_LINK: string;
|
|
23
|
+
/** The person's own Slack apps, where an app made earlier is found again. */
|
|
24
|
+
export declare const APPS_LINK = "https://api.slack.com/apps";
|
|
25
|
+
//# sourceMappingURL=app-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-manifest.d.ts","sourceRoot":"","sources":["../../src/slack/app-manifest.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;aACvB,SAAS;iBACP,aAAa,EAAE,CAAC;iBAChB,aAAa,EAAE,CAAC;;aAElB,mBAAmB;iBACjB,IAAI,EAAE,aAAa;iBACnB,WAAW,EAAE,0EAA0E;;aAEzF,YAAY;iBACV,MAAM;qBACJ,IAAI,YACF,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,aAAa,EACb,SAAS,EACT,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,YAAY;;;aAIlB,QAAQ;iBACN,kBAAkB;iBAClB,mBAAmB;iBACnB,sBAAsB;;CAEhB,CAAA;AAEV,+IAA+I;AAC/I,eAAO,MAAM,QAAQ,QAA2G,CAAA;AAChI,6EAA6E;AAC7E,eAAO,MAAM,SAAS,+BAA+B,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// The app made from this is the owner's own: user scopes only, no bot, and token rotation off, since slk cannot renew
|
|
2
|
+
// a rotating token. docs/slack-app-manifest.json is the same manifest for pasting by hand; a test keeps them equal.
|
|
3
|
+
export const APP_MANIFEST = {
|
|
4
|
+
_metadata: {
|
|
5
|
+
major_version: 2,
|
|
6
|
+
minor_version: 1,
|
|
7
|
+
},
|
|
8
|
+
display_information: {
|
|
9
|
+
name: "WireCat slk",
|
|
10
|
+
description: "Your own Slack, read and written as you by the slk CLI on your computer.",
|
|
11
|
+
},
|
|
12
|
+
oauth_config: {
|
|
13
|
+
scopes: {
|
|
14
|
+
user: [
|
|
15
|
+
"channels:history",
|
|
16
|
+
"groups:history",
|
|
17
|
+
"im:history",
|
|
18
|
+
"mpim:history",
|
|
19
|
+
"channels:read",
|
|
20
|
+
"groups:read",
|
|
21
|
+
"im:read",
|
|
22
|
+
"mpim:read",
|
|
23
|
+
"users:read",
|
|
24
|
+
"users:read.email",
|
|
25
|
+
"search:read",
|
|
26
|
+
"reactions:read",
|
|
27
|
+
"files:read",
|
|
28
|
+
"pins:read",
|
|
29
|
+
"usergroups:read",
|
|
30
|
+
"chat:write",
|
|
31
|
+
"reactions:write",
|
|
32
|
+
"files:write",
|
|
33
|
+
"pins:write",
|
|
34
|
+
"channels:write",
|
|
35
|
+
"groups:write",
|
|
36
|
+
"im:write",
|
|
37
|
+
"mpim:write",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
settings: {
|
|
42
|
+
org_deploy_enabled: false,
|
|
43
|
+
socket_mode_enabled: false,
|
|
44
|
+
token_rotation_enabled: false,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
/** Slack's "Create New App" with the manifest filled in (https://docs.slack.dev/app-manifests/configuring-apps-with-app-manifests#sharing). */
|
|
48
|
+
export const APP_LINK = `https://api.slack.com/apps?new_app=1&manifest_json=${encodeURIComponent(JSON.stringify(APP_MANIFEST))}`;
|
|
49
|
+
/** The person's own Slack apps, where an app made earlier is found again. */
|
|
50
|
+
export const APPS_LINK = "https://api.slack.com/apps";
|
|
51
|
+
//# sourceMappingURL=app-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-manifest.js","sourceRoot":"","sources":["../../src/slack/app-manifest.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,oHAAoH;AACpH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE;QACT,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,CAAC;KACjB;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,0EAA0E;KACxF;IACD,YAAY,EAAE;QACZ,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,kBAAkB;gBAClB,gBAAgB;gBAChB,YAAY;gBACZ,cAAc;gBACd,eAAe;gBACf,aAAa;gBACb,SAAS;gBACT,WAAW;gBACX,YAAY;gBACZ,kBAAkB;gBAClB,aAAa;gBACb,gBAAgB;gBAChB,YAAY;gBACZ,WAAW;gBACX,iBAAiB;gBACjB,YAAY;gBACZ,iBAAiB;gBACjB,aAAa;gBACb,YAAY;gBACZ,gBAAgB;gBAChB,cAAc;gBACd,UAAU;gBACV,YAAY;aACb;SACF;KACF;IACD,QAAQ,EAAE;QACR,kBAAkB,EAAE,KAAK;QACzB,mBAAmB,EAAE,KAAK;QAC1B,sBAAsB,EAAE,KAAK;KAC9B;CACO,CAAA;AAEV,+IAA+I;AAC/I,MAAM,CAAC,MAAM,QAAQ,GAAG,sDAAsD,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,CAAA;AAChI,6EAA6E;AAC7E,MAAM,CAAC,MAAM,SAAS,GAAG,4BAA4B,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { CliError, type SleepLike } from "@wirecat/cli-base";
|
|
2
|
+
import { type FetchLike, type PacerLike } from "@wirecat/cli-base/http";
|
|
3
|
+
import { type EventSink } from "@wirecat/cli-core/cli";
|
|
4
|
+
import * as v from "valibot";
|
|
5
|
+
export declare const SLACK_API = "https://slack.com/api/";
|
|
6
|
+
export interface SlackClientOptions {
|
|
7
|
+
token: string;
|
|
8
|
+
fetch?: FetchLike | undefined;
|
|
9
|
+
/** cli-core's per-profile `Pacer`: every process of the profile waits its turn, and a 429 holds them all. */
|
|
10
|
+
pacer?: PacerLike | undefined;
|
|
11
|
+
/** The profile's second pace, for the Tier 3 methods in `TIER_3`; `pacer` paces them when it is not given. */
|
|
12
|
+
tier3Pacer?: PacerLike | undefined;
|
|
13
|
+
/** The run's sink, so each call lands in the run record under its method name (WC-LIFE-15). */
|
|
14
|
+
events?: EventSink | undefined;
|
|
15
|
+
signal?: AbortSignal | undefined;
|
|
16
|
+
/** A test's clock; the pace's waits and a 429's Retry-After sleep for real otherwise. */
|
|
17
|
+
sleep?: SleepLike | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The reads Slack allows 50 or more a minute (Tier 3, https://docs.slack.dev/apis/web-api/rate-limits/; each method's
|
|
21
|
+
* page names its tier). Every other method keeps the Tier 2 pace of 20.
|
|
22
|
+
*/
|
|
23
|
+
export declare const TIER_3: Set<string>;
|
|
24
|
+
export type SlackArgs = Readonly<Record<string, string | number | boolean | undefined>>;
|
|
25
|
+
/**
|
|
26
|
+
* Slack answers a refusal with HTTP 200 and `ok: false`. Only the code is kept, never Slack's free text, which can
|
|
27
|
+
* quote what was sent (WC-SECR-6); a write Slack failed on its side may have landed (WC-OUT-20).
|
|
28
|
+
*/
|
|
29
|
+
export declare const slackFailure: (code: string, writes: boolean, needed?: string) => CliError;
|
|
30
|
+
/** The error a Slack answer of HTTP 200 carries, or undefined when it says `ok: true`. */
|
|
31
|
+
export declare const refusalOf: (body: unknown, writes: boolean) => CliError | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The one place that holds the token: in the Authorization header, never in the address, the body or a record
|
|
34
|
+
* (WC-SECR-7). Every method goes as a form POST, which Slack takes for each of them
|
|
35
|
+
* (https://docs.slack.dev/apis/web-api/#post-bodies). A 429 waits as `Retry-After` says through the profile's pace;
|
|
36
|
+
* nothing else is sent twice.
|
|
37
|
+
*/
|
|
38
|
+
export declare const slackClient: (options: SlackClientOptions) => (<T>(method: string, args: SlackArgs, answer: v.GenericSchema<unknown, T>, { writes, signal: stop }?: {
|
|
39
|
+
writes?: boolean;
|
|
40
|
+
signal?: AbortSignal | undefined;
|
|
41
|
+
}) => Promise<T>) & {
|
|
42
|
+
upload: (address: string, bytes: Uint8Array) => Promise<void>;
|
|
43
|
+
};
|
|
44
|
+
export type SlackClient = ReturnType<typeof slackClient>;
|
|
45
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/slack/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA8B,KAAK,SAAS,EAAa,MAAM,mBAAmB,CAAA;AACnG,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EAKf,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,uBA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AAM,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { CliError, isCliError, wallClock } from "@wirecat/cli-base";
|
|
2
|
+
import { hostFetch, providerWaitMs, readJsonResponse, retrying, statusToCode, } from "@wirecat/cli-base/http";
|
|
3
|
+
import { providerRequest } from "@wirecat/cli-core/cli";
|
|
4
|
+
import * as v from "valibot";
|
|
5
|
+
import { DESKTOP, SERVICE } from "../identity.js";
|
|
6
|
+
export const SLACK_API = "https://slack.com/api/";
|
|
7
|
+
const LARGEST_ANSWER = 16 * 1024 * 1024;
|
|
8
|
+
/**
|
|
9
|
+
* The reads Slack allows 50 or more a minute (Tier 3, https://docs.slack.dev/apis/web-api/rate-limits/; each method's
|
|
10
|
+
* page names its tier). Every other method keeps the Tier 2 pace of 20.
|
|
11
|
+
*/
|
|
12
|
+
export const TIER_3 = new Set([
|
|
13
|
+
"conversations.history",
|
|
14
|
+
"conversations.replies",
|
|
15
|
+
"conversations.info",
|
|
16
|
+
"users.conversations",
|
|
17
|
+
]);
|
|
18
|
+
const AUTH = new Set(["invalid_auth", "not_authed", "token_revoked", "token_expired", "account_inactive"]);
|
|
19
|
+
const PERMISSION = new Set(["missing_scope", "not_allowed_token_type", "no_permission"]);
|
|
20
|
+
/** Slack's codes with a reason of their own (src/reasons.ts). */
|
|
21
|
+
const REASON_OF = {
|
|
22
|
+
cant_update_message: "message.not-yours",
|
|
23
|
+
cant_delete_message: "message.not-yours",
|
|
24
|
+
edit_window_closed: "message.edit-window-closed",
|
|
25
|
+
msg_too_long: "message.too-long",
|
|
26
|
+
not_in_channel: "chat.not-joined",
|
|
27
|
+
is_archived: "chat.archived",
|
|
28
|
+
};
|
|
29
|
+
const reasonOf = (code) => REASON_OF[code] ??
|
|
30
|
+
(code === "restricted_action" || code.startsWith("restricted_action_") ? "chat.restricted" : undefined);
|
|
31
|
+
const NOT_FOUND = new Set([
|
|
32
|
+
"channel_not_found",
|
|
33
|
+
"user_not_found",
|
|
34
|
+
"message_not_found",
|
|
35
|
+
"thread_not_found",
|
|
36
|
+
"file_not_found",
|
|
37
|
+
]);
|
|
38
|
+
const INPUT = new Set([
|
|
39
|
+
"invalid_arguments",
|
|
40
|
+
"invalid_arg_name",
|
|
41
|
+
"invalid_array_arg",
|
|
42
|
+
"invalid_cursor",
|
|
43
|
+
"invalid_ts_latest",
|
|
44
|
+
"invalid_ts_oldest",
|
|
45
|
+
"bad_timestamp",
|
|
46
|
+
]);
|
|
47
|
+
const UNAVAILABLE = new Set(["fatal_error", "internal_error", "service_unavailable", "request_timeout"]);
|
|
48
|
+
const failureAnswer = v.looseObject({
|
|
49
|
+
ok: v.literal(false),
|
|
50
|
+
error: v.optional(v.string()),
|
|
51
|
+
// conversations.leave answers a chat the account is not in with this flag and no `error`.
|
|
52
|
+
not_in_channel: v.optional(v.boolean()),
|
|
53
|
+
needed: v.optional(v.string()),
|
|
54
|
+
});
|
|
55
|
+
const REASONED = {
|
|
56
|
+
"message.not-yours": ["permission_error", `${SERVICE} lets you change only your own messages`],
|
|
57
|
+
"message.edit-window-closed": ["permission_error", `${SERVICE} no longer lets this message be edited`],
|
|
58
|
+
"message.too-long": ["validation_error", `the message is longer than ${SERVICE} takes; shorten it`],
|
|
59
|
+
"chat.not-joined": ["permission_error", "you are not in this chat; join it first"],
|
|
60
|
+
"chat.archived": ["validation_error", "the chat is archived"],
|
|
61
|
+
"chat.restricted": ["permission_error", "a workspace or channel setting stops this"],
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Slack answers a refusal with HTTP 200 and `ok: false`. Only the code is kept, never Slack's free text, which can
|
|
65
|
+
* quote what was sent (WC-SECR-6); a write Slack failed on its side may have landed (WC-OUT-20).
|
|
66
|
+
*/
|
|
67
|
+
export const slackFailure = (code, writes, needed) => {
|
|
68
|
+
const details = { slack_error: code };
|
|
69
|
+
const reason = reasonOf(code);
|
|
70
|
+
if (reason) {
|
|
71
|
+
const [errorCode, message] = REASONED[reason] ?? ["provider_error", `${SERVICE} refused the call`];
|
|
72
|
+
return new CliError(errorCode, `${message} (${code})`, { ...details, reason });
|
|
73
|
+
}
|
|
74
|
+
if (AUTH.has(code))
|
|
75
|
+
return new CliError("authentication_error", `${SERVICE} refused the token (${code}); sign in again`, details);
|
|
76
|
+
if (code === "missing_scope")
|
|
77
|
+
return new CliError("permission_error", `${SERVICE} refused: the app lacks the scope ${needed ?? "this method needs"}; add it to the app and reinstall`, { ...details, reason: "oauth.scope-missing", ...(needed ? { needed } : {}) });
|
|
78
|
+
if (PERMISSION.has(code))
|
|
79
|
+
return new CliError("permission_error", `${SERVICE} refused the call (${code})`, details);
|
|
80
|
+
if (code === "ratelimited")
|
|
81
|
+
return new CliError("rate_limited", `${SERVICE} asked to slow down; retry later`, { ...details, retryable: true });
|
|
82
|
+
if (NOT_FOUND.has(code))
|
|
83
|
+
return new CliError("not_found", `${SERVICE} has no such item, or this account cannot see it (${code})`, details);
|
|
84
|
+
if (INPUT.has(code))
|
|
85
|
+
return new CliError("validation_error", `${SERVICE} refused the arguments (${code})`, details);
|
|
86
|
+
if (UNAVAILABLE.has(code))
|
|
87
|
+
return writes
|
|
88
|
+
? new CliError("outcome_unknown", `${SERVICE} failed during a write (${code}); check before repeating it`, {
|
|
89
|
+
...details,
|
|
90
|
+
retryable: false,
|
|
91
|
+
})
|
|
92
|
+
: new CliError("provider_unavailable", `${SERVICE} failed (${code}); retry later`, {
|
|
93
|
+
...details,
|
|
94
|
+
retryable: true,
|
|
95
|
+
});
|
|
96
|
+
return new CliError("provider_error", `${SERVICE} refused the call (${code})`, details);
|
|
97
|
+
};
|
|
98
|
+
/** The error a Slack answer of HTTP 200 carries, or undefined when it says `ok: true`. */
|
|
99
|
+
export const refusalOf = (body, writes) => {
|
|
100
|
+
const refused = v.safeParse(failureAnswer, body);
|
|
101
|
+
if (!refused.success)
|
|
102
|
+
return undefined;
|
|
103
|
+
const { error, not_in_channel, needed } = refused.output;
|
|
104
|
+
return slackFailure(error ?? (not_in_channel ? "not_in_channel" : "unknown"), writes, needed);
|
|
105
|
+
};
|
|
106
|
+
const statusFailure = (status, writes, retryAfterMs) => {
|
|
107
|
+
if (status === 429)
|
|
108
|
+
return new CliError("rate_limited", `${SERVICE} asked to slow down; retry later`, {
|
|
109
|
+
status,
|
|
110
|
+
retryable: true,
|
|
111
|
+
...(retryAfterMs === undefined ? {} : { retry_after_ms: retryAfterMs }),
|
|
112
|
+
});
|
|
113
|
+
if (status >= 500 && writes)
|
|
114
|
+
return new CliError("outcome_unknown", `${SERVICE} failed during a write; check before repeating it`, {
|
|
115
|
+
status,
|
|
116
|
+
retryable: false,
|
|
117
|
+
});
|
|
118
|
+
return new CliError(statusToCode(status), `${SERVICE} refused the call (HTTP ${status})`, {
|
|
119
|
+
status,
|
|
120
|
+
retryable: status >= 500,
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
// An answer that cannot be read does not say the write did not land (WC-LIFE-9).
|
|
124
|
+
const unreadableWrite = () => new CliError("outcome_unknown", `${SERVICE} answered a write with something unreadable; check before repeating it`, {
|
|
125
|
+
retryable: false,
|
|
126
|
+
});
|
|
127
|
+
const formOf = (args) => new URLSearchParams(Object.entries(args).flatMap(([name, value]) => value === undefined ? [] : [[name, String(value)]]));
|
|
128
|
+
/**
|
|
129
|
+
* The one place that holds the token: in the Authorization header, never in the address, the body or a record
|
|
130
|
+
* (WC-SECR-7). Every method goes as a form POST, which Slack takes for each of them
|
|
131
|
+
* (https://docs.slack.dev/apis/web-api/#post-bodies). A 429 waits as `Retry-After` says through the profile's pace;
|
|
132
|
+
* nothing else is sent twice.
|
|
133
|
+
*/
|
|
134
|
+
export const slackClient = (options) => {
|
|
135
|
+
const reach = hostFetch({ hosts: DESKTOP.hosts, ...(options.fetch ? { fetch: options.fetch } : {}) });
|
|
136
|
+
const pacedBy = (pacer) => retrying(reach, { ...(pacer ? { pacer } : {}), ...(options.sleep ? { sleep: options.sleep } : {}) });
|
|
137
|
+
const send = pacedBy(options.pacer);
|
|
138
|
+
const sendTier3 = options.tier3Pacer ? pacedBy(options.tier3Pacer) : send;
|
|
139
|
+
const call = async (method, args, answer, { writes = false, signal: stop } = {}) => {
|
|
140
|
+
// A call may also have its own end, as cli-core's bound on a server search does.
|
|
141
|
+
const signals = [options.signal, stop].filter((one) => one !== undefined);
|
|
142
|
+
const signal = signals.length > 1 ? AbortSignal.any(signals) : signals[0];
|
|
143
|
+
const end = providerRequest(method, options.events, { method: "POST", transport: "http" });
|
|
144
|
+
const fail = (failure, status) => {
|
|
145
|
+
end({
|
|
146
|
+
...(status === undefined ? {} : { status }),
|
|
147
|
+
errorCode: failure.code,
|
|
148
|
+
...(typeof failure.details.slack_error === "string" ? { providerError: failure.details.slack_error } : {}),
|
|
149
|
+
});
|
|
150
|
+
throw failure;
|
|
151
|
+
};
|
|
152
|
+
let response;
|
|
153
|
+
try {
|
|
154
|
+
response = await (TIER_3.has(method) ? sendTier3 : send)(new URL(method, SLACK_API), {
|
|
155
|
+
method: "POST",
|
|
156
|
+
headers: {
|
|
157
|
+
authorization: `Bearer ${options.token}`,
|
|
158
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
159
|
+
accept: "application/json",
|
|
160
|
+
},
|
|
161
|
+
body: formOf(args),
|
|
162
|
+
redirect: "error",
|
|
163
|
+
...(signal ? { signal } : {}),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
if (isCliError(error) && error.details.sent === false)
|
|
168
|
+
return fail(error);
|
|
169
|
+
if (writes)
|
|
170
|
+
return fail(new CliError("outcome_unknown", `${SERVICE} did not answer a write; check before repeating it`, {
|
|
171
|
+
retryable: false,
|
|
172
|
+
}));
|
|
173
|
+
if (signal?.aborted)
|
|
174
|
+
return fail(new CliError("cancelled", `the ${SERVICE} call was stopped`));
|
|
175
|
+
return fail(isCliError(error) ? error : new CliError("network_error", `${SERVICE} could not be reached`));
|
|
176
|
+
}
|
|
177
|
+
if (!response.ok)
|
|
178
|
+
return fail(statusFailure(response.status, writes, providerWaitMs(response.headers, wallClock)), response.status);
|
|
179
|
+
let body;
|
|
180
|
+
try {
|
|
181
|
+
body = await readJsonResponse(response, {
|
|
182
|
+
maxBytes: LARGEST_ANSWER,
|
|
183
|
+
...(signal ? { signal } : {}),
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
catch {
|
|
187
|
+
return fail(writes
|
|
188
|
+
? unreadableWrite()
|
|
189
|
+
: new CliError("invalid_response", `${SERVICE} answered with something other than JSON`), 200);
|
|
190
|
+
}
|
|
191
|
+
const refused = refusalOf(body, writes);
|
|
192
|
+
if (refused)
|
|
193
|
+
return fail(refused, 200);
|
|
194
|
+
const parsed = v.safeParse(answer, body);
|
|
195
|
+
if (!parsed.success)
|
|
196
|
+
return fail(writes
|
|
197
|
+
? unreadableWrite()
|
|
198
|
+
: new CliError("invalid_response", `${SERVICE}'s answer to ${method} lacks the documented fields`), 200);
|
|
199
|
+
end({ status: response.status });
|
|
200
|
+
return parsed.output;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* A file's bytes POSTed to the address `files.getUploadURLExternal` gave, on files.slack.com only, paced and in the
|
|
204
|
+
* run record as `files.upload`. Nothing is shared before `files.completeUploadExternal`, so a failure here sent
|
|
205
|
+
* nothing.
|
|
206
|
+
*/
|
|
207
|
+
const upload = async (address, bytes) => {
|
|
208
|
+
const end = providerRequest("files.upload", options.events, { method: "POST", transport: "http" });
|
|
209
|
+
const refused = (message) => {
|
|
210
|
+
const failure = new CliError("provider_error", message, { sent: false });
|
|
211
|
+
end({ errorCode: failure.code });
|
|
212
|
+
throw failure;
|
|
213
|
+
};
|
|
214
|
+
if (!URL.canParse(address) || new URL(address).host !== "files.slack.com")
|
|
215
|
+
return refused(`${SERVICE} gave an upload address off files.slack.com; nothing was sent`);
|
|
216
|
+
let response;
|
|
217
|
+
try {
|
|
218
|
+
response = await send(new URL(address), {
|
|
219
|
+
method: "POST",
|
|
220
|
+
headers: { authorization: `Bearer ${options.token}`, "content-type": "application/octet-stream" },
|
|
221
|
+
body: bytes,
|
|
222
|
+
redirect: "error",
|
|
223
|
+
...(options.signal ? { signal: options.signal } : {}),
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
return refused(`${SERVICE} could not take the file; nothing was sent`);
|
|
228
|
+
}
|
|
229
|
+
if (!response.ok)
|
|
230
|
+
return refused(`${SERVICE} refused the file (HTTP ${response.status}); nothing was sent`);
|
|
231
|
+
await response.body?.cancel();
|
|
232
|
+
end({ status: response.status });
|
|
233
|
+
};
|
|
234
|
+
return Object.assign(call, { upload });
|
|
235
|
+
};
|
|
236
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/slack/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAkB,UAAU,EAAkB,SAAS,EAAE,MAAM,mBAAmB,CAAA;AACnG,OAAO,EAEL,SAAS,EAET,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,YAAY,GACb,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAkB,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAEjD,MAAM,CAAC,MAAM,SAAS,GAAG,wBAAwB,CAAA;AAEjD,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AAgBvC;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC;IAC5B,uBAAuB;IACvB,uBAAuB;IACvB,oBAAoB;IACpB,qBAAqB;CACtB,CAAC,CAAA;AAIF,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,YAAY,EAAE,eAAe,EA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