@kl-c/matrixos 0.2.0 → 0.2.1
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/cli/adopt.d.ts +26 -36
- package/dist/cli/index.js +7533 -7484
- package/dist/cli-node/index.js +7533 -7484
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/adopt.d.ts
CHANGED
|
@@ -1,42 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* matrixos adopt
|
|
2
|
+
* matrixos adopt — re-run the full MaTrixOS adoption wizard, or adopt a
|
|
3
|
+
* specific channel (e.g. telegram).
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Why a dedicated command and not just `gateway set-token`:
|
|
9
|
-
* - `set-token` is the low-level "write one token" primitive
|
|
10
|
-
* - `adopt` is the high-level "configure a channel end-to-end" UX
|
|
11
|
-
* (token + chat id + optional validation)
|
|
12
|
-
* - `adopt` is what a user re-runs when they want to fix or migrate
|
|
13
|
-
* their setup
|
|
14
|
-
*
|
|
15
|
-
* The slash command `/adopt` in Telegram dispatches to this same flow
|
|
16
|
-
* (see gateway-handler.ts).
|
|
17
|
-
*
|
|
18
|
-
* Token is NEVER hardcoded. Always prompted (masked) or read from --token.
|
|
5
|
+
* "adopt" is intentionally separate from the initial install: it lets an
|
|
6
|
+
* existing user reconfigure providers, channels, and profile without
|
|
7
|
+
* reinstalling from scratch.
|
|
19
8
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
|
|
9
|
+
export type AdoptChannel = "telegram";
|
|
10
|
+
export interface RunAdoptOptions {
|
|
11
|
+
/** If set, only adopt this channel instead of running the full wizard. */
|
|
12
|
+
channel?: AdoptChannel;
|
|
13
|
+
/** Pre-supplied token for non-interactive channel adoption. */
|
|
14
|
+
token?: string;
|
|
15
|
+
/** Restrict gateway to a single chat id. */
|
|
16
|
+
allowedChatId?: string;
|
|
17
|
+
/** Skip interactive prompts (requires token for channel adoption). */
|
|
18
|
+
nonInteractive?: boolean;
|
|
19
|
+
/** For tests: validate the token via Telegram getMe. */
|
|
20
|
+
validate?: () => Promise<boolean>;
|
|
28
21
|
}
|
|
29
22
|
export interface AdoptResult {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
readonly tokenLength?: number;
|
|
23
|
+
ok: boolean;
|
|
24
|
+
channel?: AdoptChannel;
|
|
25
|
+
message: string;
|
|
26
|
+
tokenWritten?: boolean;
|
|
27
|
+
tokenLength?: number;
|
|
28
|
+
validated?: boolean;
|
|
29
|
+
allowedChatId?: string;
|
|
38
30
|
}
|
|
39
|
-
export declare function
|
|
40
|
-
|
|
41
|
-
export declare function defaultTelegramValidate(token: string): Promise<boolean>;
|
|
42
|
-
export declare function runAdopt(opts?: AdoptOptions): Promise<AdoptResult>;
|
|
31
|
+
export declare function runChannelAdopt(channel: AdoptChannel, options?: RunAdoptOptions): Promise<AdoptResult>;
|
|
32
|
+
export declare function runAdopt(options?: RunAdoptOptions): Promise<AdoptResult>;
|