@alpefe/ozure 0.0.0-stage → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +31 -3
  2. package/bin/ozure.js +72 -0
  3. package/package.json +44 -6
package/README.md CHANGED
@@ -1,3 +1,31 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # ozure
2
+
3
+ Read, edit and install **Fujifilm custom recipes (C1–C7)** over USB PTP, from
4
+ the terminal. Ships 126 curated recipes (Fuji X Weekly, Osan-Bilgi, Alex
5
+ Armitage, …) and keeps the same safety rails as the Python package: dry run by
6
+ default, backup before writing, read-back verification.
7
+
8
+ ```bash
9
+ npm install -g ozure
10
+
11
+ ozure connect # find the camera, list the seven slots
12
+ ozure list # what is loaded right now
13
+ ozure catalogs # what could be installed
14
+ ozure apply kodak-gold-200 --slot C6 # dry run: shows the diff, exit 10
15
+ ozure apply kodak-gold-200 --slot C6 --yes # writes, re-reads and verifies
16
+ ozure catalog export # save the camera's recipes into your own catalog
17
+ ```
18
+
19
+ On the camera, pick **USB RAW CONV./BACKUP RESTORE**. Windows needs WinUSB on
20
+ the PTP interface (Zadig, vendor id `04CB`); Linux may need a udev rule.
21
+
22
+ No camera? `ozure connect --mock` runs against a simulated body.
23
+
24
+ The npm package is a thin launcher: it runs the prebuilt binary for your
25
+ platform (`ozure-<platform>-<arch>`). If that binary is missing and you
26
+ already have the Python package, it falls back to `python -m ozure`.
27
+
28
+ Docs, schema, protocol notes and the agent skill:
29
+ [github.com/AlPeFe/ozure](https://github.com/AlPeFe/ozure).
30
+
31
+ MIT.
package/bin/ozure.js ADDED
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env node
2
+ // ozure launcher: prefer the prebuilt binary that matches this platform,
3
+ // otherwise fall back to a local Python install of the same version.
4
+ 'use strict';
5
+
6
+ const { spawnSync } = require('node:child_process');
7
+ const fs = require('node:fs');
8
+ const path = require('node:path');
9
+
10
+ const PLATFORM = `${process.platform}-${process.arch}`;
11
+ const BINARY = process.platform === 'win32' ? 'ozure.exe' : 'ozure';
12
+ // Stamped by tools/build_npm.py: the launcher package name, scoped or not.
13
+ const PACKAGE_NAME = "@alpefe/ozure";
14
+ const PLATFORM_PACKAGE = process.env.OZURE_NPM_PACKAGE || `${PACKAGE_NAME}-${PLATFORM}`;
15
+ const args = process.argv.slice(2);
16
+
17
+ function bundledBinary() {
18
+ try {
19
+ const manifest = require.resolve(`${PLATFORM_PACKAGE}/package.json`);
20
+ const candidate = path.join(path.dirname(manifest), 'bin', BINARY);
21
+ return fs.existsSync(candidate) ? candidate : null;
22
+ } catch {
23
+ return null;
24
+ }
25
+ }
26
+
27
+ function pythonModule() {
28
+ for (const candidate of ['python3', 'python', 'py']) {
29
+ const probe = spawnSync(candidate, ['-m', 'ozure', '--version'], {
30
+ stdio: 'ignore',
31
+ shell: false,
32
+ });
33
+ if (probe.status === 0) return candidate;
34
+ }
35
+ return null;
36
+ }
37
+
38
+ function run(command, commandArgs) {
39
+ const result = spawnSync(command, commandArgs, { stdio: 'inherit', shell: false });
40
+ if (result.error) {
41
+ console.error(`ozure: ${result.error.message}`);
42
+ process.exit(1);
43
+ }
44
+ if (result.signal) {
45
+ process.kill(process.pid, result.signal);
46
+ return;
47
+ }
48
+ process.exit(result.status === null ? 1 : result.status);
49
+ }
50
+
51
+ const binary = bundledBinary();
52
+ if (binary) {
53
+ run(binary, args);
54
+ }
55
+
56
+ const python = pythonModule();
57
+ if (python) {
58
+ run(python, ['-m', 'ozure', ...args]);
59
+ }
60
+
61
+ console.error(
62
+ [
63
+ `ozure: no binary for ${PLATFORM} and no local Python install.`,
64
+ '',
65
+ ' npm: npm install -g ozure (binaries ship per platform)',
66
+ ' python: pipx install "ozure[usb]"',
67
+ '',
68
+ 'On macOS/Linux the prebuilt binary comes from the GitHub Releases page:',
69
+ ' https://github.com/AlPeFe/ozure/releases',
70
+ ].join('\n'),
71
+ );
72
+ process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
- {
2
- "name": "@alpefe/ozure",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {
2
+ "name": "@alpefe/ozure",
3
+ "version": "0.2.1",
4
+ "description": "Fujifilm custom recipes over USB PTP: read, edit and install C1-C7, with 126 recipes bundled",
5
+ "keywords": [
6
+ "fujifilm",
7
+ "fuji",
8
+ "x100vi",
9
+ "recipes",
10
+ "film-simulation",
11
+ "ptp",
12
+ "camera",
13
+ "cli",
14
+ "agent-skill"
15
+ ],
16
+ "homepage": "https://github.com/AlPeFe/ozure",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/AlPeFe/ozure.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/AlPeFe/ozure/issues"
23
+ },
24
+ "license": "MIT",
25
+ "author": "Alex P\u00e9rez Fern\u00e1ndez",
26
+ "bin": {
27
+ "ozure": "bin/ozure.js"
28
+ },
29
+ "files": [
30
+ "bin/ozure.js",
31
+ "README.md"
32
+ ],
33
+ "engines": {
34
+ "node": ">=16"
35
+ },
36
+ "optionalDependencies": {
37
+ "@alpefe/ozure-win32-x64": "0.2.1",
38
+ "@alpefe/ozure-win32-arm64": "0.2.1",
39
+ "@alpefe/ozure-darwin-arm64": "0.2.1",
40
+ "@alpefe/ozure-darwin-x64": "0.2.1",
41
+ "@alpefe/ozure-linux-x64": "0.2.1",
42
+ "@alpefe/ozure-linux-arm64": "0.2.1"
43
+ }
44
+ }