@wasmsoft/fantastic 1.0.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/README.md +65 -0
- package/bin/run.js +27 -0
- package/bin/supervisor.js +65 -0
- package/dist/acquire/central-url.d.ts +9 -0
- package/dist/acquire/central-url.d.ts.map +1 -0
- package/dist/acquire/central-url.js +74 -0
- package/dist/acquire/central-url.js.map +1 -0
- package/dist/acquire/code.d.ts +21 -0
- package/dist/acquire/code.d.ts.map +1 -0
- package/dist/acquire/code.js +66 -0
- package/dist/acquire/code.js.map +1 -0
- package/dist/acquire/compatibility.d.ts +18 -0
- package/dist/acquire/compatibility.d.ts.map +1 -0
- package/dist/acquire/compatibility.js +36 -0
- package/dist/acquire/compatibility.js.map +1 -0
- package/dist/acquire/fetch.d.ts +26 -0
- package/dist/acquire/fetch.d.ts.map +1 -0
- package/dist/acquire/fetch.js +72 -0
- package/dist/acquire/fetch.js.map +1 -0
- package/dist/acquire/latest.d.ts +24 -0
- package/dist/acquire/latest.d.ts.map +1 -0
- package/dist/acquire/latest.js +95 -0
- package/dist/acquire/latest.js.map +1 -0
- package/dist/backup/archive.d.ts +26 -0
- package/dist/backup/archive.d.ts.map +1 -0
- package/dist/backup/archive.js +123 -0
- package/dist/backup/archive.js.map +1 -0
- package/dist/backup/restore.d.ts +46 -0
- package/dist/backup/restore.d.ts.map +1 -0
- package/dist/backup/restore.js +164 -0
- package/dist/backup/restore.js.map +1 -0
- package/dist/base-command.d.ts +54 -0
- package/dist/base-command.d.ts.map +1 -0
- package/dist/base-command.js +120 -0
- package/dist/base-command.js.map +1 -0
- package/dist/bundle-format/index.d.ts +6 -0
- package/dist/bundle-format/index.d.ts.map +1 -0
- package/dist/bundle-format/index.js +36 -0
- package/dist/bundle-format/index.js.map +1 -0
- package/dist/commands/activate.d.ts +15 -0
- package/dist/commands/activate.d.ts.map +1 -0
- package/dist/commands/activate.js +139 -0
- package/dist/commands/activate.js.map +1 -0
- package/dist/commands/backup.d.ts +11 -0
- package/dist/commands/backup.d.ts.map +1 -0
- package/dist/commands/backup.js +75 -0
- package/dist/commands/backup.js.map +1 -0
- package/dist/commands/config/get.d.ts +10 -0
- package/dist/commands/config/get.d.ts.map +1 -0
- package/dist/commands/config/get.js +33 -0
- package/dist/commands/config/get.js.map +1 -0
- package/dist/commands/config/list.d.ts +7 -0
- package/dist/commands/config/list.d.ts.map +1 -0
- package/dist/commands/config/list.js +43 -0
- package/dist/commands/config/list.js.map +1 -0
- package/dist/commands/config/set.d.ts +11 -0
- package/dist/commands/config/set.d.ts.map +1 -0
- package/dist/commands/config/set.js +56 -0
- package/dist/commands/config/set.js.map +1 -0
- package/dist/commands/db/migrate.d.ts +10 -0
- package/dist/commands/db/migrate.d.ts.map +1 -0
- package/dist/commands/db/migrate.js +67 -0
- package/dist/commands/db/migrate.js.map +1 -0
- package/dist/commands/dev.d.ts +19 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +149 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +11 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +75 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/health.d.ts +12 -0
- package/dist/commands/health.d.ts.map +1 -0
- package/dist/commands/health.js +109 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/install.d.ts +60 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +486 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/iptv/snapshot.d.ts +10 -0
- package/dist/commands/iptv/snapshot.d.ts.map +1 -0
- package/dist/commands/iptv/snapshot.js +55 -0
- package/dist/commands/iptv/snapshot.js.map +1 -0
- package/dist/commands/library/drives.d.ts +7 -0
- package/dist/commands/library/drives.d.ts.map +1 -0
- package/dist/commands/library/drives.js +71 -0
- package/dist/commands/library/drives.js.map +1 -0
- package/dist/commands/library/relink.d.ts +10 -0
- package/dist/commands/library/relink.d.ts.map +1 -0
- package/dist/commands/library/relink.js +72 -0
- package/dist/commands/library/relink.js.map +1 -0
- package/dist/commands/library/scan.d.ts +16 -0
- package/dist/commands/library/scan.d.ts.map +1 -0
- package/dist/commands/library/scan.js +87 -0
- package/dist/commands/library/scan.js.map +1 -0
- package/dist/commands/library/sections.d.ts +7 -0
- package/dist/commands/library/sections.d.ts.map +1 -0
- package/dist/commands/library/sections.js +33 -0
- package/dist/commands/library/sections.js.map +1 -0
- package/dist/commands/library/status.d.ts +7 -0
- package/dist/commands/library/status.d.ts.map +1 -0
- package/dist/commands/library/status.js +37 -0
- package/dist/commands/library/status.js.map +1 -0
- package/dist/commands/list.d.ts +7 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +73 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/live/channels.d.ts +10 -0
- package/dist/commands/live/channels.d.ts.map +1 -0
- package/dist/commands/live/channels.js +55 -0
- package/dist/commands/live/channels.js.map +1 -0
- package/dist/commands/live/test.d.ts +15 -0
- package/dist/commands/live/test.d.ts.map +1 -0
- package/dist/commands/live/test.js +116 -0
- package/dist/commands/live/test.js.map +1 -0
- package/dist/commands/logs.d.ts +16 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +77 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/migrate-cli.d.ts +11 -0
- package/dist/commands/migrate-cli.d.ts.map +1 -0
- package/dist/commands/migrate-cli.js +116 -0
- package/dist/commands/migrate-cli.js.map +1 -0
- package/dist/commands/owner/reset.d.ts +7 -0
- package/dist/commands/owner/reset.d.ts.map +1 -0
- package/dist/commands/owner/reset.js +74 -0
- package/dist/commands/owner/reset.js.map +1 -0
- package/dist/commands/restart.d.ts +11 -0
- package/dist/commands/restart.d.ts.map +1 -0
- package/dist/commands/restart.js +53 -0
- package/dist/commands/restart.js.map +1 -0
- package/dist/commands/restore.d.ts +17 -0
- package/dist/commands/restore.d.ts.map +1 -0
- package/dist/commands/restore.js +148 -0
- package/dist/commands/restore.js.map +1 -0
- package/dist/commands/self-update.d.ts +10 -0
- package/dist/commands/self-update.d.ts.map +1 -0
- package/dist/commands/self-update.js +98 -0
- package/dist/commands/self-update.js.map +1 -0
- package/dist/commands/setup.d.ts +19 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +111 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/shell.d.ts +118 -0
- package/dist/commands/shell.d.ts.map +1 -0
- package/dist/commands/shell.js +415 -0
- package/dist/commands/shell.js.map +1 -0
- package/dist/commands/start.d.ts +12 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +108 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +8 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +115 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/stop.d.ts +11 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/stop.js +45 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/commands/stream/cancel.d.ts +13 -0
- package/dist/commands/stream/cancel.d.ts.map +1 -0
- package/dist/commands/stream/cancel.js +31 -0
- package/dist/commands/stream/cancel.js.map +1 -0
- package/dist/commands/stream/encoders.d.ts +7 -0
- package/dist/commands/stream/encoders.d.ts.map +1 -0
- package/dist/commands/stream/encoders.js +42 -0
- package/dist/commands/stream/encoders.js.map +1 -0
- package/dist/commands/stream/queue.d.ts +7 -0
- package/dist/commands/stream/queue.d.ts.map +1 -0
- package/dist/commands/stream/queue.js +52 -0
- package/dist/commands/stream/queue.js.map +1 -0
- package/dist/commands/stream/sessions.d.ts +7 -0
- package/dist/commands/stream/sessions.d.ts.map +1 -0
- package/dist/commands/stream/sessions.js +44 -0
- package/dist/commands/stream/sessions.js.map +1 -0
- package/dist/commands/uninstall.d.ts +23 -0
- package/dist/commands/uninstall.d.ts.map +1 -0
- package/dist/commands/uninstall.js +290 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.d.ts +21 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +290 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/watch.d.ts +10 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +38 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/config/local-config.d.ts +22 -0
- package/dist/config/local-config.d.ts.map +1 -0
- package/dist/config/local-config.js +79 -0
- package/dist/config/local-config.js.map +1 -0
- package/dist/core-scripts/run.d.ts +22 -0
- package/dist/core-scripts/run.d.ts.map +1 -0
- package/dist/core-scripts/run.js +65 -0
- package/dist/core-scripts/run.js.map +1 -0
- package/dist/doctor/check.types.d.ts +51 -0
- package/dist/doctor/check.types.d.ts.map +1 -0
- package/dist/doctor/check.types.js +14 -0
- package/dist/doctor/check.types.js.map +1 -0
- package/dist/doctor/checks/core.check.d.ts +11 -0
- package/dist/doctor/checks/core.check.d.ts.map +1 -0
- package/dist/doctor/checks/core.check.js +104 -0
- package/dist/doctor/checks/core.check.js.map +1 -0
- package/dist/doctor/checks/data.check.d.ts +11 -0
- package/dist/doctor/checks/data.check.d.ts.map +1 -0
- package/dist/doctor/checks/data.check.js +70 -0
- package/dist/doctor/checks/data.check.js.map +1 -0
- package/dist/doctor/checks/environment.check.d.ts +6 -0
- package/dist/doctor/checks/environment.check.d.ts.map +1 -0
- package/dist/doctor/checks/environment.check.js +70 -0
- package/dist/doctor/checks/environment.check.js.map +1 -0
- package/dist/doctor/checks/integrity.check.d.ts +4 -0
- package/dist/doctor/checks/integrity.check.d.ts.map +1 -0
- package/dist/doctor/checks/integrity.check.js +89 -0
- package/dist/doctor/checks/integrity.check.js.map +1 -0
- package/dist/doctor/checks/isolation.check.d.ts +49 -0
- package/dist/doctor/checks/isolation.check.d.ts.map +1 -0
- package/dist/doctor/checks/isolation.check.js +220 -0
- package/dist/doctor/checks/isolation.check.js.map +1 -0
- package/dist/doctor/checks/licence.check.d.ts +8 -0
- package/dist/doctor/checks/licence.check.d.ts.map +1 -0
- package/dist/doctor/checks/licence.check.js +172 -0
- package/dist/doctor/checks/licence.check.js.map +1 -0
- package/dist/doctor/checks/ports.check.d.ts +4 -0
- package/dist/doctor/checks/ports.check.d.ts.map +1 -0
- package/dist/doctor/checks/ports.check.js +52 -0
- package/dist/doctor/checks/ports.check.js.map +1 -0
- package/dist/doctor/checks/supervisor.check.d.ts +19 -0
- package/dist/doctor/checks/supervisor.check.d.ts.map +1 -0
- package/dist/doctor/checks/supervisor.check.js +152 -0
- package/dist/doctor/checks/supervisor.check.js.map +1 -0
- package/dist/doctor/checks/tooling.check.d.ts +3 -0
- package/dist/doctor/checks/tooling.check.d.ts.map +1 -0
- package/dist/doctor/checks/tooling.check.js +43 -0
- package/dist/doctor/checks/tooling.check.js.map +1 -0
- package/dist/doctor/registry.d.ts +15 -0
- package/dist/doctor/registry.d.ts.map +1 -0
- package/dist/doctor/registry.js +53 -0
- package/dist/doctor/registry.js.map +1 -0
- package/dist/exit-codes.d.ts +18 -0
- package/dist/exit-codes.d.ts.map +1 -0
- package/dist/exit-codes.js +23 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/logs/sink.d.ts +11 -0
- package/dist/logs/sink.d.ts.map +1 -0
- package/dist/logs/sink.js +73 -0
- package/dist/logs/sink.js.map +1 -0
- package/dist/logs/tail.d.ts +17 -0
- package/dist/logs/tail.d.ts.map +1 -0
- package/dist/logs/tail.js +98 -0
- package/dist/logs/tail.js.map +1 -0
- package/dist/packaging/boot-task.d.ts +56 -0
- package/dist/packaging/boot-task.d.ts.map +1 -0
- package/dist/packaging/boot-task.js +151 -0
- package/dist/packaging/boot-task.js.map +1 -0
- package/dist/packaging/install.d.ts +154 -0
- package/dist/packaging/install.d.ts.map +1 -0
- package/dist/packaging/install.js +381 -0
- package/dist/packaging/install.js.map +1 -0
- package/dist/packaging/layout.d.ts +153 -0
- package/dist/packaging/layout.d.ts.map +1 -0
- package/dist/packaging/layout.js +168 -0
- package/dist/packaging/layout.js.map +1 -0
- package/dist/packaging/machine-path.d.ts +52 -0
- package/dist/packaging/machine-path.d.ts.map +1 -0
- package/dist/packaging/machine-path.js +237 -0
- package/dist/packaging/machine-path.js.map +1 -0
- package/dist/packaging/manifest.d.ts +37 -0
- package/dist/packaging/manifest.d.ts.map +1 -0
- package/dist/packaging/manifest.js +115 -0
- package/dist/packaging/manifest.js.map +1 -0
- package/dist/packaging/shims.d.ts +31 -0
- package/dist/packaging/shims.d.ts.map +1 -0
- package/dist/packaging/shims.js +165 -0
- package/dist/packaging/shims.js.map +1 -0
- package/dist/probes/internal-paths.d.ts +35 -0
- package/dist/probes/internal-paths.d.ts.map +1 -0
- package/dist/probes/internal-paths.js +58 -0
- package/dist/probes/internal-paths.js.map +1 -0
- package/dist/probes/internal.client.d.ts +54 -0
- package/dist/probes/internal.client.d.ts.map +1 -0
- package/dist/probes/internal.client.js +123 -0
- package/dist/probes/internal.client.js.map +1 -0
- package/dist/probes/port.probe.d.ts +21 -0
- package/dist/probes/port.probe.d.ts.map +1 -0
- package/dist/probes/port.probe.js +42 -0
- package/dist/probes/port.probe.js.map +1 -0
- package/dist/probes/service.probe.d.ts +29 -0
- package/dist/probes/service.probe.d.ts.map +1 -0
- package/dist/probes/service.probe.js +65 -0
- package/dist/probes/service.probe.js.map +1 -0
- package/dist/profiles/appliance.profile.d.ts +20 -0
- package/dist/profiles/appliance.profile.d.ts.map +1 -0
- package/dist/profiles/appliance.profile.js +137 -0
- package/dist/profiles/appliance.profile.js.map +1 -0
- package/dist/profiles/dev.profile.d.ts +22 -0
- package/dist/profiles/dev.profile.d.ts.map +1 -0
- package/dist/profiles/dev.profile.js +104 -0
- package/dist/profiles/dev.profile.js.map +1 -0
- package/dist/profiles/resolve.d.ts +37 -0
- package/dist/profiles/resolve.d.ts.map +1 -0
- package/dist/profiles/resolve.js +198 -0
- package/dist/profiles/resolve.js.map +1 -0
- package/dist/profiles/types.d.ts +57 -0
- package/dist/profiles/types.d.ts.map +1 -0
- package/dist/profiles/types.js +15 -0
- package/dist/profiles/types.js.map +1 -0
- package/dist/registry/local-registry.d.ts +79 -0
- package/dist/registry/local-registry.d.ts.map +1 -0
- package/dist/registry/local-registry.js +252 -0
- package/dist/registry/local-registry.js.map +1 -0
- package/dist/render/banner.d.ts +13 -0
- package/dist/render/banner.d.ts.map +1 -0
- package/dist/render/banner.js +83 -0
- package/dist/render/banner.js.map +1 -0
- package/dist/render/boot.render.d.ts +123 -0
- package/dist/render/boot.render.d.ts.map +1 -0
- package/dist/render/boot.render.js +288 -0
- package/dist/render/boot.render.js.map +1 -0
- package/dist/render/brand.d.ts +16 -0
- package/dist/render/brand.d.ts.map +1 -0
- package/dist/render/brand.js +22 -0
- package/dist/render/brand.js.map +1 -0
- package/dist/render/doctor.render.d.ts +12 -0
- package/dist/render/doctor.render.d.ts.map +1 -0
- package/dist/render/doctor.render.js +95 -0
- package/dist/render/doctor.render.js.map +1 -0
- package/dist/render/json.d.ts +29 -0
- package/dist/render/json.d.ts.map +1 -0
- package/dist/render/json.js +19 -0
- package/dist/render/json.js.map +1 -0
- package/dist/render/licence.render.d.ts +10 -0
- package/dist/render/licence.render.d.ts.map +1 -0
- package/dist/render/licence.render.js +167 -0
- package/dist/render/licence.render.js.map +1 -0
- package/dist/render/status.render.d.ts +6 -0
- package/dist/render/status.render.d.ts.map +1 -0
- package/dist/render/status.render.js +52 -0
- package/dist/render/status.render.js.map +1 -0
- package/dist/render/theme.d.ts +66 -0
- package/dist/render/theme.d.ts.map +1 -0
- package/dist/render/theme.js +89 -0
- package/dist/render/theme.js.map +1 -0
- package/dist/runtime-guard.d.ts +19 -0
- package/dist/runtime-guard.d.ts.map +1 -0
- package/dist/runtime-guard.js +57 -0
- package/dist/runtime-guard.js.map +1 -0
- package/dist/shell/input-mode.d.ts +25 -0
- package/dist/shell/input-mode.d.ts.map +1 -0
- package/dist/shell/input-mode.js +17 -0
- package/dist/shell/input-mode.js.map +1 -0
- package/dist/shell/parse-line.d.ts +6 -0
- package/dist/shell/parse-line.d.ts.map +1 -0
- package/dist/shell/parse-line.js +62 -0
- package/dist/shell/parse-line.js.map +1 -0
- package/dist/shell/suggestions.d.ts +14 -0
- package/dist/shell/suggestions.d.ts.map +1 -0
- package/dist/shell/suggestions.js +35 -0
- package/dist/shell/suggestions.js.map +1 -0
- package/dist/supervisor/dependencies.d.ts +2 -0
- package/dist/supervisor/dependencies.d.ts.map +1 -0
- package/dist/supervisor/dependencies.js +38 -0
- package/dist/supervisor/dependencies.js.map +1 -0
- package/dist/supervisor/entry.d.ts +36 -0
- package/dist/supervisor/entry.d.ts.map +1 -0
- package/dist/supervisor/entry.js +171 -0
- package/dist/supervisor/entry.js.map +1 -0
- package/dist/supervisor/inspect.d.ts +17 -0
- package/dist/supervisor/inspect.d.ts.map +1 -0
- package/dist/supervisor/inspect.js +39 -0
- package/dist/supervisor/inspect.js.map +1 -0
- package/dist/supervisor/invocation.d.ts +27 -0
- package/dist/supervisor/invocation.d.ts.map +1 -0
- package/dist/supervisor/invocation.js +33 -0
- package/dist/supervisor/invocation.js.map +1 -0
- package/dist/supervisor/monitor.d.ts +63 -0
- package/dist/supervisor/monitor.d.ts.map +1 -0
- package/dist/supervisor/monitor.js +141 -0
- package/dist/supervisor/monitor.js.map +1 -0
- package/dist/supervisor/orchestrator.d.ts +52 -0
- package/dist/supervisor/orchestrator.d.ts.map +1 -0
- package/dist/supervisor/orchestrator.js +154 -0
- package/dist/supervisor/orchestrator.js.map +1 -0
- package/dist/supervisor/pidfile.d.ts +21 -0
- package/dist/supervisor/pidfile.d.ts.map +1 -0
- package/dist/supervisor/pidfile.js +39 -0
- package/dist/supervisor/pidfile.js.map +1 -0
- package/dist/supervisor/process-identity.d.ts +19 -0
- package/dist/supervisor/process-identity.d.ts.map +1 -0
- package/dist/supervisor/process-identity.js +51 -0
- package/dist/supervisor/process-identity.js.map +1 -0
- package/dist/supervisor/readiness.d.ts +17 -0
- package/dist/supervisor/readiness.d.ts.map +1 -0
- package/dist/supervisor/readiness.js +52 -0
- package/dist/supervisor/readiness.js.map +1 -0
- package/dist/supervisor/restart-consumer.d.ts +37 -0
- package/dist/supervisor/restart-consumer.d.ts.map +1 -0
- package/dist/supervisor/restart-consumer.js +119 -0
- package/dist/supervisor/restart-consumer.js.map +1 -0
- package/dist/supervisor/runner.d.ts +2 -0
- package/dist/supervisor/runner.d.ts.map +1 -0
- package/dist/supervisor/runner.js +118 -0
- package/dist/supervisor/runner.js.map +1 -0
- package/dist/supervisor/schedule-timer.d.ts +38 -0
- package/dist/supervisor/schedule-timer.d.ts.map +1 -0
- package/dist/supervisor/schedule-timer.js +148 -0
- package/dist/supervisor/schedule-timer.js.map +1 -0
- package/dist/supervisor/spawn.d.ts +18 -0
- package/dist/supervisor/spawn.d.ts.map +1 -0
- package/dist/supervisor/spawn.js +119 -0
- package/dist/supervisor/spawn.js.map +1 -0
- package/dist/supervisor/state-files.d.ts +33 -0
- package/dist/supervisor/state-files.d.ts.map +1 -0
- package/dist/supervisor/state-files.js +110 -0
- package/dist/supervisor/state-files.js.map +1 -0
- package/dist/supervisor/tree-kill.d.ts +14 -0
- package/dist/supervisor/tree-kill.d.ts.map +1 -0
- package/dist/supervisor/tree-kill.js +82 -0
- package/dist/supervisor/tree-kill.js.map +1 -0
- package/dist/ui/health-panel.d.ts +8 -0
- package/dist/ui/health-panel.d.ts.map +1 -0
- package/dist/ui/health-panel.js +91 -0
- package/dist/ui/health-panel.js.map +1 -0
- package/dist/updating/apply.d.ts +50 -0
- package/dist/updating/apply.d.ts.map +1 -0
- package/dist/updating/apply.js +172 -0
- package/dist/updating/apply.js.map +1 -0
- package/dist/updating/download.d.ts +44 -0
- package/dist/updating/download.d.ts.map +1 -0
- package/dist/updating/download.js +144 -0
- package/dist/updating/download.js.map +1 -0
- package/dist/updating/rollback.d.ts +33 -0
- package/dist/updating/rollback.d.ts.map +1 -0
- package/dist/updating/rollback.js +54 -0
- package/dist/updating/rollback.js.map +1 -0
- package/dist/updating/self.d.ts +16 -0
- package/dist/updating/self.d.ts.map +1 -0
- package/dist/updating/self.js +50 -0
- package/dist/updating/self.js.map +1 -0
- package/dist/updating/verify.d.ts +25 -0
- package/dist/updating/verify.d.ts.map +1 -0
- package/dist/updating/verify.js +51 -0
- package/dist/updating/verify.js.map +1 -0
- package/dist/updating/versions.d.ts +31 -0
- package/dist/updating/versions.d.ts.map +1 -0
- package/dist/updating/versions.js +78 -0
- package/dist/updating/versions.js.map +1 -0
- package/dist/version.d.ts +4 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +29 -0
- package/dist/version.js.map +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
export declare const BUNDLE_DIRS: {
|
|
2
|
+
/** ما لا نكتبه ونشحنه: العُقدة وأدوات الوسائط. */
|
|
3
|
+
readonly runtime: "runtime";
|
|
4
|
+
readonly core: "core";
|
|
5
|
+
readonly live: "live";
|
|
6
|
+
/**
|
|
7
|
+
* AR: **المُشرِف وحده، لا الواجهة** (٠٢٦).
|
|
8
|
+
*
|
|
9
|
+
* كان هنا cli\: الواجهة كاملةً بشجرة اعتمادياتها (٠١٨)، 34 ميغابايت مقيسة. وقد خرجت إلى
|
|
10
|
+
* سِجلّ الحزم لأن عمرها مختلفٌ عن عمر المنتج — إصلاح سطرٍ فيها كان يكلّف إعادة تحزيمٍ
|
|
11
|
+
* وإعادة تثبيت.
|
|
12
|
+
*
|
|
13
|
+
* **وبقي المُشرِف لسببٍ واحد لا يقبل بديلًا**: مهمّة الإقلاع في جدولة ويندوز تناديه بمسارٍ
|
|
14
|
+
* مطلق، وتعمل بلا إنسانٍ أمام الجهاز بعد انقطاع الكهرباء، وبحسابٍ قد يكون SYSTEM أو حساب
|
|
15
|
+
* فنّيٍّ آخر. وتوجيهها إلى الواجهة العالمية يعني %AppData%\Roaming\npm الخاصّ **بمستخدمٍ
|
|
16
|
+
* بعينه** — مسارٌ لا يجده حسابٌ آخر، في المسار الذي لا يقرأ أحدٌ فيه رسالة خطأ.
|
|
17
|
+
*
|
|
18
|
+
* ويعمل على runtime\ المشحون كبقيّة الخدمات، فقاعدة العزل تبقى مفروضةً حيث تخدم مشاهدًا.
|
|
19
|
+
* EN: **The supervisor alone, not the CLI** (026).
|
|
20
|
+
*
|
|
21
|
+
* This used to be `cli\`: the whole CLI with its dependency tree (018), a measured 34 MB. It
|
|
22
|
+
* moved to a package registry because its life cycle differs from the product's — fixing a
|
|
23
|
+
* line in it used to cost a repack and a reinstall.
|
|
24
|
+
*
|
|
25
|
+
* **The supervisor stayed for one reason that admits no alternative**: the Windows scheduled
|
|
26
|
+
* task calls it by an absolute path, runs with nobody at the machine after a power cut, and
|
|
27
|
+
* may run as `SYSTEM` or as another technician's account. Pointing it at the global CLI means
|
|
28
|
+
* `%AppData%\Roaming\npm` belonging to **one particular user** — a path another account cannot
|
|
29
|
+
* find, on the path where nobody is present to read an error.
|
|
30
|
+
*
|
|
31
|
+
* It runs on the shipped `runtime\` like every service, so the isolation rule stays enforced
|
|
32
|
+
* wherever a viewer is served.
|
|
33
|
+
*/
|
|
34
|
+
readonly supervisor: "supervisor";
|
|
35
|
+
/**
|
|
36
|
+
* AR: الشيمة وحدها. **مجلد لا يحوي إلّا fantastic.cmd لأنه وحده ما يُعرَض على PATH** — ووضعها في
|
|
37
|
+
* جذر التثبيت كان سيفرض عرض الجذر كلّه، وفيه data\ وlogs\ (القرار D-018-04).
|
|
38
|
+
* EN: The shim alone. **A directory holding nothing but `fantastic.cmd`, because it alone goes on
|
|
39
|
+
* PATH** — putting the shim in the install root would have meant exposing the whole root, which
|
|
40
|
+
* contains data\ and logs\ (decision D-018-04).
|
|
41
|
+
*/
|
|
42
|
+
readonly bin: "bin";
|
|
43
|
+
/** الواجهة ملفات ثابتة تقدّمها النواة عبر PORTAL_DIST. */
|
|
44
|
+
readonly interfaceRoot: "interface";
|
|
45
|
+
readonly interfaceClient: string;
|
|
46
|
+
/** مِلك العميل. لا تلمسه عملية تلقائية. */
|
|
47
|
+
readonly data: "data";
|
|
48
|
+
readonly logs: "logs";
|
|
49
|
+
readonly run: "run";
|
|
50
|
+
readonly updates: "updates";
|
|
51
|
+
};
|
|
52
|
+
export declare const MANIFEST_FILE: string;
|
|
53
|
+
/** أسماء ثابتة داخل runtime/: ملفّ التشغيل يعتمد عليها حرفيًا. */
|
|
54
|
+
export declare const RUNTIME_FILES: {
|
|
55
|
+
readonly node: "node.exe";
|
|
56
|
+
readonly ffmpeg: "ffmpeg.exe";
|
|
57
|
+
readonly ffprobe: "ffprobe.exe";
|
|
58
|
+
};
|
|
59
|
+
/** مدخل كل خدمة داخل حزمتها، نسبةً إلى جذر التثبيت. */
|
|
60
|
+
export declare const SERVICE_ENTRY: {
|
|
61
|
+
readonly core: string;
|
|
62
|
+
readonly live: string;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* AR: مدخل المُشرِف المشحون، نسبةً إلى جذر الحزمة. تقرؤه الشيمة والإقلاع التجريبي معًا.
|
|
66
|
+
*
|
|
67
|
+
* كان cli\bin\run.js حتى ٠٢٦، حين خرجت الواجهة من الحزمة. والاسم تغيّر مع ما يشير إليه:
|
|
68
|
+
* ثابتٌ اسمه CLI_ENTRY يشير إلى مُشرِف يكذب على قارئه بعد سنة.
|
|
69
|
+
* EN: The shipped supervisor's entry point, relative to the bundle root. Read by the shim and the
|
|
70
|
+
* smoke boot alike.
|
|
71
|
+
*
|
|
72
|
+
* It was `cli\bin\run.js` until 026, when the CLI left the bundle. The name changed with what it
|
|
73
|
+
* points at: a constant called `CLI_ENTRY` aiming at a supervisor lies to its reader a year on.
|
|
74
|
+
*/
|
|
75
|
+
export declare const SUPERVISOR_ENTRY: string;
|
|
76
|
+
/**
|
|
77
|
+
* AR: أسماء الشيمات. .cmd لا .ps1: سياسة ويندوز الافتراضية Restricted تمنع الثانية، وقد قِيس
|
|
78
|
+
* ذلك ميدانيًّا — ورفع السياسة تغييرٌ في أمان جهاز العميل لا يجوز أن يكون ثمن تثبيت منتجنا
|
|
79
|
+
* (القرار D-018-03). و.cmd تعمل في PowerShell و cmd معًا.
|
|
80
|
+
* EN: The shim names. `.cmd` and not `.ps1`: Windows' default `Restricted` policy blocks the latter,
|
|
81
|
+
* as measured in the field — and raising the policy is a change to the customer's machine
|
|
82
|
+
* security that must not be the price of installing our product (decision D-018-03). A `.cmd`
|
|
83
|
+
* works in both PowerShell and cmd.
|
|
84
|
+
*/
|
|
85
|
+
export declare const SHIM_FILES: {
|
|
86
|
+
/**
|
|
87
|
+
* AR: في bin\ بعد التثبيت: تناديه **مهمّة الإقلاع** فيصل إلى المُشرِف المشحون.
|
|
88
|
+
*
|
|
89
|
+
* كان اسمه يصف ما كانه: الأمر fantastic العامّ الذي يكتبه الفنّي. وقد صار الفنّي يصل إلى
|
|
90
|
+
* الحزمة العالمية (٠٢٦)، وبقي الملفّ باسمه لأن **مهمّةً مسجَّلة على أجهزة عملاء تشير إليه
|
|
91
|
+
* بهذا الاسم**: تغييرُه يعني جهازًا لا تعود خدماته بعد انقطاع كهرباء، ومهمّةً تشير إلى ملفٍّ
|
|
92
|
+
* لا وجود له، ولا أحد أمام الشاشة ليقرأ الخطأ.
|
|
93
|
+
* EN: In `bin\` after installation: the **boot task** calls it, and it reaches the shipped
|
|
94
|
+
* supervisor.
|
|
95
|
+
*
|
|
96
|
+
* Its name used to describe what it was: the global `fantastic` command a technician typed.
|
|
97
|
+
* The technician now reaches the globally installed package (026), and the file kept its name
|
|
98
|
+
* because **tasks registered on customers' machines point at it by that name**: renaming it
|
|
99
|
+
* means an appliance whose services do not come back after a power cut, a task aiming at a
|
|
100
|
+
* file that does not exist, and nobody at the screen to read the error.
|
|
101
|
+
*/
|
|
102
|
+
readonly command: "fantastic.cmd";
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* الإضافات الأصلية التي **يجب** أن توجد في شجرة اعتماديات كل خدمة.
|
|
106
|
+
*
|
|
107
|
+
* غيابها لا يُفشل البناء ولا بدء العملية: يظهر عند أول استعلام قاعدة أو أول مصغّرة — أي عند العميل.
|
|
108
|
+
* لذلك تُفحَص صراحةً قبل الأرشفة (017/FR-019).
|
|
109
|
+
*/
|
|
110
|
+
export declare const REQUIRED_NATIVE: {
|
|
111
|
+
readonly core: readonly [string, string];
|
|
112
|
+
readonly live: readonly [string];
|
|
113
|
+
};
|
|
114
|
+
/** حِزَم المستودع الداخلية. تُنسَخ نسخًا فعليًا لأن الوصلة الرمزية تنكسر عند النقل. */
|
|
115
|
+
/**
|
|
116
|
+
* AR: حِزَم هذا المستودع. **تُحذَف من قائمة التثبيت وتُنسَخ يدويًا بعده** — ليست على السِّجل
|
|
117
|
+
* العامّ، فمحاولةُ تثبيتها ترجع 404.
|
|
118
|
+
*
|
|
119
|
+
* **وlicense-protocol كانت ناقصة من هنا، فتوقّف بناء الحزم كلّه.** أُضيفت إلى اعتماديات
|
|
120
|
+
* النواة في P4.2 ولم تُسجَّل في هذه القائمة، فصار `fantastic bundle` يفشل عند تثبيت
|
|
121
|
+
* اعتماديات النواة بـ404 @fantastic/license-protocol — أي أن **آخر حزمة أُنتجت كانت قبل
|
|
122
|
+
* وصول الترخيص**، ولا شيء يستطيع أن يصل عميلًا. وُجد بمحاولة بناء حزمة في P5.4، ولم يكن
|
|
123
|
+
* ليظهر بغير محاولة البناء: الاختبارات والـtypecheck كلّها تمرّ لأن الوصلة الرمزية في
|
|
124
|
+
* المستودع تعمل تمامًا.
|
|
125
|
+
*
|
|
126
|
+
* أيّ حزمة تُضاف إلى packages/ وتصير اعتمادًا لخدمة **يجب أن تُسجَّل هنا في نفس الالتزام**.
|
|
127
|
+
* EN: This repository's own packages. **Removed from the install list and copied in afterwards** —
|
|
128
|
+
* they are not on the public registry, so trying to install them returns `404`.
|
|
129
|
+
*
|
|
130
|
+
* **`license-protocol` was missing from here, and it stopped bundle builds entirely.** It was
|
|
131
|
+
* added to the core's dependencies in P4.2 and never registered in this list, so
|
|
132
|
+
* `fantastic bundle` failed installing the core's dependencies with
|
|
133
|
+
* `404 @fantastic/license-protocol` — meaning **the last bundle ever produced predates
|
|
134
|
+
* licensing**, and nothing could reach a customer. Found by attempting a bundle in P5.4, and it
|
|
135
|
+
* could not have surfaced any other way: tests and typecheck all pass because the workspace
|
|
136
|
+
* symlink works perfectly in the repository.
|
|
137
|
+
*
|
|
138
|
+
* Any package added to `packages/` that becomes a service dependency **must be registered here
|
|
139
|
+
* in the same commit**.
|
|
140
|
+
*/
|
|
141
|
+
export declare const WORKSPACE_PACKAGES: readonly ["@fantastic/shared-types", "@fantastic/token-codec", "@fantastic/license-protocol"];
|
|
142
|
+
/**
|
|
143
|
+
* حِزَم تُستبعَد من شجرة الإنتاج لأن الحزمة تشحن محتواها في مكان آخر.
|
|
144
|
+
*
|
|
145
|
+
* **قِيس في 017/T034:** حزمتا مُثبِّت ffmpeg/ffprobe اعتماديّتان للنواة ولخدمة البث معًا، فكانت
|
|
146
|
+
* الثنائيّات تُشحن **ثلاث مرّات** — 140 ميغابايت في شجرة كل خدمة و139 في runtime/، أي 419 لملفّات
|
|
147
|
+
* يلزم منها نسخة واحدة. مجموع اعتماديات الإنتاج كان 393 ميغابايت مقابل تقدير 70–90 في الخطة.
|
|
148
|
+
*
|
|
149
|
+
* تُستبعَد هنا، وتُضبَط FFMPEG_PATH وFFPROBE_PATH على نسخة runtime/، وكلا الخدمتين ترجع إلى
|
|
150
|
+
* حزمة المُثبِّت إن لم يُضبَط المتغيّر — فلا ينكسر التطوير في المستودع.
|
|
151
|
+
*/
|
|
152
|
+
export declare const EXCLUDED_FROM_BUNDLE: readonly ["@ffmpeg-installer/ffmpeg", "@ffprobe-installer/ffprobe"];
|
|
153
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/packaging/layout.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,WAAW;IACtB,kDAAkD;;;;IAIlD;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;;IAEH;;;;;;OAMG;;IAEH,4DAA4D;;;IAG5D,2CAA2C;;;;;CAKnC,CAAC;AAEX,eAAO,MAAM,aAAa,QAA6C,CAAC;AAExE,oEAAoE;AACpE,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,uDAAuD;AACvD,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,QAAuD,CAAC;AAErF;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU;IACrB;;;;;;;;;;;;;;;OAeG;;CAEK,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;CAMlB,CAAC;AAEX,uFAAuF;AACvF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,kBAAkB,+FAIrB,CAAC;AAEX;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,qEAAsE,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
// AR: تخطيط الحزمة كما نصّت عليه المعمارية v3 §09، **في مكان واحد**. كل خطوة في خطّ الأنابيب وكل
|
|
3
|
+
// أمر تثبيت يقرأ من هنا، فلا يُكتب اسم مجلد مرتين ولا ينحرف المُنتِج عن المستهلك.
|
|
4
|
+
// appliance.profile.ts يشير إلى نفس هذه المواضع؛ إن تغيّر أحدهما وجب أن يتغيّر الآخر.
|
|
5
|
+
// EN: The bundle layout from architecture v3 §09, **in one place**. Every pipeline step and every
|
|
6
|
+
// install command reads it from here, so no directory name is written twice and the producer
|
|
7
|
+
// cannot drift from the consumer. appliance.profile.ts points at these same locations; if one
|
|
8
|
+
// changes, the other must.
|
|
9
|
+
export const BUNDLE_DIRS = {
|
|
10
|
+
/** ما لا نكتبه ونشحنه: العُقدة وأدوات الوسائط. */
|
|
11
|
+
runtime: "runtime",
|
|
12
|
+
core: "core",
|
|
13
|
+
live: "live",
|
|
14
|
+
/**
|
|
15
|
+
* AR: **المُشرِف وحده، لا الواجهة** (٠٢٦).
|
|
16
|
+
*
|
|
17
|
+
* كان هنا cli\: الواجهة كاملةً بشجرة اعتمادياتها (٠١٨)، 34 ميغابايت مقيسة. وقد خرجت إلى
|
|
18
|
+
* سِجلّ الحزم لأن عمرها مختلفٌ عن عمر المنتج — إصلاح سطرٍ فيها كان يكلّف إعادة تحزيمٍ
|
|
19
|
+
* وإعادة تثبيت.
|
|
20
|
+
*
|
|
21
|
+
* **وبقي المُشرِف لسببٍ واحد لا يقبل بديلًا**: مهمّة الإقلاع في جدولة ويندوز تناديه بمسارٍ
|
|
22
|
+
* مطلق، وتعمل بلا إنسانٍ أمام الجهاز بعد انقطاع الكهرباء، وبحسابٍ قد يكون SYSTEM أو حساب
|
|
23
|
+
* فنّيٍّ آخر. وتوجيهها إلى الواجهة العالمية يعني %AppData%\Roaming\npm الخاصّ **بمستخدمٍ
|
|
24
|
+
* بعينه** — مسارٌ لا يجده حسابٌ آخر، في المسار الذي لا يقرأ أحدٌ فيه رسالة خطأ.
|
|
25
|
+
*
|
|
26
|
+
* ويعمل على runtime\ المشحون كبقيّة الخدمات، فقاعدة العزل تبقى مفروضةً حيث تخدم مشاهدًا.
|
|
27
|
+
* EN: **The supervisor alone, not the CLI** (026).
|
|
28
|
+
*
|
|
29
|
+
* This used to be `cli\`: the whole CLI with its dependency tree (018), a measured 34 MB. It
|
|
30
|
+
* moved to a package registry because its life cycle differs from the product's — fixing a
|
|
31
|
+
* line in it used to cost a repack and a reinstall.
|
|
32
|
+
*
|
|
33
|
+
* **The supervisor stayed for one reason that admits no alternative**: the Windows scheduled
|
|
34
|
+
* task calls it by an absolute path, runs with nobody at the machine after a power cut, and
|
|
35
|
+
* may run as `SYSTEM` or as another technician's account. Pointing it at the global CLI means
|
|
36
|
+
* `%AppData%\Roaming\npm` belonging to **one particular user** — a path another account cannot
|
|
37
|
+
* find, on the path where nobody is present to read an error.
|
|
38
|
+
*
|
|
39
|
+
* It runs on the shipped `runtime\` like every service, so the isolation rule stays enforced
|
|
40
|
+
* wherever a viewer is served.
|
|
41
|
+
*/
|
|
42
|
+
supervisor: "supervisor",
|
|
43
|
+
/**
|
|
44
|
+
* AR: الشيمة وحدها. **مجلد لا يحوي إلّا fantastic.cmd لأنه وحده ما يُعرَض على PATH** — ووضعها في
|
|
45
|
+
* جذر التثبيت كان سيفرض عرض الجذر كلّه، وفيه data\ وlogs\ (القرار D-018-04).
|
|
46
|
+
* EN: The shim alone. **A directory holding nothing but `fantastic.cmd`, because it alone goes on
|
|
47
|
+
* PATH** — putting the shim in the install root would have meant exposing the whole root, which
|
|
48
|
+
* contains data\ and logs\ (decision D-018-04).
|
|
49
|
+
*/
|
|
50
|
+
bin: "bin",
|
|
51
|
+
/** الواجهة ملفات ثابتة تقدّمها النواة عبر PORTAL_DIST. */
|
|
52
|
+
interfaceRoot: "interface",
|
|
53
|
+
interfaceClient: join("interface", "client"),
|
|
54
|
+
/** مِلك العميل. لا تلمسه عملية تلقائية. */
|
|
55
|
+
data: "data",
|
|
56
|
+
logs: "logs",
|
|
57
|
+
run: "run",
|
|
58
|
+
updates: "updates",
|
|
59
|
+
};
|
|
60
|
+
export const MANIFEST_FILE = join(BUNDLE_DIRS.updates, "versions.json");
|
|
61
|
+
/** أسماء ثابتة داخل runtime/: ملفّ التشغيل يعتمد عليها حرفيًا. */
|
|
62
|
+
export const RUNTIME_FILES = {
|
|
63
|
+
node: "node.exe",
|
|
64
|
+
ffmpeg: "ffmpeg.exe",
|
|
65
|
+
ffprobe: "ffprobe.exe",
|
|
66
|
+
};
|
|
67
|
+
/** مدخل كل خدمة داخل حزمتها، نسبةً إلى جذر التثبيت. */
|
|
68
|
+
export const SERVICE_ENTRY = {
|
|
69
|
+
core: join(BUNDLE_DIRS.core, "main.js"),
|
|
70
|
+
live: join(BUNDLE_DIRS.live, "main.js"),
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* AR: مدخل المُشرِف المشحون، نسبةً إلى جذر الحزمة. تقرؤه الشيمة والإقلاع التجريبي معًا.
|
|
74
|
+
*
|
|
75
|
+
* كان cli\bin\run.js حتى ٠٢٦، حين خرجت الواجهة من الحزمة. والاسم تغيّر مع ما يشير إليه:
|
|
76
|
+
* ثابتٌ اسمه CLI_ENTRY يشير إلى مُشرِف يكذب على قارئه بعد سنة.
|
|
77
|
+
* EN: The shipped supervisor's entry point, relative to the bundle root. Read by the shim and the
|
|
78
|
+
* smoke boot alike.
|
|
79
|
+
*
|
|
80
|
+
* It was `cli\bin\run.js` until 026, when the CLI left the bundle. The name changed with what it
|
|
81
|
+
* points at: a constant called `CLI_ENTRY` aiming at a supervisor lies to its reader a year on.
|
|
82
|
+
*/
|
|
83
|
+
export const SUPERVISOR_ENTRY = join(BUNDLE_DIRS.supervisor, "bin", "supervisor.js");
|
|
84
|
+
/**
|
|
85
|
+
* AR: أسماء الشيمات. .cmd لا .ps1: سياسة ويندوز الافتراضية Restricted تمنع الثانية، وقد قِيس
|
|
86
|
+
* ذلك ميدانيًّا — ورفع السياسة تغييرٌ في أمان جهاز العميل لا يجوز أن يكون ثمن تثبيت منتجنا
|
|
87
|
+
* (القرار D-018-03). و.cmd تعمل في PowerShell و cmd معًا.
|
|
88
|
+
* EN: The shim names. `.cmd` and not `.ps1`: Windows' default `Restricted` policy blocks the latter,
|
|
89
|
+
* as measured in the field — and raising the policy is a change to the customer's machine
|
|
90
|
+
* security that must not be the price of installing our product (decision D-018-03). A `.cmd`
|
|
91
|
+
* works in both PowerShell and cmd.
|
|
92
|
+
*/
|
|
93
|
+
export const SHIM_FILES = {
|
|
94
|
+
/**
|
|
95
|
+
* AR: في bin\ بعد التثبيت: تناديه **مهمّة الإقلاع** فيصل إلى المُشرِف المشحون.
|
|
96
|
+
*
|
|
97
|
+
* كان اسمه يصف ما كانه: الأمر fantastic العامّ الذي يكتبه الفنّي. وقد صار الفنّي يصل إلى
|
|
98
|
+
* الحزمة العالمية (٠٢٦)، وبقي الملفّ باسمه لأن **مهمّةً مسجَّلة على أجهزة عملاء تشير إليه
|
|
99
|
+
* بهذا الاسم**: تغييرُه يعني جهازًا لا تعود خدماته بعد انقطاع كهرباء، ومهمّةً تشير إلى ملفٍّ
|
|
100
|
+
* لا وجود له، ولا أحد أمام الشاشة ليقرأ الخطأ.
|
|
101
|
+
* EN: In `bin\` after installation: the **boot task** calls it, and it reaches the shipped
|
|
102
|
+
* supervisor.
|
|
103
|
+
*
|
|
104
|
+
* Its name used to describe what it was: the global `fantastic` command a technician typed.
|
|
105
|
+
* The technician now reaches the globally installed package (026), and the file kept its name
|
|
106
|
+
* because **tasks registered on customers' machines point at it by that name**: renaming it
|
|
107
|
+
* means an appliance whose services do not come back after a power cut, a task aiming at a
|
|
108
|
+
* file that does not exist, and nobody at the screen to read the error.
|
|
109
|
+
*/
|
|
110
|
+
command: "fantastic.cmd",
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* الإضافات الأصلية التي **يجب** أن توجد في شجرة اعتماديات كل خدمة.
|
|
114
|
+
*
|
|
115
|
+
* غيابها لا يُفشل البناء ولا بدء العملية: يظهر عند أول استعلام قاعدة أو أول مصغّرة — أي عند العميل.
|
|
116
|
+
* لذلك تُفحَص صراحةً قبل الأرشفة (017/FR-019).
|
|
117
|
+
*/
|
|
118
|
+
export const REQUIRED_NATIVE = {
|
|
119
|
+
core: [
|
|
120
|
+
join("@libsql", "win32-x64-msvc", "index.node"),
|
|
121
|
+
join("@img", "sharp-win32-x64"),
|
|
122
|
+
],
|
|
123
|
+
live: [join("@libsql", "win32-x64-msvc", "index.node")],
|
|
124
|
+
};
|
|
125
|
+
/** حِزَم المستودع الداخلية. تُنسَخ نسخًا فعليًا لأن الوصلة الرمزية تنكسر عند النقل. */
|
|
126
|
+
/**
|
|
127
|
+
* AR: حِزَم هذا المستودع. **تُحذَف من قائمة التثبيت وتُنسَخ يدويًا بعده** — ليست على السِّجل
|
|
128
|
+
* العامّ، فمحاولةُ تثبيتها ترجع 404.
|
|
129
|
+
*
|
|
130
|
+
* **وlicense-protocol كانت ناقصة من هنا، فتوقّف بناء الحزم كلّه.** أُضيفت إلى اعتماديات
|
|
131
|
+
* النواة في P4.2 ولم تُسجَّل في هذه القائمة، فصار `fantastic bundle` يفشل عند تثبيت
|
|
132
|
+
* اعتماديات النواة بـ404 @fantastic/license-protocol — أي أن **آخر حزمة أُنتجت كانت قبل
|
|
133
|
+
* وصول الترخيص**، ولا شيء يستطيع أن يصل عميلًا. وُجد بمحاولة بناء حزمة في P5.4، ولم يكن
|
|
134
|
+
* ليظهر بغير محاولة البناء: الاختبارات والـtypecheck كلّها تمرّ لأن الوصلة الرمزية في
|
|
135
|
+
* المستودع تعمل تمامًا.
|
|
136
|
+
*
|
|
137
|
+
* أيّ حزمة تُضاف إلى packages/ وتصير اعتمادًا لخدمة **يجب أن تُسجَّل هنا في نفس الالتزام**.
|
|
138
|
+
* EN: This repository's own packages. **Removed from the install list and copied in afterwards** —
|
|
139
|
+
* they are not on the public registry, so trying to install them returns `404`.
|
|
140
|
+
*
|
|
141
|
+
* **`license-protocol` was missing from here, and it stopped bundle builds entirely.** It was
|
|
142
|
+
* added to the core's dependencies in P4.2 and never registered in this list, so
|
|
143
|
+
* `fantastic bundle` failed installing the core's dependencies with
|
|
144
|
+
* `404 @fantastic/license-protocol` — meaning **the last bundle ever produced predates
|
|
145
|
+
* licensing**, and nothing could reach a customer. Found by attempting a bundle in P5.4, and it
|
|
146
|
+
* could not have surfaced any other way: tests and typecheck all pass because the workspace
|
|
147
|
+
* symlink works perfectly in the repository.
|
|
148
|
+
*
|
|
149
|
+
* Any package added to `packages/` that becomes a service dependency **must be registered here
|
|
150
|
+
* in the same commit**.
|
|
151
|
+
*/
|
|
152
|
+
export const WORKSPACE_PACKAGES = [
|
|
153
|
+
"@fantastic/shared-types",
|
|
154
|
+
"@fantastic/token-codec",
|
|
155
|
+
"@fantastic/license-protocol",
|
|
156
|
+
];
|
|
157
|
+
/**
|
|
158
|
+
* حِزَم تُستبعَد من شجرة الإنتاج لأن الحزمة تشحن محتواها في مكان آخر.
|
|
159
|
+
*
|
|
160
|
+
* **قِيس في 017/T034:** حزمتا مُثبِّت ffmpeg/ffprobe اعتماديّتان للنواة ولخدمة البث معًا، فكانت
|
|
161
|
+
* الثنائيّات تُشحن **ثلاث مرّات** — 140 ميغابايت في شجرة كل خدمة و139 في runtime/، أي 419 لملفّات
|
|
162
|
+
* يلزم منها نسخة واحدة. مجموع اعتماديات الإنتاج كان 393 ميغابايت مقابل تقدير 70–90 في الخطة.
|
|
163
|
+
*
|
|
164
|
+
* تُستبعَد هنا، وتُضبَط FFMPEG_PATH وFFPROBE_PATH على نسخة runtime/، وكلا الخدمتين ترجع إلى
|
|
165
|
+
* حزمة المُثبِّت إن لم يُضبَط المتغيّر — فلا ينكسر التطوير في المستودع.
|
|
166
|
+
*/
|
|
167
|
+
export const EXCLUDED_FROM_BUNDLE = ["@ffmpeg-installer/ffmpeg", "@ffprobe-installer/ffprobe"];
|
|
168
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/packaging/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,iGAAiG;AACjG,sFAAsF;AACtF,4FAA4F;AAC5F,kGAAkG;AAClG,iGAAiG;AACjG,kGAAkG;AAClG,+BAA+B;AAE/B,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,kDAAkD;IAClD,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,UAAU,EAAE,YAAY;IACxB;;;;;;OAMG;IACH,GAAG,EAAE,KAAK;IACV,4DAA4D;IAC5D,aAAa,EAAE,WAAW;IAC1B,eAAe,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC5C,2CAA2C;IAC3C,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AAExE,oEAAoE;AACpE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,aAAa;CACd,CAAC;AAEX,uDAAuD;AACvD,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC;IACvC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC;CAC/B,CAAC;AAEX;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,EAAE,eAAe;CAChB,CAAC;AAEX;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE;QACJ,IAAI,CAAC,SAAS,EAAE,gBAAgB,EAAE,YAAY,CAAC;QAC/C,IAAI,CAAC,MAAM,EAAE,iBAAiB,CAAC;KAChC;IACD,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;CAC/C,CAAC;AAEX,uFAAuF;AACvF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,yBAAyB;IACzB,wBAAwB;IACxB,6BAA6B;CACrB,CAAC;AAEX;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,0BAA0B,EAAE,4BAA4B,CAAU,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface MachinePathValue {
|
|
2
|
+
/** القيمة كما هي في السِّجل، **غير مُوسَّعة**. */
|
|
3
|
+
raw: string;
|
|
4
|
+
/** ExpandString عادةً. يُعاد كما هو حتى لا نغيّر نوع قيمة لم نُنشئها. */
|
|
5
|
+
kind: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* AR: يفكّ قيمة PATH إلى مُدخلاتها. الفاصلة المنقوطة فاصل، والمدخلات الفارغة تُسقَط: قيمة تنتهي
|
|
9
|
+
* بفاصلة منقوطة شائعة جدًّا، وإبقاء الفراغ ينتج مُدخلًا يعني «المجلد الحالي» — ثغرة معروفة.
|
|
10
|
+
* EN: Splits a PATH value into its entries. Semicolon separates, and empty entries are dropped: a
|
|
11
|
+
* value ending in a semicolon is very common, and keeping the blank yields an entry meaning "the
|
|
12
|
+
* current directory" — a well-known hazard.
|
|
13
|
+
*/
|
|
14
|
+
export declare function pathEntries(value: string): string[];
|
|
15
|
+
export declare function pathContains(value: string, entry: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* AR: القيمة بعد الإضافة، أو null إن كان المُدخَل موجودًا فلا كتابة أصلًا. الإضافة في **النهاية**:
|
|
18
|
+
* مُدخَلٌ في المقدّمة يسبق أدوات النظام ويحجب ما يشبهه اسمًا، وليس لنا حقّ في ذلك على جهاز لا
|
|
19
|
+
* نملكه.
|
|
20
|
+
* EN: The value after adding, or `null` when the entry is already present so nothing is written at
|
|
21
|
+
* all. Appended at **the end**: an entry at the front precedes the system's own tools and shadows
|
|
22
|
+
* anything sharing a name, which is not our right on a machine we do not own.
|
|
23
|
+
*/
|
|
24
|
+
export declare function addToPath(value: string, entry: string): string | null;
|
|
25
|
+
/**
|
|
26
|
+
* AR: القيمة بعد الإزالة، أو null إن لم يكن موجودًا. يُزيل كل نسخة منه — تثبيتات سابقة قد تكون
|
|
27
|
+
* خلّفت مكرّرات قبل أن يوجد فحص التكرار.
|
|
28
|
+
* EN: The value after removal, or `null` when it is not present. Removes every copy — earlier
|
|
29
|
+
* installations may have left duplicates before the duplicate check existed.
|
|
30
|
+
*/
|
|
31
|
+
export declare function removeFromPath(value: string, entry: string): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* AR: يعيد ملفّ fantastic الذي يفوز على PATH إن لم يكن شيمتنا، وإلّا undefined. يقرأ PATH العملية
|
|
34
|
+
* الحالية لا السِّجل: السؤال هو «ماذا يحدث حين يُكتب الاسم الآن»، لا «ماذا سيحدث بعد إعادة فتح».
|
|
35
|
+
* EN: Returns the `fantastic` file that wins on PATH when it is not our shim, else `undefined`. It
|
|
36
|
+
* reads the current process's PATH rather than the registry: the question is "what happens when
|
|
37
|
+
* the name is typed now", not "what will happen after a fresh terminal".
|
|
38
|
+
*/
|
|
39
|
+
export declare function findConflictingCommand(ourShim: string): string | undefined;
|
|
40
|
+
/** يقرأ PATH الآلة غير مُوسَّعة، مع نوع قيمتها. undefined على غير ويندوز أو عند تعذّر القراءة. */
|
|
41
|
+
export declare function readMachinePath(): Promise<MachinePathValue | undefined>;
|
|
42
|
+
export interface PathChange {
|
|
43
|
+
/** true إن تغيّر السِّجل فعلًا. false يعني «كان صحيحًا أصلًا» لا «فشل». */
|
|
44
|
+
changed: boolean;
|
|
45
|
+
detail: string;
|
|
46
|
+
backupPath?: string;
|
|
47
|
+
}
|
|
48
|
+
/** يُضيف مجلدًا إلى PATH الآلة إن لم يكن فيه. */
|
|
49
|
+
export declare function registerOnMachinePath(entry: string, logDir: string): Promise<PathChange>;
|
|
50
|
+
/** يُزيل مجلدًا من PATH الآلة إن كان فيه. جهازٌ أُزيل عنه النظام لا يبقى فيه أثرٌ ميّت. */
|
|
51
|
+
export declare function unregisterFromMachinePath(entry: string, logDir: string): Promise<PathChange>;
|
|
52
|
+
//# sourceMappingURL=machine-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"machine-path.d.ts","sourceRoot":"","sources":["../../src/packaging/machine-path.ts"],"names":[],"mappings":"AAsCA,MAAM,WAAW,gBAAgB;IAC/B,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAKnD;AAeD,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAElE;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMrE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK1E;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAa1E;AASD,oGAAoG;AACpG,wBAAsB,eAAe,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAuB7E;AA+DD,MAAM,WAAW,UAAU;IACzB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAmCD,iDAAiD;AACjD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAOxF;AAED,2FAA2F;AAC3F,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAO5F"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { delimiter, join, resolve } from "node:path";
|
|
3
|
+
import { execa } from "execa";
|
|
4
|
+
// AR: تسجيل bin\ في PATH الآلة وإلغاؤه (٠١٨/P3).
|
|
5
|
+
//
|
|
6
|
+
// **هذا أخطر ملفّ في الميزة.** خطأٌ هنا لا يعطّل نظامنا بل الجهاز كلّه: PATH تالف يعني أن ويندوز
|
|
7
|
+
// نفسه لا يجد أدواته. لذلك كل قرار فيه محافظ بالضرورة لا بالذوق:
|
|
8
|
+
//
|
|
9
|
+
// ١ — **إلحاق لا استبدال.** القيمة تُقرأ ثم يُضاف إليها، ولا تُكتب من الصفر أبدًا.
|
|
10
|
+
// ٢ — **قراءة غير مُوسَّعة.** قيمة PATH من نوع REG_EXPAND_SZ وتحوي مُدخلات مثل
|
|
11
|
+
// %SystemRoot%\system32. قراءتها بالطريق المعتاد
|
|
12
|
+
// ([Environment]::GetEnvironmentVariable) تُرجعها **مُوسَّعة**، فإعادة كتابتها تُجمّد
|
|
13
|
+
// المسارات نصًّا ثابتًا: جهازٌ يُغيَّر حرف قرص نظامه أو يُرحَّل يفقد PATH صالحًا. نقرأ عبر
|
|
14
|
+
// GetValue(..., DoNotExpandEnvironmentNames) ونكتب بنفس نوع القيمة الأصلي.
|
|
15
|
+
// ٣ — **لا setx أبدًا.** يقصّ القيمة عند ١٠٢٤ محرفًا بلا إنذار، و PATH آلةٍ عاملة يتجاوزها
|
|
16
|
+
// عادةً. أداةٌ تبدو مناسبة وتُتلف بصمت.
|
|
17
|
+
// ٤ — **نسخة احتياطية قبل كل كتابة**، في logs\، بالقيمة غير المُوسَّعة كما قُرئت. إن ساء شيء
|
|
18
|
+
// فالاسترجاع نسخٌ ولصق لا تخمين.
|
|
19
|
+
// EN: Registering `bin\` in the machine PATH and removing it (018/P3).
|
|
20
|
+
//
|
|
21
|
+
// **This is the most dangerous file in the feature.** A mistake here disables not our system but
|
|
22
|
+
// the whole machine: a corrupted PATH means Windows itself cannot find its own tools. So every
|
|
23
|
+
// decision in it is conservative by necessity rather than taste:
|
|
24
|
+
//
|
|
25
|
+
// 1 — **Append, never replace.** The value is read and added to; it is never written from scratch.
|
|
26
|
+
// 2 — **Read unexpanded.** PATH is a `REG_EXPAND_SZ` holding entries like `%SystemRoot%\system32`.
|
|
27
|
+
// Reading it the usual way (`[Environment]::GetEnvironmentVariable`) returns it **expanded**,
|
|
28
|
+
// so writing it back freezes those paths into literal text: a machine whose system drive
|
|
29
|
+
// letter changes, or that is migrated, loses a working PATH. We read via
|
|
30
|
+
// `GetValue(..., DoNotExpandEnvironmentNames)` and write back with the original value kind.
|
|
31
|
+
// 3 — **Never `setx`.** It truncates at 1024 characters without warning, and a working machine's
|
|
32
|
+
// PATH commonly exceeds that. A tool that looks right and corrupts silently.
|
|
33
|
+
// 4 — **A backup before every write**, in `logs\`, holding the unexpanded value exactly as read.
|
|
34
|
+
// If anything goes wrong, recovery is copy-and-paste rather than guesswork.
|
|
35
|
+
const ENVIRONMENT_KEY = "HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";
|
|
36
|
+
/**
|
|
37
|
+
* AR: يفكّ قيمة PATH إلى مُدخلاتها. الفاصلة المنقوطة فاصل، والمدخلات الفارغة تُسقَط: قيمة تنتهي
|
|
38
|
+
* بفاصلة منقوطة شائعة جدًّا، وإبقاء الفراغ ينتج مُدخلًا يعني «المجلد الحالي» — ثغرة معروفة.
|
|
39
|
+
* EN: Splits a PATH value into its entries. Semicolon separates, and empty entries are dropped: a
|
|
40
|
+
* value ending in a semicolon is very common, and keeping the blank yields an entry meaning "the
|
|
41
|
+
* current directory" — a well-known hazard.
|
|
42
|
+
*/
|
|
43
|
+
export function pathEntries(value) {
|
|
44
|
+
return value
|
|
45
|
+
.split(";")
|
|
46
|
+
.map((entry) => entry.trim())
|
|
47
|
+
.filter((entry) => entry.length > 0);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* AR: هل المُدخَل موجود أصلًا؟ المقارنة بلا حساسية لحالة الأحرف وبتجاهل الشرطة الأخيرة، لأن ويندوز
|
|
51
|
+
* يعامل C:\Fantastic\bin وc:\fantastic\bin\ مسارًا واحدًا — ولو قارنّا نصًّا خامًا لأضاف
|
|
52
|
+
* التثبيت الثاني مُدخلًا مكرّرًا في كل مرّة.
|
|
53
|
+
* EN: Is the entry already there? The comparison ignores case and a trailing separator, because
|
|
54
|
+
* Windows treats `C:\Fantastic\bin` and `c:\fantastic\bin\` as one path — and a raw text compare
|
|
55
|
+
* would make every reinstall append yet another duplicate.
|
|
56
|
+
*/
|
|
57
|
+
function sameEntry(a, b) {
|
|
58
|
+
const normalise = (value) => value.replace(/[\\/]+$/, "").toLowerCase();
|
|
59
|
+
return normalise(a) === normalise(b);
|
|
60
|
+
}
|
|
61
|
+
export function pathContains(value, entry) {
|
|
62
|
+
return pathEntries(value).some((existing) => sameEntry(existing, entry));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* AR: القيمة بعد الإضافة، أو null إن كان المُدخَل موجودًا فلا كتابة أصلًا. الإضافة في **النهاية**:
|
|
66
|
+
* مُدخَلٌ في المقدّمة يسبق أدوات النظام ويحجب ما يشبهه اسمًا، وليس لنا حقّ في ذلك على جهاز لا
|
|
67
|
+
* نملكه.
|
|
68
|
+
* EN: The value after adding, or `null` when the entry is already present so nothing is written at
|
|
69
|
+
* all. Appended at **the end**: an entry at the front precedes the system's own tools and shadows
|
|
70
|
+
* anything sharing a name, which is not our right on a machine we do not own.
|
|
71
|
+
*/
|
|
72
|
+
export function addToPath(value, entry) {
|
|
73
|
+
if (pathContains(value, entry))
|
|
74
|
+
return null;
|
|
75
|
+
const entries = pathEntries(value);
|
|
76
|
+
entries.push(entry);
|
|
77
|
+
return entries.join(";");
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* AR: القيمة بعد الإزالة، أو null إن لم يكن موجودًا. يُزيل كل نسخة منه — تثبيتات سابقة قد تكون
|
|
81
|
+
* خلّفت مكرّرات قبل أن يوجد فحص التكرار.
|
|
82
|
+
* EN: The value after removal, or `null` when it is not present. Removes every copy — earlier
|
|
83
|
+
* installations may have left duplicates before the duplicate check existed.
|
|
84
|
+
*/
|
|
85
|
+
export function removeFromPath(value, entry) {
|
|
86
|
+
const entries = pathEntries(value);
|
|
87
|
+
const kept = entries.filter((existing) => !sameEntry(existing, entry));
|
|
88
|
+
return kept.length === entries.length ? null : kept.join(";");
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* AR: يعيد ملفّ fantastic الذي يفوز على PATH إن لم يكن شيمتنا، وإلّا undefined. يقرأ PATH العملية
|
|
92
|
+
* الحالية لا السِّجل: السؤال هو «ماذا يحدث حين يُكتب الاسم الآن»، لا «ماذا سيحدث بعد إعادة فتح».
|
|
93
|
+
* EN: Returns the `fantastic` file that wins on PATH when it is not our shim, else `undefined`. It
|
|
94
|
+
* reads the current process's PATH rather than the registry: the question is "what happens when
|
|
95
|
+
* the name is typed now", not "what will happen after a fresh terminal".
|
|
96
|
+
*/
|
|
97
|
+
export function findConflictingCommand(ourShim) {
|
|
98
|
+
const extensions = (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean);
|
|
99
|
+
const entries = pathEntries(process.env.PATH ?? process.env.Path ?? "").flatMap((entry) => entry.split(delimiter));
|
|
100
|
+
for (const directory of entries) {
|
|
101
|
+
for (const extension of extensions) {
|
|
102
|
+
const candidate = join(directory, `fantastic${extension.toLowerCase()}`);
|
|
103
|
+
if (!existsSync(candidate))
|
|
104
|
+
continue;
|
|
105
|
+
return resolve(candidate).toLowerCase() === resolve(ourShim).toLowerCase() ? undefined : candidate;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
async function powershell(script) {
|
|
111
|
+
const { stdout } = await execa("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script], {
|
|
112
|
+
timeout: 20_000,
|
|
113
|
+
});
|
|
114
|
+
return stdout;
|
|
115
|
+
}
|
|
116
|
+
/** يقرأ PATH الآلة غير مُوسَّعة، مع نوع قيمتها. undefined على غير ويندوز أو عند تعذّر القراءة. */
|
|
117
|
+
export async function readMachinePath() {
|
|
118
|
+
if (process.platform !== "win32")
|
|
119
|
+
return undefined;
|
|
120
|
+
// DoNotExpandEnvironmentNames هي بيت القصيد: بدونها تعود %SystemRoot% نصًّا مُوسَّعًا فتُجمَّد.
|
|
121
|
+
const script = [
|
|
122
|
+
`$key = Get-Item -LiteralPath '${ENVIRONMENT_KEY}'`,
|
|
123
|
+
`$raw = $key.GetValue('Path', $null, 'DoNotExpandEnvironmentNames')`,
|
|
124
|
+
`$kind = $key.GetValueKind('Path')`,
|
|
125
|
+
`if ($null -eq $raw) { exit 1 }`,
|
|
126
|
+
// سطر أول للنوع ثم القيمة كما هي. [char]10 لا محرف هروب PowerShell: الأخير علامة اقتباس
|
|
127
|
+
// خلفية، وهي تُنهي القالب النصّي في TypeScript قبل أن تصل إلى PowerShell أصلًا.
|
|
128
|
+
`[Console]::Out.Write($kind.ToString() + [char]10 + $raw)`,
|
|
129
|
+
].join("; ");
|
|
130
|
+
try {
|
|
131
|
+
const stdout = await powershell(script);
|
|
132
|
+
const newline = stdout.indexOf("\n");
|
|
133
|
+
if (newline < 0)
|
|
134
|
+
return undefined;
|
|
135
|
+
return { kind: stdout.slice(0, newline).trim(), raw: stdout.slice(newline + 1) };
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* AR: يكتب القيمة الجديدة بنفس نوعها الأصلي، ثم يُذيع WM_SETTINGCHANGE ليعرف مستكشف الملفات أن
|
|
143
|
+
* البيئة تغيّرت. الإذاعة **أفضل جهد**: فشلها لا يُفشل التثبيت، وغايتها وحدها أن تقصر الانتظار
|
|
144
|
+
* على طرفية جديدة بدل إعادة تسجيل الدخول.
|
|
145
|
+
* EN: Writes the new value with its original kind, then broadcasts `WM_SETTINGCHANGE` so Explorer
|
|
146
|
+
* learns the environment changed. The broadcast is **best effort**: its failure does not fail the
|
|
147
|
+
* installation, and its only purpose is to reduce the wait to a new terminal rather than a new
|
|
148
|
+
* logon.
|
|
149
|
+
*/
|
|
150
|
+
async function writeMachinePath(value, kind) {
|
|
151
|
+
const encoded = Buffer.from(value, "utf8").toString("base64");
|
|
152
|
+
// القيمة تعبر مُرمَّزة بـbase64 لا نصًّا: PATH يحوي فواصل منقوطة وعلامات اقتباس وعلامات نسبة،
|
|
153
|
+
// وأي منها في سطر أوامر PowerShell يُفسَّر. الترميز يجعل النقل حرفيًّا لا مؤوَّلًا.
|
|
154
|
+
const script = [
|
|
155
|
+
`$value = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('${encoded}'))`,
|
|
156
|
+
`Set-ItemProperty -LiteralPath '${ENVIRONMENT_KEY}' -Name 'Path' -Value $value -Type ${kind}`,
|
|
157
|
+
].join("; ");
|
|
158
|
+
await powershell(script);
|
|
159
|
+
const broadcast = [
|
|
160
|
+
`$sig = '[DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)] public static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint Msg, UIntPtr wParam, string lParam, uint fuFlags, uint uTimeout, out UIntPtr lpdwResult);'`,
|
|
161
|
+
`$type = Add-Type -MemberDefinition $sig -Name 'FantasticEnv' -Namespace 'Win32' -PassThru`,
|
|
162
|
+
`$out = [UIntPtr]::Zero`,
|
|
163
|
+
`[void]$type::SendMessageTimeout([IntPtr]0xffff, 0x1A, [UIntPtr]::Zero, 'Environment', 2, 5000, [ref]$out)`,
|
|
164
|
+
].join("; ");
|
|
165
|
+
await powershell(broadcast).catch(() => undefined);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* AR: يترجم فشل الكتابة إلى سبب يُقرأ. **لا يُطبَع سطر الأوامر نفسه**: رسالة execa تحمل الأمر كاملًا،
|
|
169
|
+
* وفيه قيمة PATH مُرمَّزة بـbase64 — كيلوبايتان من نصّ لا يقرأه أحد يغرق فيها السبب الحقيقي، وهو
|
|
170
|
+
* في الغالب كلمة واحدة: لا صلاحيات.
|
|
171
|
+
* EN: Turns a write failure into a readable cause. **The command line itself is never printed**:
|
|
172
|
+
* execa's message carries the whole command, and in it the base64-encoded PATH — two kilobytes of
|
|
173
|
+
* text nobody reads, drowning the actual cause, which is usually one word: no rights.
|
|
174
|
+
*/
|
|
175
|
+
function describeFailure(error) {
|
|
176
|
+
const text = error instanceof Error ? error.message : String(error);
|
|
177
|
+
if (/denied|Requested registry access is not allowed|UnauthorizedAccess/i.test(text)) {
|
|
178
|
+
return "needs an administrator terminal";
|
|
179
|
+
}
|
|
180
|
+
if (/timed out|ETIMEDOUT/i.test(text))
|
|
181
|
+
return "the registry did not answer in time";
|
|
182
|
+
return "could not be written";
|
|
183
|
+
}
|
|
184
|
+
/** يحفظ القيمة غير المُوسَّعة قبل أي كتابة. الاسترجاع بعدها نسخٌ ولصق لا تخمين. */
|
|
185
|
+
function backup(logDir, value, action) {
|
|
186
|
+
mkdirSync(logDir, { recursive: true });
|
|
187
|
+
const path = join(logDir, "machine-path.backup.txt");
|
|
188
|
+
const stamp = new Date().toISOString();
|
|
189
|
+
writeFileSync(path, `# ${stamp} — before ${action}\r\n${value}\r\n`, "utf8");
|
|
190
|
+
return path;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* AR: **الفشل هنا لا يُسقط ما نجح.** الكتابة في HKLM تحتاج صلاحيات مسؤول، وقد لا تتوفّر — أو يمنعها
|
|
194
|
+
* دفاعٌ على الجهاز. والنظام حينها مثبَّتٌ ويعمل تمامًا، وكل ما فات هو اختصار كتابة مسار. رميُ
|
|
195
|
+
* الخطأ كان سيُطلق التراجع فيمحو تثبيتًا سليمًا لأجل راحة، وهذا أسوأ بكثير من رسالة صريحة.
|
|
196
|
+
* EN: **A failure here does not undo what succeeded.** Writing to `HKLM` needs administrator rights,
|
|
197
|
+
* which may be absent — or a security product may block it. The system at that point is installed
|
|
198
|
+
* and fully working, and all that was lost is not having to type a path. Throwing would trigger
|
|
199
|
+
* the rollback and erase a sound installation for a convenience, which is far worse than a plain
|
|
200
|
+
* message.
|
|
201
|
+
*/
|
|
202
|
+
async function change(entry, logDir, compute, labels) {
|
|
203
|
+
const current = await readMachinePath();
|
|
204
|
+
if (!current)
|
|
205
|
+
return { changed: false, detail: labels.unreadable };
|
|
206
|
+
const next = compute(current.raw);
|
|
207
|
+
if (next === null)
|
|
208
|
+
return { changed: false, detail: labels.unchanged };
|
|
209
|
+
let backupPath;
|
|
210
|
+
try {
|
|
211
|
+
backupPath = backup(logDir, current.raw, `${labels.action} ${entry}`);
|
|
212
|
+
await writeMachinePath(next, current.kind);
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
return { changed: false, detail: `${describeFailure(error)} — add ${entry} to PATH by hand`, backupPath };
|
|
216
|
+
}
|
|
217
|
+
return { changed: true, detail: labels.done, backupPath };
|
|
218
|
+
}
|
|
219
|
+
/** يُضيف مجلدًا إلى PATH الآلة إن لم يكن فيه. */
|
|
220
|
+
export function registerOnMachinePath(entry, logDir) {
|
|
221
|
+
return change(entry, logDir, (raw) => addToPath(raw, entry), {
|
|
222
|
+
unreadable: "machine PATH is unreadable — add the folder by hand",
|
|
223
|
+
unchanged: "already on PATH",
|
|
224
|
+
done: "added to the machine PATH",
|
|
225
|
+
action: "adding",
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/** يُزيل مجلدًا من PATH الآلة إن كان فيه. جهازٌ أُزيل عنه النظام لا يبقى فيه أثرٌ ميّت. */
|
|
229
|
+
export function unregisterFromMachinePath(entry, logDir) {
|
|
230
|
+
return change(entry, logDir, (raw) => removeFromPath(raw, entry), {
|
|
231
|
+
unreadable: "machine PATH is unreadable — remove the folder by hand",
|
|
232
|
+
unchanged: "was not on PATH",
|
|
233
|
+
done: "removed from the machine PATH",
|
|
234
|
+
action: "removing",
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=machine-path.js.map
|