arcane-os 0.18.0 → 0.20.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/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.20.0
4
+
5
+ - Restore repository-shaped application packages: selected app files remain
6
+ under `apps/<id>/`, alongside shared `arcane/` and configured runtime routes.
7
+ Authored document bases, import maps, module-relative imports and application
8
+ resource paths retain their development layout without rewriting product
9
+ documents or application code to relocate them.
10
+ - Restore deployment-relative `ARCANE_APP_RELEASE.app.start` and a root
11
+ `index.html` launcher while preserving the app-relative `app.entry` identity.
12
+ Package consumers use `app.start` for navigation. SDK packaged previews honor
13
+ that field and retain support for earlier flat packages through `app.entry`.
14
+ - Keep generated PWA files at the deployment root, resolve manifest metadata
15
+ against the packaged app directory, and preserve app-relative offline
16
+ selections alongside shared runtime paths. Source import-map inspection keeps
17
+ app-relative document paths and separately reports emitted package paths.
18
+ - Align packaging references with the current public return values and explicit
19
+ source import-map generation. Add package-layout and nested-deployment test
20
+ source while retaining complete authored-content coverage.
21
+
22
+ ## 0.19.0
23
+
24
+ - Read mail credentials from `.env.json` in the invocation directory through
25
+ portable Node file APIs. Remove the Windows Credential Manager subprocess,
26
+ embedded PowerShell/C# helper, helper timeouts, and transport-only machinery.
27
+ Existing Windows credential records remain untouched; populate the JSON file
28
+ explicitly when adopting this configuration change.
29
+ - Default mail commands to the top-level `RESEND_API_KEY`; `--profile mail`
30
+ selects that same key. Preserve named key set/status/delete operations through
31
+ exact `MAIL_PROFILES` entries, retaining unrelated JSON settings and naming
32
+ the missing setting and file before send or server startup.
33
+ - Ignore `.env.json` in the SDK checkout and newly scaffolded workspaces. Update
34
+ the mail reference and purpose-gate report with the portable configuration
35
+ contract and the reasons for each retained or removed operation.
36
+
3
37
  ## 0.18.0
4
38
 
5
39
  - Adopt published `node-http-server` 10.0.0. PEM-backed development and
package/README.md CHANGED
@@ -19,7 +19,7 @@ version-locked SDK runtime, while an integrated Arcane checkout uses its live
19
19
  `arcane/` runtime. Both profiles preserve the same app URLs, theme, packaging,
20
20
  event, cancellation, and browser run contracts.
21
21
 
22
- This checkout defines the `0.18.0` SDK contract. Applications pin one exact npm
22
+ This checkout defines the `0.20.0` SDK contract. Applications pin one exact npm
23
23
  version and lockfile; registry state is deliberately not baked into application
24
24
  artifacts.
25
25
 
@@ -199,9 +199,27 @@ URLs and release schema:
199
199
  apps/<id>/arcane-app.json
200
200
  apps/<id>/arcane-package.json
201
201
  apps/<id>/index.html
202
+ dist/<id>/index.html
203
+ dist/<id>/apps/<id>/index.html
202
204
  dist/<id>/ARCANE_APP_RELEASE.json
203
205
  ```
204
206
 
207
+ Packaging places each selected app file beneath `apps/<id>/` in the release
208
+ and preserves every shared route destination. When no selected shared payload
209
+ supplies a root `index.html`, the SDK generates one that opens the selected app
210
+ entry. Authored document bases, app URLs, relative module imports, and shared
211
+ runtime paths therefore resolve through the same layout in
212
+ source development and packaged delivery. Packaging consumes the saved source
213
+ and managed import maps; use `arcane import-map` to refresh those maps, or the
214
+ ordinary `arcane dev` startup that performs that refresh.
215
+
216
+ The release manifest keeps `app.entry` relative to the app directory and records
217
+ the package launch URL in `app.start`, such as
218
+ `./apps/hello-world/index.html`. Its complete `files` inventory includes the
219
+ root `index.html` and the prefixed app files. Packaged browser serving opens
220
+ `app.start`; a previously generated flat release without `app.start` retains
221
+ its `app.entry` launch path.
222
+
205
223
  The authored schema-2 descriptor is canonical for new apps and projects an
206
224
  exact schema-1 `arcane-package.json` for current consumers. Existing Arcane
207
225
  apps synthesize that descriptor from their schema-1 package plus the current
@@ -32,7 +32,7 @@ and exits nonzero on failure. Machine output is defined by
32
32
  | `arcane update-check` | Performs one explicit, read-only npm dist-tag query for the installed SDK version. |
33
33
  | `arcane targets` | Lists target ids, declared status, formats, architectures, signing profiles, methods, and pairing reason. |
34
34
  | `arcane repo status\|pull\|push` | Runs one selected repository operation for the current app workspace. |
35
- | `arcane mail key set\|status\|delete` | Manages one server-only Resend API-key profile in Windows Credential Manager. |
35
+ | `arcane mail key set\|status\|delete` | Manages one server-only Resend API-key profile in `.env.json`. |
36
36
  | `arcane mail send` | Performs one explicit, idempotency-keyed Resend attempt from a complete JSON report on redirected stdin. |
37
37
  | `arcane mail serve` | Starts one Arcane-to-Resend gateway with a server-only provider profile, a selected listener, and optional CORS and recipient configuration. |
38
38
 
@@ -195,8 +195,8 @@ Wrong or duplicate explicit app identity fails. The renderer then requires one
195
195
  path-correct base for every selected document. Included HTML files with neither
196
196
  the identity marker nor an active base are component fragments: they remain
197
197
  package files and are not rewritten with a document-level import map.
198
- Packaging and development use the same discovery owner, so directly navigable
199
- source pages and packaged pages receive the same complete managed import-map JSON.
198
+ Packaging and development use the same discovery owner. Packaging consumes
199
+ the saved managed import maps in directly navigable source pages.
200
200
 
201
201
  ```text
202
202
  arcane import-map [--workspace <directory>] [--app <id>]
@@ -254,19 +254,12 @@ together. A post-commit observer failure preserves delivery with
254
254
  `eventDelivery.status === 'degraded'` and `ARCANE_EVENT_DELIVERY_FAILED`; it
255
255
  does not roll back complete application content.
256
256
 
257
- An external package also publishes `/ARCANE_RUNTIME_PROJECTION.json`. The JSON
258
- is `{schemaVersion:1,kind:'arcane-app-runtime-projection',sdkVersion,
259
- pathPrefix:'arcane/',files:[{path}]}` and lists the complete packaged runtime.
260
- The development server exposes the same public route from its workspace
261
- projection. The private `/ARCANE_APP_RELEASE.json` record is not served to
262
- application code. Malformed projection data fails
263
- `ARCANE_RUNTIME_PROJECTION_INVALID`.
264
-
265
257
  `new` and `init` generate the map during scaffolding. `dev` refreshes all
266
- selected documents once before binding; non-dry-run `package` refreshes them
267
- once, then collects the complete release. Packaging does not run tests or
268
- checks automatically. Browser `build` and paired native packaging reuse the
269
- package flow. Explicit `test` and `check` operations read the existing map without regenerating it;
258
+ selected documents once before binding. `package` consumes the saved source
259
+ and maps; use `import-map` to refresh them explicitly before selecting output
260
+ that needs updated maps. Packaging does not run tests or checks automatically.
261
+ Browser `build` and paired native packaging reuse the package flow.
262
+ Explicit `test` and `check` operations read the existing map without regenerating it;
270
263
  `verify`, `bundle`, and browser `run` do not regenerate it. There is no
271
264
  watcher, polling, scheduled refresh, download, or self-update behavior.
272
265
 
@@ -504,9 +497,12 @@ npm exec -- arcane check --app hello-world
504
497
  ### Overview
505
498
 
506
499
  Creates one complete browser release beneath `dist/<id>/`, preserving the prior
507
- output until the replacement is complete. It refreshes the selected document
508
- map once, then assembles `dist`. Packaging does not run tests or checks
509
- automatically.
500
+ output until the replacement is complete. It consumes saved source and managed
501
+ import maps, places app files beneath `apps/<id>/`, and retains the configured
502
+ shared route destinations. When selected shared content supplies no root
503
+ `index.html`, the SDK generates one that opens the selected app entry.
504
+ Source document bases and resource URLs therefore retain their development
505
+ layout. Packaging does not run tests or checks automatically.
510
506
 
511
507
  ```text
512
508
  arcane package [--app <id>] [--dry-run]
@@ -515,6 +511,9 @@ arcane package [--app <id>] [--dry-run]
515
511
  ### Result
516
512
 
517
513
  The result includes the release root, manifest, and complete selected inventory.
514
+ `ARCANE_APP_RELEASE.json` keeps the authored app-relative `app.entry` and records
515
+ the package launch URL in `app.start`, such as `./apps/hello-world/index.html`.
516
+ The file inventory includes that app tree and the root `index.html`.
518
517
  `--dry-run` plans the package without refreshing source, running tests, or
519
518
  replacing output.
520
519
 
@@ -672,6 +671,8 @@ npm exec -- arcane build \
672
671
 
673
672
  For `--target browser`, starts the existing current `dist/<app>` release; it
674
673
  does not package, rebuild, test, check, or verify that release automatically.
674
+ It opens the release manifest's `app.start` URL. Older flat releases without
675
+ that field continue to open their `app.entry` path.
675
676
  The preview always uses HTTPS with the workspace certificate pair. Supply
676
677
  `--cert <file> --key <file>` together to use another pair; see
677
678
  [development HTTPS setup](#development-https-setup).
@@ -813,22 +814,47 @@ npm exec -- arcane repo status
813
814
 
814
815
  ### Resend credential profiles
815
816
 
816
- The credential subcommands select one local profile:
817
+ The mail commands read `.env.json` from the invocation directory on Windows,
818
+ Linux, and macOS. The credential subcommands select one profile in that file:
817
819
 
818
820
  ```text
819
- arcane mail key set <profile> [--secret-stdin]
820
- arcane mail key status <profile>
821
- arcane mail key delete <profile>
821
+ arcane mail key set [profile] [--secret-stdin]
822
+ arcane mail key status [profile]
823
+ arcane mail key delete [profile]
822
824
  ```
823
825
 
824
826
  `key set` reads the Resend API key from a hidden terminal prompt. The
825
827
  `--secret-stdin` form is for deliberately redirected non-interactive input and
826
- rejects a TTY before reading. The key is sent to the Windows Credential Manager
827
- helper over child-process stdin, never argv, and no plaintext fallback is
828
- created. Status reports only whether the profile exists. Delete returns the
829
- selected profile with `exists:false`; it intentionally does not distinguish a
830
- new deletion from an already-absent profile. Non-Windows hosts report the
831
- credential operation as unavailable.
828
+ rejects a TTY before reading. The key is written to `.env.json` and is never
829
+ accepted in argv or returned in status output. The optional profile defaults
830
+ to `mail`, which selects top-level `RESEND_API_KEY`. Any other exact profile
831
+ selects `MAIL_PROFILES[profile].RESEND_API_KEY`, with no default-key fallback.
832
+
833
+ The minimal file is:
834
+
835
+ ```json
836
+ {
837
+ "RESEND_API_KEY": ""
838
+ }
839
+ ```
840
+
841
+ Fill in the key before starting mail, and add `.env.json` to the project's
842
+ `.gitignore`; the SDK repository already ignores it. Set and delete preserve
843
+ the file's other settings and profiles. Status returns the selected profile,
844
+ `provider:'resend'`, `storage:'.env.json'`, and `exists`. Delete returns
845
+ `exists:false` for both a removed and an already-absent credential.
846
+
847
+ Programmatic `createToolchain().mail(...)` resolves the configuration directory
848
+ from `cwd ?? workspaceRoot ?? process.cwd()`. This uses ordinary Node file
849
+ access rather than platform-specific credential processes. An Android host
850
+ supplies a compatible Node runtime and an accessible configuration directory.
851
+ Existing Windows Credential Manager records remain untouched; the JSON reader
852
+ does not migrate or fall back to them. Mail reads JSON directly and does not
853
+ populate or depend on process environment variables for this key.
854
+
855
+ Missing files or missing/empty selected keys stop `send` and `serve` with the
856
+ configuration path and exact JSON setting to fill in. Invalid JSON and file
857
+ access failures remain observable without printing credential content.
832
858
 
833
859
  Machine output for `key set` requires `--secret-stdin`. Raw CLI arguments are
834
860
  not included in acceptance events, and usage errors do not echo unknown option
@@ -840,7 +866,7 @@ or positional values.
840
866
  server:
841
867
 
842
868
  ```text
843
- arcane mail send --profile <profile> [--from <verified-sender>] --report-key <id> --report-stdin [--request-timeout <ms>]
869
+ arcane mail send [--profile <profile>] [--from <verified-sender>] --report-key <id> --report-stdin [--request-timeout <ms>]
844
870
  ```
845
871
 
846
872
  `--report-stdin` is mandatory and rejects a terminal before attaching input
@@ -861,8 +887,8 @@ Resend owns their accepted shape. The adapter removes the application-only
861
887
  `type` field and applies `--from` when supplied; otherwise the report or provider
862
888
  template supplies the sender. Direct CLI sending has
863
889
  no configured fallback recipients. The Resend credential comes only from the
864
- selected Windows Credential Manager profile; neither it nor report content is
865
- accepted through argv or environment variables.
890
+ selected `.env.json` profile; omitting `--profile` selects `mail`. Neither the
891
+ key nor report content is accepted through argv or process environment variables.
866
892
 
867
893
  The caller owns the nonempty `--report-key`, which is forwarded unchanged.
868
894
  Reuse the same key only with the same
@@ -883,10 +909,11 @@ loss after the attempt begins is ambiguous because Resend may have accepted it.
883
909
  `mail serve` starts one owned Node HTTP gateway:
884
910
 
885
911
  ```text
886
- arcane mail serve --profile <profile> [--from <verified-sender>] [--app <label>] [--origin <exact-origin>] [--allow-to <addresses>] [--host 0.0.0.0] [--port 8025] [--request-timeout <ms>]
912
+ arcane mail serve [--profile <profile>] [--from <verified-sender>] [--app <label>] [--origin <exact-origin>] [--allow-to <addresses>] [--host 0.0.0.0] [--port 8025] [--request-timeout <ms>]
887
913
  ```
888
914
 
889
- The selected credential profile supplies only the server-side Resend API key.
915
+ The selected `.env.json` profile supplies only the server-side Resend API key;
916
+ omitting `--profile` selects `mail`.
890
917
  The CLI does not read a browser app key. Its optional `--app` value labels the
891
918
  server; the incoming request's `X-Mail-App` identifies the application for
892
919
  subscription verification. The HTTP authentication contract pairs that
@@ -13,12 +13,14 @@ gateway and is never included in browser or WebAssembly state.
13
13
  | `MailTransport.mjs` | Browser, WebView, or compatible Fetch host | Sends one already-persisted request to the configured Arcane gateway with the stable report key as its idempotency key. |
14
14
  | `arcane mail send` | Node on the local machine | Reads one complete provider-neutral report from redirected stdin and performs one explicit Resend attempt with a caller-owned idempotency key. |
15
15
  | `arcane mail serve` | Node on the configured host | Owns caller verification, protects the provider credential, applies explicitly configured recipient and origin settings, and makes one server-side Resend request. |
16
- | `arcane mail key ...` | Node on Windows | Stores, inspects, or deletes a Resend API key in Windows Credential Manager. |
16
+ | `arcane mail key ...` | Node on Windows, Linux, or macOS | Stores, inspects, or deletes a Resend API key in the selected `.env.json`. |
17
17
 
18
18
  The browser never receives the Resend API key. The gateway never writes that
19
19
  key to source, argv, logs, events, fixtures, browser storage, or its public
20
- lifecycle result. Non-Windows hosts report credential operations as unavailable;
21
- there is no plaintext fallback.
20
+ lifecycle result. The CLI and gateway use the same Node filesystem and network
21
+ interfaces on Windows, Linux, and macOS. An Android host supplies a compatible
22
+ Node runtime and an accessible configuration directory; the mail implementation
23
+ contains no Windows credential process or platform-specific path convention.
22
24
 
23
25
  ## Public npm import
24
26
 
@@ -42,8 +44,8 @@ import Mail,{
42
44
  and `sendMailReport`.
43
45
 
44
46
  This entrypoint contains only the portable browser/WebView runtime, outbox, and
45
- transport contract. It does not import the Node HTTP gateway or Windows
46
- Credential Manager adapter. Programmatic developer tooling reaches those
47
+ transport contract. It does not import the Node HTTP gateway or its filesystem
48
+ credential adapter. Programmatic developer tooling reaches those
47
49
  host-owned operations through the existing `createToolchain().mail(...)`
48
50
  boundary; ordinary operators use `arcane mail send`, `arcane mail serve`, and
49
51
  `arcane mail key ...`. This keeps Node credential and server authority out of a
@@ -53,9 +55,9 @@ browser import while preserving one shared CLI/toolchain implementation.
53
55
 
54
56
  Arcane Mail deliberately separates two credentials:
55
57
 
56
- - The **Resend API key** is provider authority. `arcane mail key set <profile>`
57
- stores it in Windows Credential Manager. `mail send --profile <profile>` and
58
- `mail serve --profile <profile>` read it only inside the owning Node process.
58
+ - The **Resend API key** is provider authority. The Node process reads it from
59
+ `.env.json`. `arcane mail key set [profile]` can store it there through hidden
60
+ input; `mail send` and `mail serve` read the selected profile inside that process.
59
61
  - The **subscription key** is the application user's subscription credential.
60
62
  When present, the browser sends it as `Authorization: Bearer <subscriptionKey>`,
61
63
  with the exact application name in `X-Mail-App`. The application name identifies the
@@ -270,21 +272,69 @@ committed acceptance result.
270
272
 
271
273
  ## Operate the CLI and gateway
272
274
 
273
- Store one Resend key under a local profile:
275
+ Create `.env.json` in the directory from which the mail command runs, then fill
276
+ in the provider key:
277
+
278
+ ```json
279
+ {
280
+ "RESEND_API_KEY": ""
281
+ }
282
+ ```
283
+
284
+ The SDK repository ignores `.env.json`. Keep the same entry in a consuming
285
+ project's `.gitignore`. This is a JSON configuration file; the mail commands
286
+ read it directly without copying its contents into `process.env`.
287
+
288
+ The default profile is `mail`, which selects top-level `RESEND_API_KEY`.
289
+ The explicit `--profile mail` form selects the same setting. Other profile names
290
+ select exact entries under `MAIL_PROFILES`:
291
+
292
+ ```json
293
+ {
294
+ "RESEND_API_KEY": "",
295
+ "MAIL_PROFILES": {
296
+ "another-provider-account": {
297
+ "RESEND_API_KEY": ""
298
+ }
299
+ }
300
+ }
301
+ ```
302
+
303
+ An absent named profile does not fall back to the default key. The profile
304
+ selects Resend provider credentials; it is separate from the incoming
305
+ application name and subscriber key.
306
+
307
+ Programmatic operations resolve `.env.json` from `options.cwd`, then
308
+ `options.workspaceRoot`, then `process.cwd()`, choosing the first supplied
309
+ directory. The CLI uses its invocation directory. There is no upward directory
310
+ search or dependency on a Windows installation directory or temporary-directory
311
+ environment variable.
312
+
313
+ The existing key commands manage the same file:
274
314
 
275
315
  ```text
276
- arcane mail key set arcane-dev
277
- arcane mail key status arcane-dev
278
- arcane mail key delete arcane-dev
316
+ arcane mail key set
317
+ arcane mail key status
318
+ arcane mail key delete
279
319
  ```
280
320
 
281
321
  `key set` prompts with hidden input. `--secret-stdin` is the explicit
282
- non-interactive alternative and rejects a TTY.
322
+ non-interactive alternative and rejects a TTY. Each command accepts an optional
323
+ profile argument, defaulting to `mail`. Set and delete preserve other JSON
324
+ settings and profiles; status reports existence without returning the key.
325
+ Results identify `storage: '.env.json'`. An already-absent deletion succeeds
326
+ with `exists: false`.
327
+
328
+ Existing Windows Credential Manager records remain untouched. The JSON path
329
+ does not read, migrate, or delete those records; populate the selected JSON
330
+ setting to use it. Missing files or missing/empty provider settings produce an
331
+ actionable startup/send error naming the file and exact setting. Unreadable or
332
+ invalid JSON is reported without including credential content in the error.
283
333
 
284
334
  Perform one provider attempt directly from the SDK CLI:
285
335
 
286
336
  ```text
287
- arcane mail send --profile arcane-dev --from "Arcane <verified@example.com>" --report-key <stable-id> --report-stdin
337
+ arcane mail send --from "Arcane <verified@example.com>" --report-key <stable-id> --report-stdin
288
338
  ```
289
339
 
290
340
  The redirected UTF-8 JSON object is read completely. Its fields and values
@@ -312,7 +362,7 @@ deadline.
312
362
  Start the gateway:
313
363
 
314
364
  ```text
315
- arcane mail serve --profile arcane-dev --from "Arcane <verified@example.com>"
365
+ npm exec -- arcane mail serve --profile mail --host 0.0.0.0 --port 8025
316
366
  ```
317
367
 
318
368
  The default listener is `0.0.0.0:8025`; `--host` and `--port` select its bind
@@ -39,13 +39,20 @@ display preference, routes and descriptions. Use real app icons; the SDK does
39
39
  not invent branding or claim that a browser has installed the app.
40
40
 
41
41
  Manifest URL fields are relative to the application directory. Source delivery
42
- and packaged delivery resolve those fields into their respective layouts.
43
- Absolute URL fields retain their authored destination.
42
+ and packaged delivery retain the app tree at `apps/<id>/`. For packaged output,
43
+ the default `start_url` is `./apps/<id>/<entry>`, resolved from the generated
44
+ root manifest. The default `id` and `scope` remain `./`, preserving the existing
45
+ deployment-root installation identity. Authored relative URL fields, including
46
+ explicit `id` and `scope` values, resolve against `./apps/<id>/`; an icon such
47
+ as `img/library.png` therefore remains beneath the app directory. Absolute URL
48
+ fields retain their authored destination.
44
49
 
45
50
  `offline.include` and `offline.exclude` select literal paths or directory
46
51
  prefixes from the selected emitted inventory. An omitted or empty include list
47
52
  selects that inventory; exclusions subtract from it. App files use app-relative
48
53
  paths and shared runtime files use paths such as `arcane/sdk/pwa.mjs`.
54
+ For example, selecting `modules` matches packaged
55
+ `apps/<id>/modules/...`; emitted offline URLs keep the `apps/<id>/` prefix.
49
56
  The application entry and generated PWA shell records are retained. Select the
50
57
  resources needed by every offline page, including its shared modules and styles.
51
58
  The worker script itself is never an application cache entry.
@@ -67,6 +74,13 @@ Browser packaging emits these files at the selected deployment root:
67
74
  | `arcane-sw.js` | Stable worker URL with the selected offline manifest embedded in its source. |
68
75
  | `arcane-pwa.mjs` | Independent registration and installation-component bootstrap importing the SDK client. |
69
76
 
77
+ The selected app files remain under `apps/<id>/`, with shared runtime routes
78
+ alongside them. The SDK supplies a root `index.html` launcher when selected
79
+ shared content has no root page. The generated PWA files stay at the deployment
80
+ root so their worker can serve the selected app and shared resources. The
81
+ worker is registered for the deployment root independently of any app-authored
82
+ manifest scope.
83
+
70
84
  Each packaged output gets one deployment revision shared by its offline
71
85
  manifest and worker. It distinguishes separately generated outputs even when
72
86
  their app and SDK versions match. It is not a content measurement.
@@ -719,6 +719,12 @@ matching `meta[name="arcane-app-id"]`; unmarked pages with an active `base`
719
719
  remain selected for patch compatibility. Included HTML with neither signal is
720
720
  retained as a package fragment rather than rewritten as a document.
721
721
 
722
+ `entry` and each app browser document's `path` stay relative to the app
723
+ directory. Each browser document also reports `packagePath`, the emitted path
724
+ such as `apps/hello-world/index.html`. The complete `files` inventory uses
725
+ package-relative paths and includes the root `index.html`. Shared
726
+ files retain their configured route destinations.
727
+
722
728
  ### Availability and normalization
723
729
 
724
730
  **Node.** Normalized SDK validation with complete canonical archive and release content. Deep protocol: [SDK packager and deterministic bundle contract](protocols.md).
@@ -772,27 +778,22 @@ when explicitly requested or when required for this selected release output.
772
778
  async packageApp(options)
773
779
  ```
774
780
 
775
- Import it from `arcane-os` or `arcane-os/packager`. Packaging refreshes the
776
- managed map once and preserves the complete selected source and browser
777
- document inventory. It rejects malformed configuration, descriptors,
778
- and the malformed selected release archive while preserving the previously
779
- selected output on failure. Each selected browser document receives the same
780
- deterministic map. The package root also contains the public
781
- `ARCANE_RUNTIME_PROJECTION.json` inventory:
782
-
783
- ```javascript
784
- {
785
- schemaVersion: 1,
786
- kind: 'arcane-app-runtime-projection',
787
- sdkVersion: '0.5.18',
788
- pathPrefix: 'arcane/',
789
- files: [{path}]
790
- }
791
- ```
781
+ Import it from `arcane-os` or `arcane-os/packager`. Packaging consumes the saved
782
+ source and managed import maps. Refresh maps through `arcane import-map` or
783
+ ordinary `arcane dev` startup before selecting output that needs updated maps.
784
+ The package preserves the complete selected content, applying the documented
785
+ asset-version and enabled browser-PWA transformations to resource references.
786
+ Malformed configuration or descriptors fail while preserving the prior output.
792
787
 
793
- The projection is an inventory, not an ordinary execution gate. Malformed or
794
- internally inconsistent selected projection data rejects with
795
- `ARCANE_RUNTIME_PROJECTION_INVALID`.
788
+ Selected app files are emitted beneath `apps/<id>/`; shared files retain their
789
+ configured route destinations. When selected shared content supplies no root
790
+ `index.html`, the SDK generates one that opens the selected app page. The result
791
+ contains `outputRoot`, `manifest`, and the complete `files` inventory.
792
+ `manifest.app.entry` stays app-relative, while `manifest.app.start`
793
+ is the package launch URL, such as `./apps/hello-world/index.html`. Release
794
+ schema `1`, kind `arcane-app-release`, and packager identity
795
+ `arcane-app-packager-v1` remain unchanged. A dry run returns the planned output
796
+ and file inventory without writing source or output.
796
797
 
797
798
  ### Availability and normalization
798
799
 
@@ -808,7 +809,7 @@ const packaged = await packageApp({
808
809
  appId: 'hello-world'
809
810
  });
810
811
 
811
- console.log(packaged.importMap.documentPaths);
812
+ console.log(packaged.manifest.app.start, packaged.files);
812
813
  ```
813
814
 
814
815
  ## PACKAGER_VERSION
@@ -4038,17 +4039,19 @@ console.log(result.importMap.documentPaths, result.importMap.documentCount);
4038
4039
  ### Overview
4039
4040
 
4040
4041
  Runs the high-level package operation for one selected application. It reads
4041
- the installed SDK/runtime selection, injects one deterministic
4042
- managed import map into every directly navigable included `.html`/`.htm`
4043
- browser document while preserving component fragments as package files, and
4044
- then packages the complete selected content without automatically running tests
4045
- or checks. Verification occurs only when explicitly requested or when required
4046
- for the selected release output. A failure leaves the previously accepted
4047
- distribution untouched. Success returns the low-level package result and
4048
- complete import-map document inventory. External
4049
- packages publish `ARCANE_RUNTIME_PROJECTION.json`; private
4050
- `ARCANE_APP_RELEASE.json` remains an internal verification authority rather
4051
- than an application route.
4042
+ the installed SDK/runtime selection and packages the saved source and managed
4043
+ import maps through `packageApp()`. Map generation remains the explicit
4044
+ `arcane import-map` operation and the ordinary `arcane dev` startup refresh.
4045
+ Selected app files retain their `apps/<id>/` paths alongside the shared routes
4046
+ and root launcher described by `packageApp()`.
4047
+
4048
+ Packaging does not automatically run tests or checks. Verification occurs only
4049
+ when explicitly requested or when required for the selected release output.
4050
+ A failure leaves the prior distribution untouched. Success returns the selected
4051
+ workspace and app identity plus `release`, containing the low-level package
4052
+ result, manifest, and complete file inventory. `ARCANE_APP_RELEASE.json` records
4053
+ that inventory and the distinct app-relative `app.entry` and package-relative
4054
+ `app.start`; it remains package metadata rather than an application route.
4052
4055
 
4053
4056
  ### Signature and result
4054
4057
 
@@ -4072,7 +4075,7 @@ const result = await packageApplication({
4072
4075
  appId: 'hello-world'
4073
4076
  });
4074
4077
 
4075
- console.log(result.release.importMap.documentPaths);
4078
+ console.log(result.release.manifest.app.start, result.release.files);
4076
4079
  ```
4077
4080
 
4078
4081
  ## planApplication()