@owlmeans/server-context 0.1.18-rc.11 → 0.1.18-rc.13
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
CHANGED
|
@@ -12,7 +12,7 @@ Server-side context factory with file-based config, trusted keys, and Ed25519 gu
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
bun add @owlmeans/server-context
|
|
15
|
+
bun add @owlmeans/server-context@^0.1.18-rc.11
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
@@ -70,7 +70,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
70
70
|
your project's skill store (`.agents/skills/`):
|
|
71
71
|
|
|
72
72
|
```sh
|
|
73
|
-
npx @owlmeans/agent-skills
|
|
73
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.13
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/server-context",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.13",
|
|
5
|
+
"generatedAt": "2026-09-10T18:54:42.496Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: server-context
|
|
3
|
-
description: How to use @owlmeans/server-context —
|
|
3
|
+
description: How to use @owlmeans/server-context — makeServerContext() as the base of a server makeContext(), the ServerConfig shape, config() to build one, and the fileConfigReader middleware. Auto-invoked when building a server context or asking what a bare server context already carries.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
@@ -8,19 +8,50 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/server-context
|
|
9
9
|
|
|
10
10
|
**Layer:** Server
|
|
11
|
-
**Install:** `"@owlmeans/server-context": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/server-context": "^0.1.18-rc.13"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
## Key Exports
|
|
14
14
|
|
|
15
15
|
| Export | Description |
|
|
16
16
|
|--------|-------------|
|
|
17
|
-
| `makeServerContext` | Server context factory — the base your `makeContext` builds on |
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
17
|
+
| `makeServerContext(cfg)` | Server context factory — the base your `makeContext` builds on |
|
|
18
|
+
| `config(service, cfg?)` | Build a `ServerConfig` for `service` — app type `Backend`, `trusted` defaulted to an empty list |
|
|
19
|
+
| `ServerContext<C>` | Server-side context interface — a basic context plus the config-resource accessors |
|
|
20
|
+
| `ServerConfig` | Server config shape — the server and client config bases plus `services: Record<string, ServiceRoute>` |
|
|
20
21
|
|
|
21
22
|
## Subpath Exports
|
|
22
23
|
|
|
23
|
-
- `./utils` —
|
|
24
|
+
- `./utils` — `fileConfigReader`, the config-reading middleware
|
|
25
|
+
|
|
26
|
+
## What a bare server context already carries
|
|
27
|
+
|
|
28
|
+
`makeServerContext` is not an empty container. Before it returns it registers:
|
|
29
|
+
|
|
30
|
+
- `fileConfigReader` — a `Config`/`Configuration`-stage middleware that walks the whole config tree
|
|
31
|
+
and replaces every writable string starting with `/` by that file's trimmed contents (through
|
|
32
|
+
`readConfigValue` from `@owlmeans/server-config`, so mount secrets at absolute paths). This is how
|
|
33
|
+
a mounted secret becomes a plain config value.
|
|
34
|
+
|
|
35
|
+
**Read converted values after `init()`, never straight after `configure()`.** `configure()` is not
|
|
36
|
+
an async function: it starts the `Config`/`Configuration` middlewares in a detached promise and
|
|
37
|
+
returns the context immediately, so nothing in the tree is converted yet when it returns. The
|
|
38
|
+
ordering guarantee comes from `waitForConfigured()`, and from `init()`, which awaits it first.
|
|
39
|
+
|
|
40
|
+
That detachment also decides how a bad path fails. `readConfigValue` is synchronous and unguarded,
|
|
41
|
+
and the middleware runner is a bare `Promise.all` with no catch, so a config string that looks
|
|
42
|
+
like a path but names no file does **not** throw out of `configure()` — the `ENOENT` escapes as an
|
|
43
|
+
unhandled rejection. The stage is never advanced past `Configuration` either, so the promise
|
|
44
|
+
`init()` awaits never resolves and the boot hangs instead of failing. Read an unhandled `ENOENT`
|
|
45
|
+
at boot as a missing mount, and install an `unhandledRejection` handler that exits non-zero if the
|
|
46
|
+
boot has to be loud.
|
|
47
|
+
- Three config resources — the default record store, one keyed on `trusted`, and one keyed on
|
|
48
|
+
`plugins` — reachable through `getConfigResource(alias?)`.
|
|
49
|
+
- The basic Ed25519 guard over the `trusted` list, which is what authenticates service-to-service
|
|
50
|
+
calls.
|
|
51
|
+
- `authMiddleware`, which wraps the `invoke` of every guarded backend entrypoint so outbound calls
|
|
52
|
+
carry an authentication header.
|
|
53
|
+
|
|
54
|
+
So a downstream factory adds its own services on top rather than assembling these again.
|
|
24
55
|
|
|
25
56
|
## Usage
|
|
26
57
|
|
|
@@ -29,7 +60,7 @@ the factory below it, applies its own idempotent `append*(context)` mixins and s
|
|
|
29
60
|
registrations, and returns that same context — the process gets one context, built once:
|
|
30
61
|
|
|
31
62
|
```typescript
|
|
32
|
-
//
|
|
63
|
+
// src/context.ts
|
|
33
64
|
import { makeServerContext } from '@owlmeans/server-context'
|
|
34
65
|
import type { ServerConfig, ServerContext } from '@owlmeans/server-context'
|
|
35
66
|
|
|
@@ -40,6 +71,15 @@ export const makeBackendContext = <C extends ServerConfig, T extends ServerConte
|
|
|
40
71
|
}
|
|
41
72
|
```
|
|
42
73
|
|
|
74
|
+
An application server usually starts from `@owlmeans/server-app#makeContext` instead, which builds on
|
|
75
|
+
this and adds the API server, API client, sockets, the static resource and auth.
|
|
76
|
+
|
|
43
77
|
## Depends On
|
|
44
78
|
|
|
45
|
-
|
|
79
|
+
Declared: `@owlmeans/context`, `@owlmeans/config`, `@owlmeans/client-config`,
|
|
80
|
+
`@owlmeans/server-config`, `@owlmeans/route`.
|
|
81
|
+
|
|
82
|
+
Imported but **not** declared in this package's manifest: `@owlmeans/auth-common` (the Ed25519
|
|
83
|
+
guard and the outbound-auth middleware registered above) and `@owlmeans/server-route` (the
|
|
84
|
+
`ServiceRoute` type `ServerConfig` is built from). A workspace resolves them anyway; a standalone
|
|
85
|
+
install has to name them in its own dependencies.
|
package/build/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,YAAY,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,YAAY,WAAW,MAAM,QAAQ,OAAO,CAAC,CAAC,CAAC,KAAG,CAKlF,CAAA"}
|
package/build/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAMxD,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAMxD,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,KAAG,CAY9F,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/server-context",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@owlmeans/client-config": "^0.1.18-rc.
|
|
32
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
33
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
34
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
35
|
-
"@owlmeans/server-config": "^0.1.18-rc.
|
|
31
|
+
"@owlmeans/client-config": "^0.1.18-rc.13",
|
|
32
|
+
"@owlmeans/config": "^0.1.18-rc.13",
|
|
33
|
+
"@owlmeans/context": "^0.1.18-rc.9",
|
|
34
|
+
"@owlmeans/route": "^0.1.18-rc.10",
|
|
35
|
+
"@owlmeans/server-config": "^0.1.18-rc.13"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@owlmeans/dep-config": "workspace:*",
|