@axon-assistant/core 2026.8.23

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.
@@ -0,0 +1,41 @@
1
+ import { type Device } from '@axon/protocol';
2
+ import { type Runtime } from '@axon/core';
3
+ import type { PairingService } from './auth.js';
4
+ import type { PermissionHub } from './PermissionHub.js';
5
+ /**
6
+ * Что умеет демон и чего нет в ядре.
7
+ *
8
+ * Узкий интерфейс, а не ссылка на сам демон: команды не должны знать про
9
+ * сокеты, порты и упаковку — только про те три действия, которые им нужны.
10
+ * Заодно это разрывает круг в импортах, который иначе завязался бы между
11
+ * демоном и его же обработчиками.
12
+ */
13
+ export interface TelegramControl {
14
+ telegramLogin(step: 'phone' | 'code' | 'password' | 'cancel', value: string): Promise<{
15
+ state: 'code_sent' | 'password_needed' | 'done' | 'cancelled';
16
+ hint?: string;
17
+ name?: string;
18
+ }>;
19
+ telegramLogout(): Promise<void>;
20
+ telegramStatus(): {
21
+ bot: boolean;
22
+ user: boolean;
23
+ };
24
+ }
25
+ export interface CommandContext {
26
+ runtime: Runtime;
27
+ device: Device;
28
+ pairing: PairingService;
29
+ permissions: PermissionHub;
30
+ telegram: TelegramControl;
31
+ }
32
+ export declare class CommandError extends Error {
33
+ readonly code: 'forbidden' | 'not_found' | 'bad_request' | 'unknown_command';
34
+ constructor(code: 'forbidden' | 'not_found' | 'bad_request' | 'unknown_command', message: string);
35
+ }
36
+ /**
37
+ * Разобрать и выполнить команду. Проверка прав и схемы — до вызова
38
+ * обработчика: обработчик получает уже валидные данные от того, кому можно.
39
+ */
40
+ export declare function dispatch(name: string, payload: unknown, ctx: CommandContext): Promise<unknown>;
41
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,MAAM,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA8C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ddress } from './Daemon.js';
3
+ export { PermissionHub } from './PermissionHub.js';
4
+ export { PairingService, authenticate, hashToken, generateToken } from './auth.js';
5
+ export { dispatch, CommandError } from './commands.js';
6
+ export type { CommandContext } from './commands.js';
7
+ export { WsSession } from './WsSession.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}