drone-path 0.13.0 → 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.
Files changed (84) hide show
  1. package/README.md +20 -74
  2. package/THIRD-PARTY-NOTICES.md +3 -82
  3. package/bin/drone-path.mjs +0 -0
  4. package/dist/archive-cli.d.ts +1 -0
  5. package/dist/archive-cli.js +50 -0
  6. package/dist/archive-query-cli.d.ts +3 -0
  7. package/dist/archive-query-cli.js +128 -0
  8. package/dist/cli.d.ts +14 -0
  9. package/dist/cli.js +19 -12
  10. package/dist/version.d.ts +1 -0
  11. package/package.json +22 -68
  12. package/CHANGELOG.md +0 -349
  13. package/app/ipc.d.mts +0 -44
  14. package/app/ipc.mjs +0 -237
  15. package/app/main.mjs +0 -369
  16. package/app/preload.cjs +0 -36
  17. package/app/update-policy.d.mts +0 -6
  18. package/app/update-policy.mjs +0 -6
  19. package/app/update.d.mts +0 -10
  20. package/app/update.mjs +0 -54
  21. package/dist/appassets.js +0 -35
  22. package/dist/apppaths.js +0 -20
  23. package/dist/appsession.js +0 -121
  24. package/dist/appstate.js +0 -101
  25. package/dist/assets.js +0 -60
  26. package/dist/buildinfo.js +0 -64
  27. package/dist/cammeta-decode.js +0 -237
  28. package/dist/cammeta.js +0 -92
  29. package/dist/changeset-gate.js +0 -39
  30. package/dist/config.js +0 -631
  31. package/dist/configfile.js +0 -86
  32. package/dist/decimate.js +0 -84
  33. package/dist/desktop-i18n/generated/catalogs.js +0 -1230
  34. package/dist/desktop-i18n/messages.js +0 -47
  35. package/dist/errors.js +0 -34
  36. package/dist/exec-tool.js +0 -13
  37. package/dist/exportjob.js +0 -90
  38. package/dist/ffmpeg-tools.js +0 -56
  39. package/dist/ffmpeg.js +0 -98
  40. package/dist/frametime.js +0 -32
  41. package/dist/geo.js +0 -60
  42. package/dist/logging.js +0 -1
  43. package/dist/manual/anchors.js +0 -17
  44. package/dist/manual/build.js +0 -67
  45. package/dist/manual/cliref.js +0 -34
  46. package/dist/manual/links.js +0 -59
  47. package/dist/manual/markdown.js +0 -98
  48. package/dist/manual/model.js +0 -1
  49. package/dist/manual/module.js +0 -5
  50. package/dist/manual/nav.js +0 -11
  51. package/dist/manual/reference.js +0 -18
  52. package/dist/paths.js +0 -16
  53. package/dist/pipeline.js +0 -402
  54. package/dist/plan.js +0 -106
  55. package/dist/png.js +0 -32
  56. package/dist/protobuf-wire.js +0 -102
  57. package/dist/range.js +0 -50
  58. package/dist/recordings.js +0 -55
  59. package/dist/render-page.js +0 -85
  60. package/dist/render.js +0 -268
  61. package/dist/renderer/boot.js +0 -7
  62. package/dist/renderer/dom.js +0 -179
  63. package/dist/renderer/framemath.js +0 -30
  64. package/dist/renderer/scene.js +0 -388
  65. package/dist/renderer/theme.js +0 -82
  66. package/dist/renderer/tilesources.js +0 -38
  67. package/dist/renderer/trail.js +0 -42
  68. package/dist/restyle.js +0 -16
  69. package/dist/serve.js +0 -27
  70. package/dist/srt.js +0 -98
  71. package/dist/telemetry-json-schema.js +0 -18
  72. package/dist/telemetry-json.js +0 -126
  73. package/dist/telemetry-math.js +0 -267
  74. package/dist/telemetry-summary.js +0 -19
  75. package/dist/telemetry.js +0 -95
  76. package/dist/tilecache.js +0 -21
  77. package/dist/tiles.js +0 -155
  78. package/dist/track-format.js +0 -13
  79. package/dist/track-geojson.js +0 -44
  80. package/dist/track-gpx.js +0 -34
  81. package/dist/track-kml.js +0 -47
  82. package/dist/track-kmz.js +0 -68
  83. package/dist/track-write.js +0 -41
  84. package/dist/track.js +0 -79
package/README.md CHANGED
@@ -1,83 +1,29 @@
1
- > [!NOTE]
2
- > Head's up! This repo will be restructured as a monorepo in the near future.
1
+ # drone-path
3
2
 
4
- # Drone Path
5
-
6
- This handy little tool renders flight-path map videos from DJI drone
7
- recordings (DJI Neo 2 and similar): the actual flight path on a 2D map,
8
- ready to overlay over the drone recording.
9
-
10
- It reads geo-coordinates from DJI's telemetry in two ways:
11
-
12
- - the embedded CAM meta (DVTM) stream (DJI's protobuf format) is used when
13
- the recording has one,
14
- - otherwise an `.SRT` sidecar next to the recording is used.
15
-
16
- It is a CLI tool first, so agents can drive it too — that's all cool with me.
17
- For us humans, there is a [desktop app](docs/user/desktop-app.md): pick a
18
- recording and watch its flight path on the map in sync as you play.
19
-
20
- ## Quick start
3
+ Render a flight-path map overlay video from a DJI recording with CAM-meta
4
+ telemetry or a matching SRT sidecar. Use Node.js 24 or later.
21
5
 
22
6
  ```sh
23
- # from GitHub
24
- npx github:MrManny/drone-path "my-flight.mp4"
25
-
26
- # from npm
27
7
  npx drone-path "my-flight.mp4"
28
-
29
- # topographic map, altitude + speed HUD
30
- npx drone-path "my-flight.mp4" --style topo --hud heading,alt,speed
31
-
32
- # flight track file alongside the render (GPX, GeoJSON, KML/KMZ or the
33
- # telemetry JSON document, chosen by the extension; one recording per run)
34
- npx drone-path "my-flight.mp4" --track-out "my-flight.gpx"
8
+ npx drone-path --help
35
9
  ```
36
10
 
37
- Output lands in the `out/` folder as `<basename>_map.mp4`; both the folder
38
- and the name are configurable. Requirements: Node.js 24 or 26 and
39
- ffmpeg/ffprobe — bundled with the desktop app and the npm package,
40
- overridable via `--ffmpeg`/`--ffprobe`, with a `PATH` fallback. All
41
- requirements and install options are in
42
- [Getting started](docs/user/getting-started.md).
43
-
44
- ## User manual
11
+ By default, the command writes the overlay to `out/my-flight_map.mp4`.
12
+ See the [CLI guide](https://github.com/MrManny/drone-path/blob/main/docs/user/cli.md)
13
+ for configuration, rendering requirements, and track export.
45
14
 
46
- The user manual lives in [docs/user/](docs/user/README.md); the desktop app
47
- ships the same pages as offline help. Highlights:
15
+ The `drone-path` export provides typed CLI functions for Node.js. For
16
+ telemetry and rendering APIs, use `drone-path-core` and
17
+ `drone-path-engine`.
48
18
 
49
- - [Getting started](docs/user/getting-started.md) — requirements, install options, and your first render.
50
- - [Desktop app](docs/user/desktop-app.md) — loading a recording, reviewing a flight, exporting video, and saving telemetry JSON from the app.
51
- - [Keyboard shortcuts](docs/user/keyboard-shortcuts.md) — every shortcut of the review player at a glance.
52
- - [CLI usage](docs/user/cli.md) — inputs, examples, and example output.
53
- - [CLI and config reference](docs/user/cli-reference.md) — every option and config key with its default.
54
- - [Config file](docs/user/config-file.md) — where `.dronepath.json` is found and how defaults apply.
55
- - [Tiles and attribution](docs/user/tiles-and-attribution.md) — map sources, attribution, and tile caching.
19
+ Install `@types/node` for your Node.js major version. In TypeScript 6, list
20
+ `node` in `compilerOptions.types` to load the Node declarations.
56
21
 
57
- ## Desktop app
58
-
59
- For reviewing flights without the terminal, grab the packaged desktop app
60
- (Windows NSIS installer or portable exe, Linux AppImage) from
61
- [GitHub Releases](https://github.com/MrManny/drone-path/releases), or run
62
- `npm run build && npm run app` from a checkout.
63
-
64
- The app shows the recording and the synchronized flight map side by side —
65
- togglable to a corner map overlay — on one shared timeline;
66
- [the manual](docs/user/desktop-app.md) walks through loading a recording,
67
- reviewing a flight, marking a passage, exporting, and saving the per-frame
68
- telemetry JSON. The look and language settings carry over between launches.
69
-
70
- ![Desktop app: a drone recording beside the synchronized flight map](docs/images/app-main-window.jpg)
71
-
72
- *The desktop app playing a recording: the recording beside the synchronized
73
- flight map, with the flight trail, drone position and the readout strip on one
74
- shared timeline.*
75
-
76
- ## Feature requests
77
-
78
- If you want or need specific features, feel free to open an issue in this
79
- repository's issue tracker.
80
-
81
- ## License
82
-
83
- MIT — see [LICENSE](LICENSE).
22
+ ```json
23
+ {
24
+ "compilerOptions": {
25
+ "module": "NodeNext",
26
+ "types": ["node"]
27
+ }
28
+ }
29
+ ```
@@ -1,84 +1,5 @@
1
1
  # Third-party notices
2
2
 
3
- The UI icons render from the [Lucide](https://lucide.dev) icon set via the
4
- `lucide-react` npm package, a runtime dependency of the UI bundle; the
5
- package's own LICENSE file ships with every install. Lucide releases its icons
6
- under the ISC License below. Icons Lucide derives from the Feather project
7
- additionally carry the MIT License below — among the icons this app renders,
8
- `x`, `power`, `info` and `help-circle` are Feather-derived. `ui/icons/` holds
9
- only the GitHub brand mark; see its note below.
10
-
11
- ## Lucide — ISC License
12
-
13
- Copyright (c) 2026 Lucide Icons and Contributors
14
-
15
- Permission to use, copy, modify, and/or distribute this software for any
16
- purpose with or without fee is hereby granted, provided that the above
17
- copyright notice and this permission notice appear in all copies.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
20
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
21
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
23
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
25
- PERFORMANCE OF THIS SOFTWARE.
26
-
27
- ## Feather (icons derived from it) — MIT License
28
-
29
- Copyright (c) 2013-present Cole Bemis
30
-
31
- Permission is hereby granted, free of charge, to any person obtaining a copy
32
- of this software and associated documentation files (the "Software"), to deal
33
- in the Software without restriction, including without limitation the rights
34
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35
- copies of the Software, and to permit persons to whom the Software is
36
- furnished to do so, subject to the following conditions:
37
-
38
- The above copyright notice and this permission notice shall be included in all
39
- copies or substantial portions of the Software.
40
-
41
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47
- SOFTWARE.
48
-
49
- ## FFmpeg and FFprobe (embedded binaries) — GPL-3.0-or-later
50
-
51
- The desktop app distributions and the npm package may carry static `ffmpeg`
52
- and `ffprobe` binaries so renders need no local install. They are the FFmpeg
53
- and ffprobe 7.1.0 builds downloaded by the `ffmpeg-ffprobe-static` optional
54
- dependency from release `b7.1.0-rc.1` of
55
- https://github.com/descriptinc/ffmpeg-ffprobe-static and are spawned as
56
- separate processes; x264/x265 make these GPL-3.0-or-later builds.
57
-
58
- Build provenance and corresponding source per platform:
59
-
60
- - Windows x64: the gyan.dev `ffmpeg-release-essentials` 7.1 build
61
- (`7.1-essentials_build-www.gyan.dev`), compiled from the FFmpeg 7.1
62
- release — the corresponding source is
63
- https://ffmpeg.org/releases/ffmpeg-7.1.tar.xz, also tagged `n7.1` at
64
- https://github.com/FFmpeg/FFmpeg.
65
- - Linux x64: the BtbN/FFmpeg-Builds autobuild
66
- `ffmpeg-n7.1-15-g9fbbd924f2-linux64-gpl-7.1`, a git snapshot 15 commits past
67
- the `n7.1` tag — the corresponding source is FFmpeg commit `9fbbd924f2`
68
- (https://github.com/FFmpeg/FFmpeg/commit/9fbbd924f2), not the 7.1 release
69
- tarball.
70
-
71
- The full GPL license text ships with every distribution: `ff/ffmpeg.LICENSE`
72
- (`ff/ffmpeg.exe.LICENSE` on Windows) next to the binaries in the desktop app,
73
- and `ffmpeg.LICENSE` (`ffmpeg.exe.LICENSE` on Windows) next to the binaries in
74
- the npm install. The `ffmpeg-ffprobe-static` wrapper code itself is not part of
75
- the desktop distribution; its LICENSE file is BSD-3-Clause (Copyright (c) 2020,
76
- Eugene Ware and contributors) while its npm metadata declares
77
- GPL-3.0-or-later.
78
-
79
- ## GitHub mark
80
-
81
- `ui/icons/GitHubIcon.tsx` draws the GitHub octocat mark, used nominatively and
82
- solely to link to the project's own GitHub repository from the About dialog.
83
- The mark is a trademark of GitHub, Inc.; this use implies no affiliation with
84
- or endorsement by GitHub.
3
+ Commander is licensed under MIT and includes its license text in its npm
4
+ package. See the notices shipped with `drone-path-core` and
5
+ `drone-path-engine` for the telemetry and rendering dependencies.
File without changes
@@ -0,0 +1 @@
1
+ export declare function runArchive(argv: string[]): Promise<void>;
@@ -0,0 +1,50 @@
1
+ import fs from 'node:fs';
2
+ import { Command } from 'commander';
3
+ import { scanArchive } from 'drone-path-archive/indexed-scan';
4
+ import { archiveDbPath } from 'drone-path-archive/paths';
5
+ import { requireFfmpegTools } from 'drone-path-core/ffmpeg';
6
+ import { resolveFfmpegTools } from 'drone-path-core/ffmpeg-tools';
7
+ import { addArchiveQueries, archiveCommand } from './archive-query-cli.js';
8
+ export async function runArchive(argv) {
9
+ const program = new Command('drone-path archive')
10
+ .description('Inspect a library of drone recordings.')
11
+ .exitOverride();
12
+ const scan = archiveCommand(program.command('scan'))
13
+ .description('Scan folders for drone recordings.')
14
+ .argument('<dirs...>', 'folders to scan for recordings')
15
+ .option('--recurse', 'include subfolders')
16
+ .option('--prune', 'remove missing recordings from the index')
17
+ .option('--json', 'write one JSON record per clip to stdout')
18
+ .action(async (dirs) => {
19
+ const { recurse, json, archiveDb, prune } = scan.opts();
20
+ const controller = new AbortController();
21
+ const interrupt = () => controller.abort(new Error('archive scan canceled'));
22
+ process.on('SIGINT', interrupt);
23
+ try {
24
+ const records = await scanArchive(dirs, {
25
+ db: archiveDbPath(archiveDb), recurse, prune, signal: controller.signal,
26
+ getTools: async () => {
27
+ const tools = resolveFfmpegTools({ ffmpeg: null, ffprobe: null });
28
+ await requireFfmpegTools(tools, controller.signal);
29
+ return tools;
30
+ },
31
+ onRecord: (record) => {
32
+ process.stderr.write(`[drone-path] ${record.status}: ${record.path}\n`);
33
+ },
34
+ });
35
+ if (json)
36
+ for (const record of records)
37
+ fs.writeSync(1, JSON.stringify(record) + '\n');
38
+ process.stderr.write(`[drone-path] scanned ${records.length} recording(s)\n`);
39
+ }
40
+ catch (error) {
41
+ controller.signal.throwIfAborted();
42
+ throw error;
43
+ }
44
+ finally {
45
+ process.off('SIGINT', interrupt);
46
+ }
47
+ });
48
+ addArchiveQueries(program);
49
+ await program.parseAsync(argv, { from: 'user' });
50
+ }
@@ -0,0 +1,3 @@
1
+ import type { Command } from 'commander';
2
+ export declare function archiveCommand(command: Command): Command;
3
+ export declare function addArchiveQueries(program: Command): void;
@@ -0,0 +1,128 @@
1
+ import { Option } from 'commander';
2
+ import { exportArchiveMap, exportArchiveTracks } from 'drone-path-archive/export';
3
+ import { archiveDbPath } from 'drone-path-archive/paths';
4
+ import { DEFAULT_RADIUS_M, listArchive, listArchiveFlights, nearArchive, parseDateBound } from 'drone-path-archive/query';
5
+ function decimal(text) {
6
+ const value = text.trim();
7
+ return /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/iu.test(value) ? Number(value) : NaN;
8
+ }
9
+ function meters(text) {
10
+ const value = decimal(text);
11
+ if (!Number.isFinite(value) || value < 0)
12
+ throw new Error('expected a nonnegative distance in meters');
13
+ return value;
14
+ }
15
+ function availability(text) {
16
+ if (text !== 'online' && text !== 'offline')
17
+ throw new Error('expected online or offline status');
18
+ return text;
19
+ }
20
+ function point(text) {
21
+ const [lat, lon, extra] = text.split(',').map(decimal);
22
+ if (!(Math.abs(lat) <= 90 && Math.abs(lon) <= 180) || extra !== undefined) {
23
+ throw new Error('expected a latitude,longitude pair within ±90 and ±180 degrees');
24
+ }
25
+ return { lat, lon };
26
+ }
27
+ function bbox(text) {
28
+ const parts = text.split(',');
29
+ if (parts.length !== 4)
30
+ throw new Error('expected a bounding box as south,west,north,east');
31
+ const southWest = point(parts.slice(0, 2).join(','));
32
+ const northEast = point(parts.slice(2).join(','));
33
+ if (southWest.lat > northEast.lat)
34
+ throw new Error('expected south latitude at or below north latitude');
35
+ return { minLat: southWest.lat, minLon: southWest.lon, maxLat: northEast.lat, maxLon: northEast.lon };
36
+ }
37
+ function writeJson(value) {
38
+ process.stdout.write(JSON.stringify(value) + '\n');
39
+ }
40
+ function listOptions(options) {
41
+ const { inBbox, after, before, minDist, status } = options;
42
+ if (after !== undefined && before !== undefined && after > before) {
43
+ throw new Error('expected --after at or before --before');
44
+ }
45
+ return { bbox: inBbox, afterMs: after, beforeMs: before, minDistanceM: minDist, availability: status };
46
+ }
47
+ export function archiveCommand(command) {
48
+ return command
49
+ .option('--archive-db <path>', 'override the per-user archive database path')
50
+ .exitOverride();
51
+ }
52
+ function queryOptions(command) {
53
+ return archiveCommand(command).option('--json', 'write a JSON array to stdout');
54
+ }
55
+ function listFilters(command) {
56
+ return command.option('--in-bbox <s,w,n,e>', 'filter clips by a viewport bounding box', bbox)
57
+ .option('--after <date>', 'earliest camera date or timestamp, inclusive', parseDateBound)
58
+ .option('--before <date>', 'latest camera date or timestamp, exclusive', parseDateBound)
59
+ .option('--min-dist <m>', 'minimum track distance in meters', meters)
60
+ .option('--status <state>', 'filter by online or offline availability', availability);
61
+ }
62
+ function exportOptions(command) {
63
+ return archiveCommand(listFilters(command))
64
+ .option('--redact-launch <m>', 'exclude geometry near the first and last indexed fix of each flight', meters);
65
+ }
66
+ export function addArchiveQueries(program) {
67
+ listFilters(queryOptions(program.command('list').description('List indexed recordings.')))
68
+ .addOption(new Option('--group-by <kind>', 'group matching clips into flights').choices(['flight']))
69
+ .action((options) => {
70
+ const db = archiveDbPath(options.archiveDb);
71
+ const filters = listOptions(options);
72
+ if (options.groupBy === 'flight') {
73
+ const flights = listArchiveFlights(db, filters);
74
+ if (options.json)
75
+ writeJson(flights);
76
+ else
77
+ for (const { flightId, clips } of flights) {
78
+ process.stdout.write(`Flight ${flightId}\n`);
79
+ for (const clip of clips) {
80
+ const continuation = clip.splitFromKey === null ? '' : ' (split continuation)';
81
+ process.stdout.write(` [${clip.availability}] ${clip.path}${continuation}\n`);
82
+ }
83
+ }
84
+ return;
85
+ }
86
+ const clips = listArchive(db, filters);
87
+ if (options.json)
88
+ writeJson(clips);
89
+ else
90
+ for (const clip of clips)
91
+ process.stdout.write(`[${clip.availability}] ${clip.path}\n`);
92
+ });
93
+ queryOptions(program.command('near'))
94
+ .description('Find where indexed recordings pass near a location.')
95
+ // Commander treats a negative coordinate pair as an option, but the
96
+ // required argument parser still rejects anything besides a coordinate.
97
+ .allowUnknownOption()
98
+ .argument('<lat,lon>', 'query latitude and longitude', point)
99
+ .option('--radius <m>', 'search radius in meters', meters, DEFAULT_RADIUS_M)
100
+ .option('--include-gaze', 'also match points inside estimated camera ground footprints')
101
+ .action((location, options) => {
102
+ const hits = nearArchive(archiveDbPath(options.archiveDb), location, options.radius, options.includeGaze);
103
+ if (options.json)
104
+ writeJson(hits);
105
+ else
106
+ for (const hit of hits) {
107
+ const label = hit.matchType === 'gaze' ? 'in camera view' : `${hit.distanceM.toFixed(1)} m`;
108
+ process.stdout.write(`${label} at ${hit.tSec.toFixed(2)} s [${hit.clip.availability}] ${hit.clip.path}\n`);
109
+ }
110
+ });
111
+ exportOptions(program.command('export-map'))
112
+ .description('Write a standalone HTML map of matching flights.')
113
+ .argument('<out.html>', 'output HTML file')
114
+ .option('--include-gaze', 'show estimated camera ground footprints')
115
+ .action((output, options) => {
116
+ exportArchiveMap(archiveDbPath(options.archiveDb), output, {
117
+ filters: listOptions(options), redactLaunchM: options.redactLaunch, includeGaze: options.includeGaze,
118
+ });
119
+ });
120
+ exportOptions(program.command('export-tracks'))
121
+ .description('Write matching flight tracks in GPX, GeoJSON, KML, or KMZ format.')
122
+ .argument('<out>', 'output .gpx, .geojson, .kml, or .kmz file')
123
+ .action((output, options) => {
124
+ exportArchiveTracks(archiveDbPath(options.archiveDb), output, {
125
+ filters: listOptions(options), redactLaunchM: options.redactLaunch,
126
+ });
127
+ });
128
+ }
package/dist/cli.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { Command } from 'commander';
2
+ import type { ConfigOverrides, TrackOutSpelling } from 'drone-path-engine/config';
3
+ interface ParsedCli {
4
+ inputs: string[];
5
+ cli: ConfigOverrides;
6
+ trackOutSpelling: TrackOutSpelling | null;
7
+ configPath: string | null;
8
+ deprecationWarnings: string[];
9
+ }
10
+ export declare function buildProgram(): Command;
11
+ export declare function longFlagOf(flags: string): string;
12
+ export declare function parseCliArgs(argv: string[]): ParsedCli;
13
+ export declare function main(argv?: string[]): Promise<void>;
14
+ export {};
package/dist/cli.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import fs from 'node:fs';
2
2
  import { Command, Option } from 'commander';
3
- import { ERROR_PREFIX, errorMessage } from './errors.js';
3
+ import { ERROR_PREFIX, errorMessage } from 'drone-path-core/errors';
4
+ import { runArchive } from './archive-cli.js';
4
5
  import { VERSION } from './version.js';
5
- import { CONFIG_FILE_OPTION, CONFIG_OPTIONS, OVERRIDE_NORMALIZERS, TELEMETRY_JSON_ALIAS, cliDefaultOf, } from './config.js';
6
- import { resolveConfig } from './configfile.js';
7
- import { collectRecordings } from './recordings.js';
8
- import { requireFfmpegTools } from './ffmpeg.js';
9
- import { resolveFfmpegTools } from './ffmpeg-tools.js';
10
- import { runBatch } from './pipeline.js';
6
+ import { CONFIG_FILE_OPTION, CONFIG_OPTIONS, OVERRIDE_NORMALIZERS, TELEMETRY_JSON_ALIAS, cliDefaultOf, } from 'drone-path-engine/config';
7
+ import { resolveConfig } from 'drone-path-engine/configfile';
8
+ import { collectRecordings } from 'drone-path-engine/recordings';
9
+ import { requireFfmpegTools } from 'drone-path-core/ffmpeg';
10
+ import { resolveFfmpegTools } from 'drone-path-core/ffmpeg-tools';
11
+ import { runBatch } from 'drone-path-engine/pipeline';
11
12
  export function buildProgram() {
12
13
  const program = new Command();
13
14
  program
@@ -28,7 +29,7 @@ export function buildProgram() {
28
29
  }
29
30
  program.addOption(new Option(TELEMETRY_JSON_ALIAS.flags, TELEMETRY_JSON_ALIAS.help));
30
31
  program.option(CONFIG_FILE_OPTION.flags, CONFIG_FILE_OPTION.help);
31
- return program;
32
+ return program.addHelpText('after', '\nLibrary inventory: drone-path archive scan --help');
32
33
  }
33
34
  function givenOnCommandLine(program, name) {
34
35
  return program.getOptionValueSource(name) === 'cli';
@@ -47,18 +48,20 @@ function collectOverrides(program, onDeprecated) {
47
48
  const raw = row.cli.parse ? row.cli.parse(opts[row.key]) : opts[row.key];
48
49
  Object.assign(cli, row.normalize(raw, flag));
49
50
  }
51
+ const hasAlias = givenOnCommandLine(program, TELEMETRY_JSON_ALIAS.inputKey);
52
+ const hasCanonical = givenOnCommandLine(program, TELEMETRY_JSON_ALIAS.key);
50
53
  // The deprecated alias lands on the same trackOut override key; both
51
54
  // spellings at once is ambiguous and rejected.
52
- if (givenOnCommandLine(program, TELEMETRY_JSON_ALIAS.inputKey)) {
53
- if (givenOnCommandLine(program, TELEMETRY_JSON_ALIAS.key)) {
55
+ if (hasAlias) {
56
+ if (hasCanonical) {
54
57
  throw new Error(`${longFlagOf(TELEMETRY_JSON_ALIAS.flags)} and --track-out cannot be combined (use --track-out)`);
55
58
  }
56
59
  onDeprecated(TELEMETRY_JSON_ALIAS.cliWarning);
57
60
  Object.assign(cli, OVERRIDE_NORMALIZERS.trackOut(opts[TELEMETRY_JSON_ALIAS.inputKey], longFlagOf(TELEMETRY_JSON_ALIAS.flags)));
58
61
  }
59
- const trackOutSpelling = givenOnCommandLine(program, TELEMETRY_JSON_ALIAS.inputKey)
62
+ const trackOutSpelling = hasAlias
60
63
  ? 'telemetry-json'
61
- : givenOnCommandLine(program, TELEMETRY_JSON_ALIAS.key)
64
+ : hasCanonical
62
65
  ? 'track-out'
63
66
  : null;
64
67
  return { cli, trackOutSpelling };
@@ -130,6 +133,10 @@ async function runPipeline(invocation, log) {
130
133
  }
131
134
  export async function main(argv = process.argv) {
132
135
  try {
136
+ if (argv[2] === 'archive') {
137
+ await runArchive(argv.slice(3));
138
+ return;
139
+ }
133
140
  const invocation = resolveInvocation(argv);
134
141
  // Deprecation warnings are not progress output: they print even with --quiet.
135
142
  for (const warning of invocation.deprecationWarnings) {
@@ -0,0 +1 @@
1
+ export declare const VERSION: string;
package/package.json CHANGED
@@ -1,42 +1,20 @@
1
1
  {
2
2
  "name": "drone-path",
3
- "version": "0.13.0",
3
+ "version": "1.0.0",
4
4
  "description": "Render flight-path map overlay videos (exactly the source frame rate and frame count) from DJI drone recordings - telemetry from the embedded CAM-meta (DVTM) stream or the .SRT sidecar.",
5
5
  "type": "module",
6
- "main": "app/main.mjs",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/cli.d.ts",
9
+ "default": "./dist/cli.js"
10
+ }
11
+ },
7
12
  "bin": {
8
13
  "drone-path": "bin/drone-path.mjs"
9
14
  },
10
- "files": [
11
- "app",
12
- "bin",
13
- "dist",
14
- "CHANGELOG.md",
15
- "README.md",
16
- "LICENSE",
17
- "THIRD-PARTY-NOTICES.md"
18
- ],
19
15
  "engines": {
20
16
  "node": ">=24"
21
17
  },
22
- "scripts": {
23
- "app": "electron app/main.mjs",
24
- "app:dev": "npm run build:manual && npm run build:info && concurrently -k \"next dev ui --webpack -p 3210\" \"wait-on http://127.0.0.1:3210 && electron app/main.mjs --dev-url http://localhost:3210\"",
25
- "app:pack": "electron-builder --publish never",
26
- "build": "npm run build:manual && npm run build:info && npm run build:ui",
27
- "build:cli": "node scripts/build-desktop-catalogs.mjs && tsc -p tsconfig.json",
28
- "build:info": "npm run build:cli && node dist/buildinfo.js",
29
- "build:manual": "npm run build:cli && node dist/manual/build.js",
30
- "build:ui": "next build ui --webpack",
31
- "docs:reference": "npm run build:cli && node dist/manual/reference.js",
32
- "docs:schema": "npm run build:cli && node dist/telemetry-json-schema.js",
33
- "changeset": "changeset",
34
- "changeset:version": "changeset version && npm install --package-lock-only",
35
- "test": "npm run build:manual && npm run build:info && npm run typecheck:test && vitest run",
36
- "typecheck:test": "tsc --noEmit -p test/tsconfig.json",
37
- "lint": "eslint .",
38
- "prepare": "npm run build"
39
- },
40
18
  "keywords": [
41
19
  "dji",
42
20
  "drone",
@@ -54,51 +32,27 @@
54
32
  "license": "MIT",
55
33
  "repository": {
56
34
  "type": "git",
57
- "url": "git+https://github.com/MrManny/drone-path.git"
35
+ "url": "git+https://github.com/MrManny/drone-path.git",
36
+ "directory": "packages/cli"
58
37
  },
59
38
  "bugs": {
60
39
  "url": "https://github.com/MrManny/drone-path/issues"
61
40
  },
62
41
  "homepage": "https://github.com/MrManny/drone-path#readme",
42
+ "files": [
43
+ "bin/drone-path.mjs",
44
+ "dist/**/*.js",
45
+ "dist/**/*.d.ts",
46
+ "THIRD-PARTY-NOTICES.md"
47
+ ],
48
+ "scripts": {
49
+ "build": "node ../../scripts/clean-package-dist.mjs && tsc -p tsconfig.json",
50
+ "prepack": "npm run build:cli --prefix ../.."
51
+ },
63
52
  "dependencies": {
64
53
  "commander": "~15.1.0",
65
- "electron-updater": "~6.8.11",
66
- "leaflet": "~1.9.4",
67
- "p-queue": "~10.0.0",
68
- "playwright-core": "~1.65.0",
69
- "zod": "~4.6.7"
70
- },
71
- "optionalDependencies": {
72
- "ffmpeg-ffprobe-static": "~7.1.0-rc.1"
73
- },
74
- "devDependencies": {
75
- "@changesets/cli": "~3.0.3",
76
- "@eslint/js": "~10.0.1",
77
- "@next/eslint-plugin-next": "~16.4.6",
78
- "@testing-library/react": "~16.3.3",
79
- "@testing-library/user-event": "~14.6.10",
80
- "@types/leaflet": "~1.9.22",
81
- "@types/node": "~24.19.2",
82
- "@types/react": "~19.3.0",
83
- "@types/react-dom": "~19.3.0",
84
- "concurrently": "~10.0.7",
85
- "electron": "~45.3.1",
86
- "electron-builder": "~26.18.0",
87
- "eslint": "~10.15.0",
88
- "eslint-plugin-react-hooks": "~7.1.1",
89
- "jsdom": "~31.0.1",
90
- "lucide-react": "~1.73.0",
91
- "marked": "~18.2.0",
92
- "next": "~16.4.6",
93
- "react": "~19.3.1",
94
- "react-dom": "~19.3.1",
95
- "typescript": "~6.0.3",
96
- "typescript-eslint": "~8.72.2",
97
- "vitest": "~5.1.0",
98
- "wait-on": "~9.5.1"
99
- },
100
- "allowScripts": {
101
- "electron-winstaller@5.4.0": true,
102
- "ffmpeg-ffprobe-static@7.1.0-rc.1": true
54
+ "drone-path-archive": "~1.0.0",
55
+ "drone-path-core": "~1.0.0",
56
+ "drone-path-engine": "~1.0.0"
103
57
  }
104
58
  }