@hasna/recordings 0.4.0 → 0.5.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 (58) hide show
  1. package/README.md +56 -6
  2. package/contracts/v1/fixtures.json +1206 -0
  3. package/dist/cli/index.js +28 -7
  4. package/dist/contracts/hosted-v1.d.ts +105 -0
  5. package/dist/contracts/hosted-v1.d.ts.map +1 -0
  6. package/dist/contracts/hosted-v1.js +41 -0
  7. package/dist/contracts/stream-v1.d.ts +117 -0
  8. package/dist/contracts/stream-v1.d.ts.map +1 -0
  9. package/dist/contracts/stream-v1.js +35 -0
  10. package/dist/hosted/index.d.ts +58 -0
  11. package/dist/hosted/index.d.ts.map +1 -0
  12. package/dist/hosted/index.js +266 -0
  13. package/dist/hosted/transport.d.ts +36 -0
  14. package/dist/hosted/transport.d.ts.map +1 -0
  15. package/dist/hosted-v1-aavn7ktb.js +4114 -0
  16. package/dist/hosted-v1-gdr9extc.js +84 -0
  17. package/dist/index.js +27 -6
  18. package/dist/mcp/index.js +27 -6
  19. package/dist/server/index.js +27 -6
  20. package/dist/storage.js +27 -6
  21. package/docs/hosted-sdk.md +71 -0
  22. package/docs/wire-contracts.md +24 -0
  23. package/package.json +27 -6
  24. package/scripts/ci-linux-suite.ts +23 -13
  25. package/scripts/macos_artifact.ts +40 -33
  26. package/scripts/native/prebuilds/darwin-universal/recordings_fs_guard.node +0 -0
  27. package/scripts/native/recordings_fs_guard.c +36 -4
  28. package/scripts/native-core-receipt.py +171 -0
  29. package/scripts/native_fs_guard.ts +2 -0
  30. package/scripts/release-suite-gate.ts +227 -150
  31. package/scripts/resolve_tailscale_cli.sh +24 -3
  32. package/src/native/Recordings/RecordingsLib/BlockingOperation.swift +29 -0
  33. package/src/native/Recordings/RecordingsLib/Info.plist +2 -2
  34. package/src/native/Recordings/RecordingsLib/ProjectStore.swift +4 -4
  35. package/src/native/Recordings/RecordingsLib/RecordingEngine.swift +228 -60
  36. package/src/native/Recordings/RecordingsLib/RecordingPasteTarget.swift +114 -0
  37. package/src/native/Recordings/RecordingsLib/RecordingProvider.swift +13 -3
  38. package/src/native/Recordings/RecordingsTests/BlockingOperationTests.swift +85 -0
  39. package/src/native/Recordings/RecordingsTests/CLIRunnerTests.swift +441 -72
  40. package/src/native/Recordings/RecordingsTests/PipeClosureFixture.swift +215 -0
  41. package/src/native/Recordings/RecordingsTests/ProjectStoreTests.swift +10 -10
  42. package/src/native/Recordings/RecordingsTests/RecordingEngineDeliveryTests.swift +1 -1
  43. package/src/native/Recordings/RecordingsTests/RecordingFrozenPasteTargetTests.swift +50 -0
  44. package/src/native/Recordings/RecordingsTests/RecordingPasteTargetTrackerTests.swift +48 -0
  45. package/src/native/Recordings/RecordingsTests/RecordingProviderTests.swift +115 -2
  46. package/src/native/Recordings/RecordingsTests/RecordingStartTimingTests.swift +93 -21
  47. package/src/native/Recordings/RecordingsTests/TestHomeDirectory.swift +5 -1
  48. package/src/native/Recordings/build.sh +2 -1
  49. package/dist/__tests__/helpers/installer-guard-execution.d.ts +0 -22
  50. package/dist/__tests__/helpers/installer-guard-execution.d.ts.map +0 -1
  51. package/dist/__tests__/helpers/installer-preflight.d.ts +0 -22
  52. package/dist/__tests__/helpers/installer-preflight.d.ts.map +0 -1
  53. package/dist/__tests__/helpers/native-fs-guard.d.ts +0 -2
  54. package/dist/__tests__/helpers/native-fs-guard.d.ts.map +0 -1
  55. package/dist/__tests__/helpers/source-assertions.d.ts +0 -171
  56. package/dist/__tests__/helpers/source-assertions.d.ts.map +0 -1
  57. package/dist/__tests__/preload.d.ts +0 -2
  58. package/dist/__tests__/preload.d.ts.map +0 -1
package/README.md CHANGED
@@ -622,17 +622,18 @@ only when post-processing actually produced enhanced output.
622
622
 
623
623
  ## Releasing
624
624
 
625
- The release version is hand-maintained in four places: `package.json`, `src/version.ts`, and both
626
- `CFBundleShortVersionString` and `CFBundleVersion` in
627
- `src/native/Recordings/RecordingsLib/Info.plist`. Bump them together, never by hand:
625
+ Apply the applicable Changesets in a release worktree first. `package.json` is
626
+ the version authority; `src/version.ts` derives its value at runtime. Synchronize
627
+ both native bundle version fields in `src/native/Recordings/RecordingsLib/Info.plist`
628
+ and regenerate the SDK after the Changesets bump:
628
629
 
629
630
  ```bash
630
- bun run version:set 0.3.0 # rewrites every hand-maintained site
631
+ bun run version:set 0.4.0 # use the version selected by Changesets
631
632
  bun run generate:sdk # restamps the generated SDK's header
632
633
  bun run version:check # exits 1 if any site disagrees with package.json
633
634
  ```
634
635
 
635
- A fifth copy is **generated**, not written: `src/server/openapi.ts` stamps `VERSION` into the
636
+ The SDK version stamp is **generated**, not written: `src/server/openapi.ts` stamps `VERSION` into the
636
637
  OpenAPI document and `bun run generate:sdk` bakes it into the `// Source: …` header of
637
638
  `src/sdk/v1.generated.ts`. `version:set` leaves that file alone — the generator owns it, and
638
639
  patching the stamp by hand would hide real regeneration drift — so regenerate after every bump.
@@ -650,7 +651,7 @@ suite on every push through the turbo `build-test` job (this app's `test` script
650
651
  what makes the two guards below actually block a branch rather than wait for someone to run
651
652
  them locally. `prepack` runs `build:native-fs-guard` first (the
652
653
  fail-closed macOS gate), then `version:check`, so a partial bump stops before the build
653
- rather than deep inside it. And `prepublishOnly` runs `bun test`, which covers the sites
654
+ rather than deep inside it. And `prepublishOnly` runs the complete gated release suite, which covers the sites
654
655
  through `src/__tests__/native-bundle-version.test.ts` and
655
656
  `src/__tests__/version-site-guard.test.ts`.
656
657
 
@@ -735,3 +736,52 @@ keystroke is never a confirmed delivery. Pass a `captureID` to
735
736
  `pasteIntoFrontApp` when manually pasting a saved recording. Early permission
736
737
  or target failures remain visible in the engine status without a completed
737
738
  transaction receipt.
739
+
740
+
741
+ ### Native dependency receipts
742
+
743
+ An npm archive includes the complete Swift package at `src/native/Recordings`,
744
+ including `RecordingsLib`, its resources, updater targets, and resolved dependency
745
+ pins. An application can extract the verified archive into its dependency cache
746
+ and use that Swift package as a local SwiftPM dependency. This is consumption of
747
+ published package bytes; a development checkout alone is not release evidence.
748
+
749
+ Create a sidecar receipt for the exact reviewed npm archive after committing the
750
+ release metadata. The helper checks the shipped native bytes and package version
751
+ against the specified public Git revision. It does not extract into the working
752
+ app, access credentials, install software, or publish anything:
753
+
754
+ ```sh
755
+ python3 scripts/native-core-receipt.py /path/to/recordings-0.4.0.tgz \
756
+ --source-revision <full-public-release-commit> \
757
+ --repository /path/to/hasna-apps \
758
+ --output /path/to/recordings-0.4.0.prepared.json
759
+ ```
760
+
761
+ After the separately authorized npm publication, run the same command with
762
+ `--verify-registry` and a new output filename. That explicit read-only step checks
763
+ the version and integrity in public registry metadata, downloads the registry
764
+ archive, and requires byte equality with the reviewed archive. It never upgrades
765
+ a prepared receipt merely because a version exists. Existing receipt files are
766
+ never overwritten.
767
+
768
+ The external JSON format has `schemaVersion: 1` and
769
+ `kind: "hasna.recordings.native-core"`. It records:
770
+
771
+ - `package`: exact npm name and version.
772
+ - `source`: public repository URL and full verified Git revision.
773
+ - `distribution`: `status: "prepared"`, or `status: "published"` with registry
774
+ authority and verification time after the actual registry archive matches.
775
+ - `archive`: fixed npm URL, byte count, SHA-256, and npm SHA-512 integrity.
776
+ - `native`: package path, `RecordingsLib` product, Swift 6.2/macOS 26 requirements,
777
+ and each shipped native file's relative path, mode, byte count, and SHA-256.
778
+ `treeSHA256` hashes UTF-8 lines sorted by path, each formatted as
779
+ `path + NUL + octalMode + NUL + decimalBytes + NUL + sha256 + LF`.
780
+
781
+ A receipt is integrity evidence, not a signature or permission to release. A
782
+ consumer must pin the reviewed receipt digest through its own trusted release
783
+ configuration, require `distribution.status == "published"`, and compare the
784
+ archive and extracted source bytes before building. Co-delivered metadata must
785
+ not supply its own trusted expected digest. The receipt stays outside the npm
786
+ archive so its archive hash has no circular dependency. Notarization, signing,
787
+ and end-user acceptance of the consuming application remain separate checks.