@acrylblends/web 0.0.0-stage → 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/README.md +4 -2
- package/cordis.patch.yml +3 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +22 -0
- package/lib/index.js.map +1 -0
- package/package.json +52 -4
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# acryl-web
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `acrylWeb` service of the IDE port: ACRYL's plugins inject it for the address the page is served from (the loopback check, an origin handed to a child process) and for nothing else. Here the carrier is DSH's `webServer`; routes and upgrades stay with the framework's router (`ctx.router`, `ctx.routerHttp`).
|
|
4
|
+
|
|
5
|
+
Provided inside one effect: a replaced carrier re-binds the service and unloading the plugin removes it. Ported from ACRYL (`runtime/acryl-harness-runtime/src/engine-web.ts`, `runtime/acryl-control/src/platform/web.ts`) for the IDE port, slice 1 ([plan](../../docs/plans/ide-port.md)); provenance in [`provenance.json`](provenance.json).
|
package/cordis.patch.yml
ADDED
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `acrylWeb` service: where the thing that serves the page listens, and nothing else.
|
|
3
|
+
*
|
|
4
|
+
* Ported from ACRYL (`runtime/acryl-harness-runtime/src/engine-web.ts` and `runtime/acryl-control/src/platform/web.ts`): ACRYL's plugins inject
|
|
5
|
+
* `acrylWeb` only for the address itself (the loopback check, an origin to hand to a child process), never a harness service, so the carrier behind
|
|
6
|
+
* it can change without touching them. Here the carrier is DSH's `webServer`; routes and upgrades stay with the framework's router
|
|
7
|
+
* (`ctx.router`, `ctx.routerHttp`). The service is provided inside one effect, so a carrier that is replaced re-binds it and a plugin unload removes it.
|
|
8
|
+
*/
|
|
9
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
10
|
+
export declare const name = "@acrylblends/web";
|
|
11
|
+
export declare const inject: string[];
|
|
12
|
+
export declare function apply(ctx: Context): void;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/index.ts
|
|
2
|
+
const name = "@acrylblends/web";
|
|
3
|
+
const inject = ["webServer"];
|
|
4
|
+
function apply(ctx) {
|
|
5
|
+
ctx.effect(() => {
|
|
6
|
+
const dispose = ctx.reflect.provide("acrylWeb", {
|
|
7
|
+
get host() {
|
|
8
|
+
return ctx.webServer.host;
|
|
9
|
+
},
|
|
10
|
+
get port() {
|
|
11
|
+
return ctx.webServer.port;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
return () => {
|
|
15
|
+
dispose();
|
|
16
|
+
};
|
|
17
|
+
}, "acryl-web: acrylWeb");
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { apply, inject, name };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * The `acrylWeb` service: where the thing that serves the page listens, and nothing else.\n *\n * Ported from ACRYL (`runtime/acryl-harness-runtime/src/engine-web.ts` and `runtime/acryl-control/src/platform/web.ts`): ACRYL's plugins inject\n * `acrylWeb` only for the address itself (the loopback check, an origin to hand to a child process), never a harness service, so the carrier behind\n * it can change without touching them. Here the carrier is DSH's `webServer`; routes and upgrades stay with the framework's router\n * (`ctx.router`, `ctx.routerHttp`). The service is provided inside one effect, so a carrier that is replaced re-binds it and a plugin unload removes it.\n */\nimport type { Context } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-host-webserver'\nimport type { AcrylWeb } from 'acryl-control'\n\n// The service's contract is declared once, by the ported acryl-control (`src/platform/web.ts`), so this package only provides it. ACRYL's own source at\n// 37f4dd9c carries the same type without the two registration methods (spec 048 T008 took them out); the port carries the earlier shape, reported to the\n// port owner, and what this adapter provides is the address those plugins actually read.\n\nexport const name = 'acryl-web'\nexport const inject = ['webServer']\n\nexport function apply(ctx: Context): void {\n ctx.effect(() => {\n const port: AcrylWeb = {\n get host() {\n return ctx.webServer.host\n },\n get port() {\n return ctx.webServer.port\n },\n }\n const dispose = ctx.reflect.provide('acrylWeb', port)\n return () => {\n void dispose()\n }\n }, 'acryl-web: acrylWeb')\n}\n"],"mappings":";AAgBA,MAAa,OAAO;AACpB,MAAa,SAAS,CAAC,WAAW;AAElC,SAAgB,MAAM,KAAoB;CACxC,IAAI,aAAa;EASf,MAAM,UAAU,IAAI,QAAQ,QAAQ,YAAY;GAP9C,IAAI,OAAO;IACT,OAAO,IAAI,UAAU;GACvB;GACA,IAAI,OAAO;IACT,OAAO,IAAI,UAAU;GACvB;EAEiD,CAAC;EACpD,aAAa;GACX,QAAa;EACf;CACF,GAAG,qBAAqB;AAC1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acrylblends/web",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The acrylWeb service for the IDE port: where the carrier serves the page (DSH's webServer today), so ACRYL's plugins can check the loopback address without injecting a harness service.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/acrylblends/acrylblends.git",
|
|
9
|
+
"directory": "ide/acryl-web"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "lib/index.js",
|
|
13
|
+
"types": "lib/types/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./lib/types/index.d.ts",
|
|
17
|
+
"default": "./lib/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"dsh": {
|
|
22
|
+
"bundle": {
|
|
23
|
+
"patch": "./cordis.patch.yml"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"cordis.patch.yml",
|
|
28
|
+
"lib/**",
|
|
29
|
+
"README.md"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "node scripts/clean.mjs && tsdown && tsc -p tsconfig.json --emitDeclarationOnly",
|
|
36
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.tests.json --noEmit",
|
|
37
|
+
"test": "vitest run",
|
|
38
|
+
"check": "pnpm run build && pnpm run typecheck && pnpm run test"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
42
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@deepseek-ai/cordis": "4.0.4",
|
|
46
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2",
|
|
47
|
+
"@types/node": "^24.0.0",
|
|
48
|
+
"tsdown": "0.23.0",
|
|
49
|
+
"typescript": "6.0.3",
|
|
50
|
+
"vitest": "5.0.3",
|
|
51
|
+
"@acrylblends/control": "^0.2.5"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {}
|
|
54
|
+
}
|