@czap/astro 0.1.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/LICENSE +21 -0
- package/README.md +19 -0
- package/dist/Satellite.d.ts +42 -0
- package/dist/Satellite.d.ts.map +1 -0
- package/dist/Satellite.js +55 -0
- package/dist/Satellite.js.map +1 -0
- package/dist/client-directives/gpu.d.ts +3 -0
- package/dist/client-directives/gpu.d.ts.map +1 -0
- package/dist/client-directives/gpu.js +5 -0
- package/dist/client-directives/gpu.js.map +1 -0
- package/dist/client-directives/llm.d.ts +3 -0
- package/dist/client-directives/llm.d.ts.map +1 -0
- package/dist/client-directives/llm.js +5 -0
- package/dist/client-directives/llm.js.map +1 -0
- package/dist/client-directives/satellite.d.ts +3 -0
- package/dist/client-directives/satellite.d.ts.map +1 -0
- package/dist/client-directives/satellite.js +5 -0
- package/dist/client-directives/satellite.js.map +1 -0
- package/dist/client-directives/stream.d.ts +3 -0
- package/dist/client-directives/stream.d.ts.map +1 -0
- package/dist/client-directives/stream.js +5 -0
- package/dist/client-directives/stream.js.map +1 -0
- package/dist/client-directives/wasm.d.ts +3 -0
- package/dist/client-directives/wasm.d.ts.map +1 -0
- package/dist/client-directives/wasm.js +6 -0
- package/dist/client-directives/wasm.js.map +1 -0
- package/dist/client-directives/worker.d.ts +3 -0
- package/dist/client-directives/worker.d.ts.map +1 -0
- package/dist/client-directives/worker.js +5 -0
- package/dist/client-directives/worker.js.map +1 -0
- package/dist/detect-upgrade.d.ts +16 -0
- package/dist/detect-upgrade.d.ts.map +1 -0
- package/dist/detect-upgrade.js +105 -0
- package/dist/detect-upgrade.js.map +1 -0
- package/dist/headers.d.ts +45 -0
- package/dist/headers.d.ts.map +1 -0
- package/dist/headers.js +64 -0
- package/dist/headers.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/integration.d.ts +76 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +240 -0
- package/dist/integration.js.map +1 -0
- package/dist/middleware.d.ts +69 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +75 -0
- package/dist/middleware.js.map +1 -0
- package/dist/quantize.d.ts +50 -0
- package/dist/quantize.d.ts.map +1 -0
- package/dist/quantize.js +122 -0
- package/dist/quantize.js.map +1 -0
- package/dist/runtime/boundary.d.ts +123 -0
- package/dist/runtime/boundary.d.ts.map +1 -0
- package/dist/runtime/boundary.js +164 -0
- package/dist/runtime/boundary.js.map +1 -0
- package/dist/runtime/globals.d.ts +32 -0
- package/dist/runtime/globals.d.ts.map +1 -0
- package/dist/runtime/globals.js +45 -0
- package/dist/runtime/globals.js.map +1 -0
- package/dist/runtime/gpu.d.ts +15 -0
- package/dist/runtime/gpu.d.ts.map +1 -0
- package/dist/runtime/gpu.js +266 -0
- package/dist/runtime/gpu.js.map +1 -0
- package/dist/runtime/index.d.ts +7 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +5 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/llm-receipt-tracker.d.ts +21 -0
- package/dist/runtime/llm-receipt-tracker.d.ts.map +1 -0
- package/dist/runtime/llm-receipt-tracker.js +60 -0
- package/dist/runtime/llm-receipt-tracker.js.map +1 -0
- package/dist/runtime/llm-render-pipeline.d.ts +89 -0
- package/dist/runtime/llm-render-pipeline.d.ts.map +1 -0
- package/dist/runtime/llm-render-pipeline.js +241 -0
- package/dist/runtime/llm-render-pipeline.js.map +1 -0
- package/dist/runtime/llm-session.d.ts +126 -0
- package/dist/runtime/llm-session.d.ts.map +1 -0
- package/dist/runtime/llm-session.js +385 -0
- package/dist/runtime/llm-session.js.map +1 -0
- package/dist/runtime/llm.d.ts +16 -0
- package/dist/runtime/llm.d.ts.map +1 -0
- package/dist/runtime/llm.js +273 -0
- package/dist/runtime/llm.js.map +1 -0
- package/dist/runtime/policy.d.ts +100 -0
- package/dist/runtime/policy.d.ts.map +1 -0
- package/dist/runtime/policy.js +147 -0
- package/dist/runtime/policy.js.map +1 -0
- package/dist/runtime/receipt-chain.d.ts +22 -0
- package/dist/runtime/receipt-chain.d.ts.map +1 -0
- package/dist/runtime/receipt-chain.js +80 -0
- package/dist/runtime/receipt-chain.js.map +1 -0
- package/dist/runtime/runtime-session.d.ts +34 -0
- package/dist/runtime/runtime-session.d.ts.map +1 -0
- package/dist/runtime/runtime-session.js +102 -0
- package/dist/runtime/runtime-session.js.map +1 -0
- package/dist/runtime/satellite.d.ts +13 -0
- package/dist/runtime/satellite.d.ts.map +1 -0
- package/dist/runtime/satellite.js +59 -0
- package/dist/runtime/satellite.js.map +1 -0
- package/dist/runtime/slots.d.ts +34 -0
- package/dist/runtime/slots.d.ts.map +1 -0
- package/dist/runtime/slots.js +108 -0
- package/dist/runtime/slots.js.map +1 -0
- package/dist/runtime/stream-session.d.ts +47 -0
- package/dist/runtime/stream-session.d.ts.map +1 -0
- package/dist/runtime/stream-session.js +82 -0
- package/dist/runtime/stream-session.js.map +1 -0
- package/dist/runtime/stream.d.ts +9 -0
- package/dist/runtime/stream.d.ts.map +1 -0
- package/dist/runtime/stream.js +308 -0
- package/dist/runtime/stream.js.map +1 -0
- package/dist/runtime/url-policy.d.ts +28 -0
- package/dist/runtime/url-policy.d.ts.map +1 -0
- package/dist/runtime/url-policy.js +87 -0
- package/dist/runtime/url-policy.js.map +1 -0
- package/dist/runtime/wasm.d.ts +20 -0
- package/dist/runtime/wasm.d.ts.map +1 -0
- package/dist/runtime/wasm.js +70 -0
- package/dist/runtime/wasm.js.map +1 -0
- package/dist/runtime/worker.d.ts +11 -0
- package/dist/runtime/worker.d.ts.map +1 -0
- package/dist/runtime/worker.js +249 -0
- package/dist/runtime/worker.js.map +1 -0
- package/package.json +106 -0
- package/src/Satellite.astro +39 -0
- package/src/Satellite.ts +84 -0
- package/src/client-directives/gpu.ts +5 -0
- package/src/client-directives/llm.ts +5 -0
- package/src/client-directives/satellite.ts +5 -0
- package/src/client-directives/stream.ts +5 -0
- package/src/client-directives/wasm.ts +6 -0
- package/src/client-directives/worker.ts +5 -0
- package/src/detect-upgrade.ts +105 -0
- package/src/headers.ts +84 -0
- package/src/index.ts +30 -0
- package/src/integration.ts +309 -0
- package/src/middleware.ts +133 -0
- package/src/quantize.ts +173 -0
- package/src/runtime/boundary.ts +263 -0
- package/src/runtime/globals.ts +57 -0
- package/src/runtime/gpu.ts +291 -0
- package/src/runtime/index.ts +12 -0
- package/src/runtime/llm-receipt-tracker.ts +88 -0
- package/src/runtime/llm-render-pipeline.ts +366 -0
- package/src/runtime/llm-session.ts +548 -0
- package/src/runtime/llm.ts +344 -0
- package/src/runtime/policy.ts +229 -0
- package/src/runtime/receipt-chain.ts +106 -0
- package/src/runtime/runtime-session.ts +139 -0
- package/src/runtime/satellite.ts +80 -0
- package/src/runtime/slots.ts +136 -0
- package/src/runtime/stream-session.ts +125 -0
- package/src/runtime/stream.ts +407 -0
- package/src/runtime/url-policy.ts +107 -0
- package/src/runtime/wasm.ts +85 -0
- package/src/runtime/worker.ts +307 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Eassa Ayoub <eassa@heyoub.dev>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @czap/astro
|
|
2
|
+
|
|
3
|
+
Astro 6 integration: Satellite component + client:satellite directive.
|
|
4
|
+
|
|
5
|
+
## Docs
|
|
6
|
+
|
|
7
|
+
- [Naming & vocabulary](../../docs/GLOSSARY.md) — LiteShip, CZAP, `@czap/*`
|
|
8
|
+
|
|
9
|
+
- [API reference](https://github.com/heyoub/LiteShip/tree/main/docs/api/astro/) — generated from source TSDoc
|
|
10
|
+
- [Architecture index](https://github.com/heyoub/LiteShip/blob/main/docs/ARCHITECTURE.md)
|
|
11
|
+
- [ADRs](https://github.com/heyoub/LiteShip/tree/main/docs/adr/)
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @czap/astro
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Part of [LiteShip](https://github.com/heyoub/LiteShip#readme)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Satellite -- server-side helper for rendering adaptive container divs.
|
|
3
|
+
*
|
|
4
|
+
* A satellite is czap's island primitive: a plain div annotated with
|
|
5
|
+
* data-czap-* attributes that the client directive hydrates by evaluating
|
|
6
|
+
* live signals and updating `data-czap-state`. CSS transitions handle
|
|
7
|
+
* the visual changes -- zero JS layout work.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { Boundary, Component } from '@czap/core';
|
|
12
|
+
/**
|
|
13
|
+
* Server-render props for a satellite container. Astro components
|
|
14
|
+
* typically destructure these and pass them to {@link satelliteAttrs}.
|
|
15
|
+
*/
|
|
16
|
+
export interface SatelliteProps {
|
|
17
|
+
/** Boundary whose state the satellite tracks. */
|
|
18
|
+
readonly boundary?: Boundary.Shape;
|
|
19
|
+
/** Component definition used to identify the satellite on the client. */
|
|
20
|
+
readonly component?: Component.Shape;
|
|
21
|
+
/** Extra CSS class names to merge with `czap-satellite`. */
|
|
22
|
+
readonly class?: string;
|
|
23
|
+
/** Server-side initial state (serialised into `data-czap-state`). */
|
|
24
|
+
readonly initialState?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Generate the HTML attributes for a satellite container div.
|
|
28
|
+
* Used by framework integrations (Astro, etc.) to render the satellite wrapper.
|
|
29
|
+
*
|
|
30
|
+
* The returned record maps directly to DOM attributes -- spread it onto your
|
|
31
|
+
* container element and the client directive picks up the rest.
|
|
32
|
+
*/
|
|
33
|
+
export declare function satelliteAttrs(props: SatelliteProps): Record<string, string>;
|
|
34
|
+
/**
|
|
35
|
+
* Resolve initial state from a boundary for SSR.
|
|
36
|
+
*
|
|
37
|
+
* Uses a first-state heuristic since the server has no live signal value.
|
|
38
|
+
* For smarter resolution with client hints and user agent parsing, use
|
|
39
|
+
* `resolveInitialState` from `./quantize.js` instead.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveInitialStateFallback(boundary: Boundary.Shape): string;
|
|
42
|
+
//# sourceMappingURL=Satellite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Satellite.d.ts","sourceRoot":"","sources":["../src/Satellite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAMtD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;IACnC,yEAAyE;IACzE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAMD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwB5E;AAMD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,GAAG,MAAM,CAG5E"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Satellite -- server-side helper for rendering adaptive container divs.
|
|
3
|
+
*
|
|
4
|
+
* A satellite is czap's island primitive: a plain div annotated with
|
|
5
|
+
* data-czap-* attributes that the client directive hydrates by evaluating
|
|
6
|
+
* live signals and updating `data-czap-state`. CSS transitions handle
|
|
7
|
+
* the visual changes -- zero JS layout work.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Attribute Generation
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
/**
|
|
15
|
+
* Generate the HTML attributes for a satellite container div.
|
|
16
|
+
* Used by framework integrations (Astro, etc.) to render the satellite wrapper.
|
|
17
|
+
*
|
|
18
|
+
* The returned record maps directly to DOM attributes -- spread it onto your
|
|
19
|
+
* container element and the client directive picks up the rest.
|
|
20
|
+
*/
|
|
21
|
+
export function satelliteAttrs(props) {
|
|
22
|
+
const attrs = {};
|
|
23
|
+
attrs['class'] = ['czap-satellite', props.class].filter(Boolean).join(' ');
|
|
24
|
+
if (props.component) {
|
|
25
|
+
attrs['data-czap-satellite'] = props.component.name;
|
|
26
|
+
}
|
|
27
|
+
if (props.boundary) {
|
|
28
|
+
attrs['data-czap-boundary'] = JSON.stringify({
|
|
29
|
+
id: props.boundary.id,
|
|
30
|
+
input: props.boundary.input,
|
|
31
|
+
thresholds: props.boundary.thresholds,
|
|
32
|
+
states: props.boundary.states,
|
|
33
|
+
hysteresis: props.boundary.hysteresis,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (props.initialState) {
|
|
37
|
+
attrs['data-czap-state'] = props.initialState;
|
|
38
|
+
}
|
|
39
|
+
return attrs;
|
|
40
|
+
}
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// SSR State Resolution
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
/**
|
|
45
|
+
* Resolve initial state from a boundary for SSR.
|
|
46
|
+
*
|
|
47
|
+
* Uses a first-state heuristic since the server has no live signal value.
|
|
48
|
+
* For smarter resolution with client hints and user agent parsing, use
|
|
49
|
+
* `resolveInitialState` from `./quantize.js` instead.
|
|
50
|
+
*/
|
|
51
|
+
export function resolveInitialStateFallback(boundary) {
|
|
52
|
+
// Boundary.make() guarantees at least one state for every Boundary.Shape.
|
|
53
|
+
return boundary.states[0];
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=Satellite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Satellite.js","sourceRoot":"","sources":["../src/Satellite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAuBH,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,KAAqB;IAClD,MAAM,KAAK,GAA2B,EAAE,CAAC;IAEzC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE3E,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACpB,KAAK,CAAC,qBAAqB,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;IACtD,CAAC;IAED,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,KAAK,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;YAC3C,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE;YACrB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK;YAC3B,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,UAAU;YACrC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM;YAC7B,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,UAAU;SACtC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACvB,KAAK,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;IAChD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,QAAwB;IAClE,0EAA0E;IAC1E,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpu.d.ts","sourceRoot":"","sources":["../../src/client-directives/gpu.ts"],"names":[],"mappings":"yBAEgB,MAAM,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,WAAW;AAA7F,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gpu.js","sourceRoot":"","sources":["../../src/client-directives/gpu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAe,CAAC,IAA4B,EAAE,KAA8B,EAAE,EAAe,EAAE,EAAE;IAC/F,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/client-directives/llm.ts"],"names":[],"mappings":"yBAEgB,MAAM,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,WAAW;AAA7F,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm.js","sourceRoot":"","sources":["../../src/client-directives/llm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAe,CAAC,IAA4B,EAAE,KAA8B,EAAE,EAAe,EAAE,EAAE;IAC/F,gBAAgB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"satellite.d.ts","sourceRoot":"","sources":["../../src/client-directives/satellite.ts"],"names":[],"mappings":"yBAEgB,MAAM,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,WAAW;AAA7F,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"satellite.js","sourceRoot":"","sources":["../../src/client-directives/satellite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,eAAe,CAAC,IAA4B,EAAE,KAA8B,EAAE,EAAe,EAAE,EAAE;IAC/F,sBAAsB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/client-directives/stream.ts"],"names":[],"mappings":"yBAEgB,MAAM,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,WAAW;AAA7F,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/client-directives/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAe,CAAC,IAA4B,EAAE,KAA8B,EAAE,EAAe,EAAE,EAAE;IAC/F,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm.d.ts","sourceRoot":"","sources":["../../src/client-directives/wasm.ts"],"names":[],"mappings":"yBAEgB,MAAM,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,WAAW;AAA7F,wBAGE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm.js","sourceRoot":"","sources":["../../src/client-directives/wasm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,eAAe,CAAC,IAA4B,EAAE,KAA8B,EAAE,EAAe,EAAE,EAAE;IAC/F,KAAK,eAAe,CAAC,EAAE,CAAC,CAAC;IACzB,IAAI,EAAE,CAAC;AACT,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/client-directives/worker.ts"],"names":[],"mappings":"yBAEgB,MAAM,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,WAAW;AAA7F,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../src/client-directives/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAe,CAAC,IAA4B,EAAE,KAA8B,EAAE,EAAe,EAAE,EAAE;IAC/F,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GPU probe upgrade -- replaces provisional tier with full detection.
|
|
3
|
+
*
|
|
4
|
+
* Runs after DOMContentLoaded (not render-blocking). Creates a throwaway
|
|
5
|
+
* WebGL context, reads the GPU renderer string, classifies the GPU tier
|
|
6
|
+
* using the same heuristics as `@czap/detect`, and updates the HTML element
|
|
7
|
+
* attributes.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Inline script that performs full GPU tier detection.
|
|
13
|
+
* Deferred to DOMContentLoaded to avoid blocking rendering.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DETECT_UPGRADE_SCRIPT: string;
|
|
16
|
+
//# sourceMappingURL=detect-upgrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-upgrade.d.ts","sourceRoot":"","sources":["../src/detect-upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAyF1B,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GPU probe upgrade -- replaces provisional tier with full detection.
|
|
3
|
+
*
|
|
4
|
+
* Runs after DOMContentLoaded (not render-blocking). Creates a throwaway
|
|
5
|
+
* WebGL context, reads the GPU renderer string, classifies the GPU tier
|
|
6
|
+
* using the same heuristics as `@czap/detect`, and updates the HTML element
|
|
7
|
+
* attributes.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Inline script that performs full GPU tier detection.
|
|
13
|
+
* Deferred to DOMContentLoaded to avoid blocking rendering.
|
|
14
|
+
*/
|
|
15
|
+
export const DETECT_UPGRADE_SCRIPT = `
|
|
16
|
+
(function(){
|
|
17
|
+
function writeDetectState(next) {
|
|
18
|
+
var safe = Object.freeze(Object.assign({}, next));
|
|
19
|
+
try {
|
|
20
|
+
Object.defineProperty(window, '__CZAP_DETECT__', {
|
|
21
|
+
value: safe,
|
|
22
|
+
configurable: true,
|
|
23
|
+
enumerable: false,
|
|
24
|
+
writable: false
|
|
25
|
+
});
|
|
26
|
+
} catch (_) {
|
|
27
|
+
try {
|
|
28
|
+
window.__CZAP_DETECT__ = safe;
|
|
29
|
+
} catch (_) {}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function upgrade() {
|
|
34
|
+
try {
|
|
35
|
+
var h = document.documentElement;
|
|
36
|
+
var tier = 1;
|
|
37
|
+
var renderer = '';
|
|
38
|
+
var webgpu = false;
|
|
39
|
+
|
|
40
|
+
// WebGL renderer probe
|
|
41
|
+
var c = document.createElement('canvas');
|
|
42
|
+
var gl = c.getContext('webgl2') || c.getContext('webgl');
|
|
43
|
+
if (gl) {
|
|
44
|
+
var ext = gl.getExtension('WEBGL_debug_renderer_info');
|
|
45
|
+
if (ext) {
|
|
46
|
+
renderer = gl.getParameter(ext.UNMASKED_RENDERER_WEBGL) || '';
|
|
47
|
+
}
|
|
48
|
+
// Classify GPU tier from renderer string
|
|
49
|
+
var r = renderer.toLowerCase();
|
|
50
|
+
if (/swiftshader|llvmpipe|virtualbox|vmware/.test(r)) {
|
|
51
|
+
tier = 0; // software
|
|
52
|
+
} else if (/rtx|radeon rx [67]|apple m[3-9]|adreno 7/.test(r)) {
|
|
53
|
+
tier = 3; // high
|
|
54
|
+
} else if (/geforce|radeon rx [45]|adreno [56]|mali-g7|apple m[12]|intel arc/.test(r)) {
|
|
55
|
+
tier = 2; // mid
|
|
56
|
+
} else if (/intel|mali|adreno [1-4]|powervr|apple gpu/.test(r)) {
|
|
57
|
+
tier = 1; // integrated
|
|
58
|
+
}
|
|
59
|
+
gl.getExtension('WEBGL_lose_context')?.loseContext();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// WebGPU check
|
|
63
|
+
if (typeof navigator !== 'undefined' && navigator.gpu) {
|
|
64
|
+
webgpu = true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Compute final tier using GPU + cores + memory
|
|
68
|
+
var cores = navigator.hardwareConcurrency || 2;
|
|
69
|
+
var mem = navigator.deviceMemory || 4;
|
|
70
|
+
var motion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
71
|
+
|
|
72
|
+
var capLevel = 'reactive';
|
|
73
|
+
if (motion) capLevel = 'static';
|
|
74
|
+
else if (tier === 0 || cores <= 2 || mem <= 2) capLevel = 'styled';
|
|
75
|
+
else if (tier >= 3 && cores >= 4 && webgpu) capLevel = 'gpu';
|
|
76
|
+
else if (tier >= 2 && cores >= 4) capLevel = 'animated';
|
|
77
|
+
|
|
78
|
+
var motionTier = 'animations';
|
|
79
|
+
if (motion) motionTier = 'none';
|
|
80
|
+
else if (tier === 0 || cores <= 2) motionTier = 'transitions';
|
|
81
|
+
else if (tier >= 3 && webgpu) motionTier = 'compute';
|
|
82
|
+
else if (tier >= 2) motionTier = 'physics';
|
|
83
|
+
|
|
84
|
+
h.setAttribute('data-czap-tier', capLevel);
|
|
85
|
+
h.setAttribute('data-czap-gpu-tier', String(tier));
|
|
86
|
+
if (webgpu) h.setAttribute('data-czap-webgpu', 'true');
|
|
87
|
+
h.removeAttribute('data-czap-tier-provisional');
|
|
88
|
+
|
|
89
|
+
// Update a minimal runtime snapshot instead of exposing the full probe payload.
|
|
90
|
+
writeDetectState({
|
|
91
|
+
tier: capLevel,
|
|
92
|
+
gpuTier: tier,
|
|
93
|
+
webgpu: webgpu,
|
|
94
|
+
motionTier: motionTier
|
|
95
|
+
});
|
|
96
|
+
} catch(e) { try { document.documentElement.setAttribute('data-czap-tier-probe-error', 'true'); } catch(_) {} }
|
|
97
|
+
}
|
|
98
|
+
if (document.readyState === 'loading') {
|
|
99
|
+
document.addEventListener('DOMContentLoaded', upgrade);
|
|
100
|
+
} else {
|
|
101
|
+
upgrade();
|
|
102
|
+
}
|
|
103
|
+
})();
|
|
104
|
+
`.trim();
|
|
105
|
+
//# sourceMappingURL=detect-upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect-upgrade.js","sourceRoot":"","sources":["../src/detect-upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyFpC,CAAC,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP header helpers shipped by `@czap/astro`.
|
|
3
|
+
*
|
|
4
|
+
* Encodes the two concerns the integration cares about: asking browsers
|
|
5
|
+
* for the Client Hints czap uses (tier detection), and shipping the
|
|
6
|
+
* COOP/COEP pair required by `SharedArrayBuffer`-backed workers.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Default `Accept-CH` / `Critical-CH` response headers czap requests
|
|
12
|
+
* so the browser sends viewport width, device memory, motion
|
|
13
|
+
* preference, and DPR on the next navigation.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CLIENT_HINTS_HEADERS: Record<string, string>;
|
|
16
|
+
/**
|
|
17
|
+
* COOP/COEP header pair required for `SharedArrayBuffer` (used by
|
|
18
|
+
* `@czap/worker`'s SPSC ring). Applied only when the integration is
|
|
19
|
+
* configured with `workers: { enabled: true }`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const CROSS_ORIGIN_HEADERS: Record<string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* Build the `[header, value]` entries czap wants to emit for a given
|
|
24
|
+
* feature toggle set. Used by dev-server middleware and edge adapters
|
|
25
|
+
* that prefer tuple iteration over the `Headers` API.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getCzapHeaderEntries(options: {
|
|
28
|
+
readonly detectEnabled: boolean;
|
|
29
|
+
readonly workersEnabled: boolean;
|
|
30
|
+
readonly acceptCH?: string;
|
|
31
|
+
readonly criticalCH?: string;
|
|
32
|
+
}): Array<readonly [string, string]>;
|
|
33
|
+
/**
|
|
34
|
+
* Apply the czap header set to an existing {@link Headers} bag and
|
|
35
|
+
* return it (for chaining). Convenience wrapper over
|
|
36
|
+
* {@link getCzapHeaderEntries} for middleware that already has a
|
|
37
|
+
* `Headers` object in hand.
|
|
38
|
+
*/
|
|
39
|
+
export declare function applyCzapHeaders(headers: Headers, options: {
|
|
40
|
+
readonly detectEnabled: boolean;
|
|
41
|
+
readonly workersEnabled: boolean;
|
|
42
|
+
readonly acceptCH?: string;
|
|
43
|
+
readonly criticalCH?: string;
|
|
44
|
+
}): Headers;
|
|
45
|
+
//# sourceMappingURL=headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../src/headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGvD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGvD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAqBnC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE;IACP,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,GACA,OAAO,CAMT"}
|
package/dist/headers.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP header helpers shipped by `@czap/astro`.
|
|
3
|
+
*
|
|
4
|
+
* Encodes the two concerns the integration cares about: asking browsers
|
|
5
|
+
* for the Client Hints czap uses (tier detection), and shipping the
|
|
6
|
+
* COOP/COEP pair required by `SharedArrayBuffer`-backed workers.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Default `Accept-CH` / `Critical-CH` response headers czap requests
|
|
12
|
+
* so the browser sends viewport width, device memory, motion
|
|
13
|
+
* preference, and DPR on the next navigation.
|
|
14
|
+
*/
|
|
15
|
+
export const CLIENT_HINTS_HEADERS = {
|
|
16
|
+
'Accept-CH': 'Sec-CH-Viewport-Width, Sec-CH-Device-Memory, Sec-CH-Prefers-Reduced-Motion, Sec-CH-DPR',
|
|
17
|
+
'Critical-CH': 'Sec-CH-Viewport-Width',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* COOP/COEP header pair required for `SharedArrayBuffer` (used by
|
|
21
|
+
* `@czap/worker`'s SPSC ring). Applied only when the integration is
|
|
22
|
+
* configured with `workers: { enabled: true }`.
|
|
23
|
+
*/
|
|
24
|
+
export const CROSS_ORIGIN_HEADERS = {
|
|
25
|
+
'Cross-Origin-Opener-Policy': 'same-origin',
|
|
26
|
+
'Cross-Origin-Embedder-Policy': 'require-corp',
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Build the `[header, value]` entries czap wants to emit for a given
|
|
30
|
+
* feature toggle set. Used by dev-server middleware and edge adapters
|
|
31
|
+
* that prefer tuple iteration over the `Headers` API.
|
|
32
|
+
*/
|
|
33
|
+
export function getCzapHeaderEntries(options) {
|
|
34
|
+
const entries = [];
|
|
35
|
+
if (options.detectEnabled) {
|
|
36
|
+
const acceptCH = options.acceptCH ?? CLIENT_HINTS_HEADERS['Accept-CH'];
|
|
37
|
+
const criticalCH = options.criticalCH ?? CLIENT_HINTS_HEADERS['Critical-CH'];
|
|
38
|
+
if (acceptCH) {
|
|
39
|
+
entries.push(['Accept-CH', acceptCH]);
|
|
40
|
+
}
|
|
41
|
+
if (criticalCH) {
|
|
42
|
+
entries.push(['Critical-CH', criticalCH]);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (options.workersEnabled) {
|
|
46
|
+
for (const [header, value] of Object.entries(CROSS_ORIGIN_HEADERS)) {
|
|
47
|
+
entries.push([header, value]);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return entries;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Apply the czap header set to an existing {@link Headers} bag and
|
|
54
|
+
* return it (for chaining). Convenience wrapper over
|
|
55
|
+
* {@link getCzapHeaderEntries} for middleware that already has a
|
|
56
|
+
* `Headers` object in hand.
|
|
57
|
+
*/
|
|
58
|
+
export function applyCzapHeaders(headers, options) {
|
|
59
|
+
for (const [header, value] of getCzapHeaderEntries(options)) {
|
|
60
|
+
headers.set(header, value);
|
|
61
|
+
}
|
|
62
|
+
return headers;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=headers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.js","sourceRoot":"","sources":["../src/headers.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IAC1D,WAAW,EAAE,wFAAwF;IACrG,aAAa,EAAE,uBAAuB;CACvC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IAC1D,4BAA4B,EAAE,aAAa;IAC3C,8BAA8B,EAAE,cAAc;CAC/C,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAKpC;IACC,MAAM,OAAO,GAAqC,EAAE,CAAC;IAErD,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,oBAAoB,CAAC,WAAW,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,oBAAoB,CAAC,aAAa,CAAC,CAAC;QAC7E,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;QAC3B,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAgB,EAChB,OAKC;IAED,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,oBAAoB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@czap/astro` — **LiteShip** on Astro 6: constraint-shaped adaptive
|
|
3
|
+
* projection hosted as islands and directives.
|
|
4
|
+
*
|
|
5
|
+
* Provides the Astro `Integration` that registers `@czap/vite`,
|
|
6
|
+
* injects client tier detection, **rigs** the `client:satellite` directive,
|
|
7
|
+
* and exposes `Satellite` for shells with server-resolved bearings.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // astro.config.mjs
|
|
12
|
+
* import { defineConfig } from 'astro/config';
|
|
13
|
+
* import { integration as czap } from '@czap/astro';
|
|
14
|
+
*
|
|
15
|
+
* const config = defineConfig({
|
|
16
|
+
* integrations: [czap({ themes: ['./themes/default.ts'] })],
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @module
|
|
21
|
+
*/
|
|
22
|
+
export type { IntegrationConfig } from './integration.js';
|
|
23
|
+
export { integration } from './integration.js';
|
|
24
|
+
export type { ServerIslandContext, QuantizeProps } from './quantize.js';
|
|
25
|
+
export { resolveInitialState } from './quantize.js';
|
|
26
|
+
export { satelliteAttrs, resolveInitialStateFallback } from './Satellite.js';
|
|
27
|
+
export type { SatelliteProps } from './Satellite.js';
|
|
28
|
+
export { czapMiddleware } from './middleware.js';
|
|
29
|
+
export type { CzapLocals, CzapMiddlewareConfig } from './middleware.js';
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7E,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@czap/astro` — **LiteShip** on Astro 6: constraint-shaped adaptive
|
|
3
|
+
* projection hosted as islands and directives.
|
|
4
|
+
*
|
|
5
|
+
* Provides the Astro `Integration` that registers `@czap/vite`,
|
|
6
|
+
* injects client tier detection, **rigs** the `client:satellite` directive,
|
|
7
|
+
* and exposes `Satellite` for shells with server-resolved bearings.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // astro.config.mjs
|
|
12
|
+
* import { defineConfig } from 'astro/config';
|
|
13
|
+
* import { integration as czap } from '@czap/astro';
|
|
14
|
+
*
|
|
15
|
+
* const config = defineConfig({
|
|
16
|
+
* integrations: [czap({ themes: ['./themes/default.ts'] })],
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @module
|
|
21
|
+
*/
|
|
22
|
+
export { integration } from './integration.js';
|
|
23
|
+
export { resolveInitialState } from './quantize.js';
|
|
24
|
+
export { satelliteAttrs, resolveInitialStateFallback } from './Satellite.js';
|
|
25
|
+
export { czapMiddleware } from './middleware.js';
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|