@moxxy/plugin-channel-slack 0.41.2 → 0.42.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/dist/pair-flow.d.ts +1 -1
- package/dist/pair-flow.d.ts.map +1 -1
- package/dist/pair-flow.js +5 -25
- package/dist/pair-flow.js.map +1 -1
- package/package.json +10 -10
- package/src/pair-flow.ts +5 -27
- package/src/subcommands.test.ts +2 -1
package/dist/pair-flow.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { type ChannelSubcommandContext } from '@moxxy/sdk';
|
|
|
9
9
|
* 3. Start in `pair` mode (opens the tunnel; prints the Request URL).
|
|
10
10
|
* 4. Wait (with spinner) for the first verified inbound event.
|
|
11
11
|
* 5. Ask the operator to confirm the team/channel; on yes, persist it.
|
|
12
|
-
* 6.
|
|
12
|
+
* 6. Restart the bot for real with the configured model (`finishPairing`).
|
|
13
13
|
*
|
|
14
14
|
* Uses the default `proxyTunnel` provider (the channel imports it directly), so
|
|
15
15
|
* the public Request URL is available once the channel starts.
|
package/dist/pair-flow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pair-flow.d.ts","sourceRoot":"","sources":["../src/pair-flow.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"pair-flow.d.ts","sourceRoot":"","sources":["../src/pair-flow.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAO1E;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAyErF"}
|
package/dist/pair-flow.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { confirm, isCancel, log, outro, spinner } from '@clack/prompts';
|
|
2
|
-
import {
|
|
2
|
+
import { finishPairing } from '@moxxy/sdk';
|
|
3
3
|
import { SlackChannel } from './channel.js';
|
|
4
4
|
const ANSI = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
5
5
|
const dim = (s) => (ANSI ? `\x1b[2m${s}\x1b[22m` : s);
|
|
@@ -13,7 +13,7 @@ const dim = (s) => (ANSI ? `\x1b[2m${s}\x1b[22m` : s);
|
|
|
13
13
|
* 3. Start in `pair` mode (opens the tunnel; prints the Request URL).
|
|
14
14
|
* 4. Wait (with spinner) for the first verified inbound event.
|
|
15
15
|
* 5. Ask the operator to confirm the team/channel; on yes, persist it.
|
|
16
|
-
* 6.
|
|
16
|
+
* 6. Restart the bot for real with the configured model (`finishPairing`).
|
|
17
17
|
*
|
|
18
18
|
* Uses the default `proxyTunnel` provider (the channel imports it directly), so
|
|
19
19
|
* the public Request URL is available once the channel starts.
|
|
@@ -79,28 +79,8 @@ export async function runSlackPairFlow(ctx) {
|
|
|
79
79
|
}
|
|
80
80
|
await channel.confirmPairing(candidate);
|
|
81
81
|
log.success(`Paired ✓ — team ${candidate.teamId} is authorized.`);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
await stopBot();
|
|
86
|
-
return 0;
|
|
87
|
-
}
|
|
88
|
-
log.info('Bot is running. Press Ctrl+C to stop.');
|
|
89
|
-
const shutdown = async () => {
|
|
90
|
-
await stopBot();
|
|
91
|
-
await session.close('SIGINT').catch(() => undefined);
|
|
92
|
-
process.exit(0);
|
|
93
|
-
};
|
|
94
|
-
const onSignal = () => void shutdown();
|
|
95
|
-
process.once('SIGINT', onSignal);
|
|
96
|
-
process.once('SIGTERM', onSignal);
|
|
97
|
-
try {
|
|
98
|
-
await handle.running;
|
|
99
|
-
return 0;
|
|
100
|
-
}
|
|
101
|
-
finally {
|
|
102
|
-
process.removeListener('SIGINT', onSignal);
|
|
103
|
-
process.removeListener('SIGTERM', onSignal);
|
|
104
|
-
}
|
|
82
|
+
// The pairing bot ran on the provider-less probe session: restart it for real
|
|
83
|
+
// with the configured model (or hand back to an orchestrator).
|
|
84
|
+
return finishPairing(ctx, stopBot);
|
|
105
85
|
}
|
|
106
86
|
//# sourceMappingURL=pair-flow.js.map
|
package/dist/pair-flow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pair-flow.js","sourceRoot":"","sources":["../src/pair-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pair-flow.js","sourceRoot":"","sources":["../src/pair-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAiC,MAAM,YAAY,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAsB,MAAM,cAAc,CAAC;AAEhE,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AAC3D,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,GAA6B;IAClE,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;IAC5B,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC;QAC/B,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAmB;QACnC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,MAAe;KACjC,CAAC,CAAC;IACH,OAAO,CAAC,qBAAqB,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE1D,IAAI,gBAAgB,GAAwC,IAAI,CA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AAI,CAAC;QACH,SAAS,GAAG,MAAM,cAAc,CAAC;IACnC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC7B,GAAG,CAAC,KAAK,CAAC,oBAAoB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClF,MAAM,OAAO,EAAE,CAAC;QAChB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,0BAA0B,SAAS,CAAC,MAAM,aAAa,SAAS,CAAC,SAAS,GAAG,CAAC,CAAC;IAEzF,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC;QACvB,OAAO,EAAE,kBAAkB,SAAS,CAAC,MAAM,cAAc,SAAS,CAAC,SAAS,GAAG;KAChF,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACxB,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACnC,MAAM,OAAO,EAAE,CAAC;QAChB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACxC,GAAG,CAAC,OAAO,CAAC,mBAAmB,SAAS,CAAC,MAAM,iBAAiB,CAAC,CAAC;IAElE,8EAA8E;IAC9E,+DAA+D;IAC/D,OAAO,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moxxy/plugin-channel-slack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "Slack bot channel for moxxy. Ingests Slack Events API over the proxy relay, drives the Session, and streams threaded replies. Autonomous allow-list permission model (no human in the loop).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"moxxy",
|
|
@@ -73,18 +73,18 @@
|
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@clack/prompts": "1.8.1",
|
|
75
75
|
"zod": "^3.25.76",
|
|
76
|
-
"@moxxy/
|
|
77
|
-
"@moxxy/
|
|
78
|
-
"@moxxy/
|
|
79
|
-
"@moxxy/
|
|
80
|
-
"@moxxy/
|
|
81
|
-
"@moxxy/
|
|
76
|
+
"@moxxy/channel-kit": "0.42.0",
|
|
77
|
+
"@moxxy/core": "0.42.0",
|
|
78
|
+
"@moxxy/plugin-tunnel-proxy": "0.42.0",
|
|
79
|
+
"@moxxy/config": "0.42.0",
|
|
80
|
+
"@moxxy/sdk": "0.42.0",
|
|
81
|
+
"@moxxy/plugin-vault": "0.42.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@types/node": "^22.
|
|
84
|
+
"@types/node": "^22.20.5",
|
|
85
85
|
"typescript": "^6.0.3",
|
|
86
|
-
"vitest": "^
|
|
87
|
-
"@moxxy/testing": "0.0.
|
|
86
|
+
"vitest": "^5.0.3",
|
|
87
|
+
"@moxxy/testing": "0.0.71",
|
|
88
88
|
"@moxxy/vitest-preset": "0.0.0",
|
|
89
89
|
"@moxxy/tsconfig": "0.0.0"
|
|
90
90
|
},
|
package/src/pair-flow.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { confirm, isCancel, log, outro, spinner } from '@clack/prompts';
|
|
2
|
-
import {
|
|
2
|
+
import { finishPairing, type ChannelSubcommandContext } from '@moxxy/sdk';
|
|
3
3
|
import type { VaultStore } from '@moxxy/plugin-vault';
|
|
4
4
|
import { SlackChannel, type PairCandidate } from './channel.js';
|
|
5
5
|
|
|
@@ -16,7 +16,7 @@ const dim = (s: string): string => (ANSI ? `\x1b[2m${s}\x1b[22m` : s);
|
|
|
16
16
|
* 3. Start in `pair` mode (opens the tunnel; prints the Request URL).
|
|
17
17
|
* 4. Wait (with spinner) for the first verified inbound event.
|
|
18
18
|
* 5. Ask the operator to confirm the team/channel; on yes, persist it.
|
|
19
|
-
* 6.
|
|
19
|
+
* 6. Restart the bot for real with the configured model (`finishPairing`).
|
|
20
20
|
*
|
|
21
21
|
* Uses the default `proxyTunnel` provider (the channel imports it directly), so
|
|
22
22
|
* the public Request URL is available once the channel starts.
|
|
@@ -91,29 +91,7 @@ export async function runSlackPairFlow(ctx: ChannelSubcommandContext): Promise<n
|
|
|
91
91
|
await channel.confirmPairing(candidate);
|
|
92
92
|
log.success(`Paired ✓ — team ${candidate.teamId} is authorized.`);
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
await stopBot();
|
|
98
|
-
return 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
log.info('Bot is running. Press Ctrl+C to stop.');
|
|
102
|
-
|
|
103
|
-
const shutdown = async (): Promise<void> => {
|
|
104
|
-
await stopBot();
|
|
105
|
-
await session.close('SIGINT').catch(() => undefined);
|
|
106
|
-
process.exit(0);
|
|
107
|
-
};
|
|
108
|
-
const onSignal = (): void => void shutdown();
|
|
109
|
-
process.once('SIGINT', onSignal);
|
|
110
|
-
process.once('SIGTERM', onSignal);
|
|
111
|
-
|
|
112
|
-
try {
|
|
113
|
-
await handle.running;
|
|
114
|
-
return 0;
|
|
115
|
-
} finally {
|
|
116
|
-
process.removeListener('SIGINT', onSignal);
|
|
117
|
-
process.removeListener('SIGTERM', onSignal);
|
|
118
|
-
}
|
|
94
|
+
// The pairing bot ran on the provider-less probe session: restart it for real
|
|
95
|
+
// with the configured model (or hand back to an orchestrator).
|
|
96
|
+
return finishPairing(ctx, stopBot);
|
|
119
97
|
}
|
package/src/subcommands.test.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
SLACK_BOT_TOKEN_KEY,
|
|
11
11
|
SLACK_SIGNING_SECRET_KEY,
|
|
12
12
|
} from './keys.js';
|
|
13
|
+
import { removeDir } from '@moxxy/vitest-preset/fs';
|
|
13
14
|
|
|
14
15
|
let tmp: string;
|
|
15
16
|
let vault: VaultStore;
|
|
@@ -42,7 +43,7 @@ beforeEach(async () => {
|
|
|
42
43
|
});
|
|
43
44
|
|
|
44
45
|
afterEach(async () => {
|
|
45
|
-
await
|
|
46
|
+
await removeDir(tmp);
|
|
46
47
|
process.stdout.write = origStdoutWrite;
|
|
47
48
|
process.stderr.write = origStderrWrite;
|
|
48
49
|
delete process.env.MOXXY_SLACK_BOT_TOKEN;
|