@aikyroon/installer-core 1.1.17 → 1.1.19

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.
Files changed (54) hide show
  1. package/dist/autoUpdate.d.ts +150 -0
  2. package/dist/autoUpdate.d.ts.map +1 -0
  3. package/dist/autoUpdate.js +582 -0
  4. package/dist/autoUpdate.js.map +1 -0
  5. package/dist/bundle.d.ts +66 -0
  6. package/dist/bundle.d.ts.map +1 -0
  7. package/dist/bundle.js +232 -0
  8. package/dist/bundle.js.map +1 -0
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/cli.js +253 -23
  11. package/dist/cli.js.map +1 -1
  12. package/dist/cliHelp.d.ts +31 -0
  13. package/dist/cliHelp.d.ts.map +1 -0
  14. package/dist/cliHelp.js +117 -0
  15. package/dist/cliHelp.js.map +1 -0
  16. package/dist/doctor.d.ts.map +1 -1
  17. package/dist/doctor.js +10 -1
  18. package/dist/doctor.js.map +1 -1
  19. package/dist/doctorChecks.d.ts +8 -0
  20. package/dist/doctorChecks.d.ts.map +1 -1
  21. package/dist/doctorChecks.js +63 -0
  22. package/dist/doctorChecks.js.map +1 -1
  23. package/dist/index.d.ts +5 -2
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +5 -2
  26. package/dist/index.js.map +1 -1
  27. package/dist/install.d.ts +13 -0
  28. package/dist/install.d.ts.map +1 -1
  29. package/dist/install.js +164 -11
  30. package/dist/install.js.map +1 -1
  31. package/dist/macos.d.ts +8 -1
  32. package/dist/macos.d.ts.map +1 -1
  33. package/dist/macos.js +15 -1
  34. package/dist/macos.js.map +1 -1
  35. package/dist/mediaPack.d.ts +83 -0
  36. package/dist/mediaPack.d.ts.map +1 -0
  37. package/dist/mediaPack.js +292 -0
  38. package/dist/mediaPack.js.map +1 -0
  39. package/dist/processes.d.ts +20 -2
  40. package/dist/processes.d.ts.map +1 -1
  41. package/dist/processes.js +114 -18
  42. package/dist/processes.js.map +1 -1
  43. package/dist/shortcuts.d.ts +1 -0
  44. package/dist/shortcuts.d.ts.map +1 -1
  45. package/dist/shortcuts.js +1 -1
  46. package/dist/shortcuts.js.map +1 -1
  47. package/dist/uninstall.d.ts.map +1 -1
  48. package/dist/uninstall.js +14 -0
  49. package/dist/uninstall.js.map +1 -1
  50. package/dist/verify.d.ts +2 -0
  51. package/dist/verify.d.ts.map +1 -1
  52. package/dist/verify.js +32 -0
  53. package/dist/verify.js.map +1 -1
  54. package/package.json +4 -1
@@ -0,0 +1,150 @@
1
+ import type { PlatformInfo, ReleaseChannel } from './types.js';
2
+ /**
3
+ * Atualização automática AGENDADA (task 9440).
4
+ *
5
+ * Registra no agendador NATIVO do SO uma execução de `kyroon update [canal]`
6
+ * várias vezes ao dia (padrão 3x: 09:00, 13:00 e 18:00), para a máquina se
7
+ * manter atualizada sem o usuário digitar nada:
8
+ *
9
+ * Windows -> Agendador de Tarefas (`Register-ScheduledTask`): um gatilho
10
+ * diário por horário, `StartWhenAvailable` (roda ao ligar se o
11
+ * horário passou com o PC desligado), atraso aleatório de até
12
+ * 15 min e janela OCULTA (launcher `.vbs` via `wscript.exe`).
13
+ * Linux -> timer do `systemd --user` (`Persistent=true` +
14
+ * `RandomizedDelaySec`); sem systemd de usuário, `crontab`.
15
+ * macOS -> LaunchAgent com `StartCalendarInterval` (o launchd roda o
16
+ * horário perdido quando o Mac acorda).
17
+ *
18
+ * A execução agendada chama a MESMA CLI com a flag oculta `--scheduled-run`
19
+ * (modo desassistido): só atualiza componentes já instalados, só reabre o que
20
+ * estava aberto e não re-registra a tarefa. Tudo aqui é BEST-EFFORT para o
21
+ * install/update: uma falha ao agendar apenas avisa — jamais derruba uma
22
+ * instalação que deu certo.
23
+ */
24
+ /** Horários padrão: início da manhã, depois do almoço e fim do expediente. */
25
+ export declare const DEFAULT_AUTO_UPDATE_TIMES: readonly ["09:00", "13:00", "18:00"];
26
+ /** Flag (oculta) que marca a execução disparada pelo agendador. */
27
+ export declare const SCHEDULED_RUN_FLAG = "--scheduled-run";
28
+ /** Registro local: `<installRoot>/auto-update.json` (uma entrada por CLI). */
29
+ export declare const AUTO_UPDATE_FILE = "auto-update.json";
30
+ export interface AutoUpdateEntry {
31
+ bin: string;
32
+ enabled: boolean;
33
+ channel: ReleaseChannel;
34
+ times: string[];
35
+ /** Comando exato registrado no agendador. */
36
+ command?: {
37
+ exe: string;
38
+ args: string[];
39
+ };
40
+ /** `task-scheduler` | `systemd` | `cron` | `launchd`. */
41
+ backend?: string;
42
+ updatedAt: string;
43
+ }
44
+ type Registry = Record<string, AutoUpdateEntry>;
45
+ export interface EnableAutoUpdateOptions {
46
+ platform: PlatformInfo;
47
+ /** Nome do comando (`kyroon`, `kyroon-worker`, …) — identifica a tarefa. */
48
+ bin: string;
49
+ installRoot: string;
50
+ channel: ReleaseChannel;
51
+ /** Horários `HH:MM`. Ausente = os do registro anterior ou o padrão. */
52
+ times?: string[];
53
+ /** `--install-root` explícito (repassado à execução agendada). */
54
+ explicitInstallRoot?: string;
55
+ /** `--api-url` explícito (repassado à execução agendada). */
56
+ apiUrl?: string;
57
+ /** Pacote npm da CLI — usado quando ela roda pelo `npx` (cache volátil). */
58
+ npmPackage?: string | null;
59
+ }
60
+ /**
61
+ * Converte `"9,13:30,18h"` / `"09:00 21h15"` em `["09:00","13:30","18:00"]`
62
+ * (ordenado, sem repetição). Inválido = erro com a explicação.
63
+ */
64
+ export declare function parseAutoUpdateTimes(raw: string): string[];
65
+ /**
66
+ * Como o agendador chama a CLI: `node <dist/cli.js>` do pacote global (o npm
67
+ * mantém o caminho estável entre versões — o self-update troca o conteúdo, não
68
+ * o caminho). Rodando pelo `npx`, o cache é volátil: agenda `npx --yes
69
+ * <pacote>@latest`.
70
+ */
71
+ export declare function resolveCliInvocation(npmPackage?: string | null, entry?: string | undefined, nodeExe?: string): {
72
+ exe: string;
73
+ args: string[];
74
+ };
75
+ /** Argumentos de `update` da execução agendada. */
76
+ export declare function buildScheduledUpdateArgs(opts: {
77
+ channel: ReleaseChannel;
78
+ explicitInstallRoot?: string;
79
+ apiUrl?: string;
80
+ }): string[];
81
+ /** Nome da tarefa no Agendador do Windows (pasta raiz — subpasta exige admin). */
82
+ export declare function windowsTaskName(bin: string): string;
83
+ export declare function systemdUnitName(bin: string): string;
84
+ export declare function launchdLabel(bin: string): string;
85
+ /**
86
+ * Launcher `.vbs`: roda a CLI com a janela OCULTA (0) e devolve o código de
87
+ * saída ao Agendador. Sem ele, cada execução abriria um console na cara do
88
+ * usuário três vezes ao dia.
89
+ */
90
+ export declare function buildWindowsLauncherVbs(exe: string, args: string[]): string;
91
+ /** Script PowerShell que (re)registra a tarefa — vai por `-EncodedCommand`. */
92
+ export declare function buildWindowsRegisterScript(opts: {
93
+ taskName: string;
94
+ execute: string;
95
+ argument: string;
96
+ times: string[];
97
+ description: string;
98
+ }): string;
99
+ export declare function buildSystemdService(opts: {
100
+ exe: string;
101
+ args: string[];
102
+ channel: ReleaseChannel;
103
+ env: Record<string, string>;
104
+ }): string;
105
+ export declare function buildSystemdTimer(opts: {
106
+ unit: string;
107
+ times: string[];
108
+ }): string;
109
+ /**
110
+ * Remove as linhas desta CLI de um crontab e acrescenta as novas (uma por
111
+ * horário). Linhas de outras origens ficam intactas e na mesma ordem.
112
+ */
113
+ export declare function mergeCrontab(current: string, opts: {
114
+ bin: string;
115
+ times: string[] | null;
116
+ exe: string;
117
+ args: string[];
118
+ env: Record<string, string>;
119
+ }): string;
120
+ export declare function buildLaunchdPlist(opts: {
121
+ label: string;
122
+ exe: string;
123
+ args: string[];
124
+ times: string[];
125
+ env: Record<string, string>;
126
+ logFile: string;
127
+ }): string;
128
+ export declare function readAutoUpdateRegistry(installRoot: string): Promise<Registry>;
129
+ /** `true` quando o usuário desligou explicitamente (`kyroon auto-update off`). */
130
+ export declare function isAutoUpdateOptedOut(installRoot: string, bin: string): Promise<boolean>;
131
+ /**
132
+ * Cria ou atualiza o agendamento. Idempotente: rodar de novo só substitui a
133
+ * tarefa (mesmo nome) com o canal/horários atuais. Lança em caso de falha — o
134
+ * chamador decide se é aviso (install/update) ou erro (`auto-update on`).
135
+ */
136
+ export declare function enableAutoUpdate(opts: EnableAutoUpdateOptions): Promise<AutoUpdateEntry>;
137
+ /** Remove o agendamento. `optOut` = lembra que o usuário desligou (install não religa). */
138
+ export declare function disableAutoUpdate(platform: PlatformInfo, installRoot: string, bin: string, opts?: {
139
+ optOut?: boolean;
140
+ }): Promise<void>;
141
+ export interface AutoUpdateStatus {
142
+ /** Existe no agendador do SO. */
143
+ scheduled: boolean;
144
+ entry: AutoUpdateEntry | null;
145
+ /** Detalhe do agendador (próxima execução, último resultado…), quando disponível. */
146
+ details: string[];
147
+ }
148
+ export declare function getAutoUpdateStatus(platform: PlatformInfo, installRoot: string, bin: string): Promise<AutoUpdateStatus>;
149
+ export {};
150
+ //# sourceMappingURL=autoUpdate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoUpdate.d.ts","sourceRoot":"","sources":["../src/autoUpdate.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,yBAAyB,sCAAuC,CAAC;AAE9E,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,oBAAoB,CAAC;AAEpD,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAOnD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,6CAA6C;IAC7C,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC1C,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CA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