@fireweaveai/server-sdk 2.3.1-staging.2 → 3.0.0-staging.1
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 +86 -123
- package/dist/application/client.d.ts +11 -25
- package/dist/application/client.d.ts.map +1 -1
- package/dist/application/client.js +20 -36
- package/dist/application/client.js.map +1 -1
- package/dist/application/ports.d.ts +3 -3
- package/dist/application/ports.d.ts.map +1 -1
- package/dist/application/runtime.d.ts +1 -1
- package/dist/application/runtime.d.ts.map +1 -1
- package/dist/application/runtime.js +23 -23
- package/dist/application/runtime.js.map +1 -1
- package/dist/domain/errors.d.ts +5 -2
- package/dist/domain/errors.d.ts.map +1 -1
- package/dist/domain/errors.js +40 -10
- package/dist/domain/errors.js.map +1 -1
- package/dist/domain/types.d.ts +4 -4
- package/dist/domain/types.d.ts.map +1 -1
- package/dist/domain/validation.d.ts +3 -3
- package/dist/domain/validation.js +6 -6
- package/dist/domain/validation.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/infrastructure/adapters/inmemory.d.ts +1 -1
- package/dist/infrastructure/adapters/inmemory.d.ts.map +1 -1
- package/dist/infrastructure/adapters/inmemory.js +3 -3
- package/dist/infrastructure/adapters/inmemory.js.map +1 -1
- package/dist/infrastructure/adapters/local.d.ts +3 -3
- package/dist/infrastructure/adapters/local.d.ts.map +1 -1
- package/dist/infrastructure/adapters/local.js +3 -3
- package/dist/infrastructure/adapters/local.js.map +1 -1
- package/dist/infrastructure/adapters/remote.d.ts +1 -1
- package/dist/infrastructure/adapters/remote.d.ts.map +1 -1
- package/dist/infrastructure/adapters/remote.js +23 -14
- package/dist/infrastructure/adapters/remote.js.map +1 -1
- package/dist/infrastructure/hosts.js +1 -1
- package/dist/register-browser.d.ts +2 -0
- package/dist/register-browser.d.ts.map +1 -0
- package/dist/register-browser.js +6 -0
- package/dist/register-browser.js.map +1 -0
- package/dist/register.d.ts +2 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +12 -0
- package/dist/register.js.map +1 -0
- package/dist/start/browser.d.ts +13 -0
- package/dist/start/browser.d.ts.map +1 -0
- package/dist/start/browser.js +29 -0
- package/dist/start/browser.js.map +1 -0
- package/dist/start/build-info.d.ts +3 -0
- package/dist/start/build-info.d.ts.map +1 -0
- package/dist/start/build-info.js +7 -0
- package/dist/start/build-info.js.map +1 -0
- package/dist/start/control-points.d.ts +21 -0
- package/dist/start/control-points.d.ts.map +1 -0
- package/dist/start/control-points.js +55 -0
- package/dist/start/control-points.js.map +1 -0
- package/dist/start/env.d.ts +12 -0
- package/dist/start/env.d.ts.map +1 -0
- package/dist/start/env.js +60 -0
- package/dist/start/env.js.map +1 -0
- package/dist/start/fw.d.ts +30 -0
- package/dist/start/fw.d.ts.map +1 -0
- package/dist/start/fw.js +74 -0
- package/dist/start/fw.js.map +1 -0
- package/dist/start/index.d.ts +24 -0
- package/dist/start/index.d.ts.map +1 -0
- package/dist/start/index.js +20 -0
- package/dist/start/index.js.map +1 -0
- package/dist/start/instance.d.ts +18 -0
- package/dist/start/instance.d.ts.map +1 -0
- package/dist/start/instance.js +53 -0
- package/dist/start/instance.js.map +1 -0
- package/dist/start/names.d.ts +33 -0
- package/dist/start/names.d.ts.map +1 -0
- package/dist/start/names.js +33 -0
- package/dist/start/names.js.map +1 -0
- package/dist/start/resolve.d.ts +41 -0
- package/dist/start/resolve.d.ts.map +1 -0
- package/dist/start/resolve.js +152 -0
- package/dist/start/resolve.js.map +1 -0
- package/dist/start/state.d.ts +97 -0
- package/dist/start/state.d.ts.map +1 -0
- package/dist/start/state.js +293 -0
- package/dist/start/state.js.map +1 -0
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -19,7 +19,83 @@ npm install @fireweaveai/server-sdk # or: bun add …
|
|
|
19
19
|
import { initFireweave } from 'npm:@fireweaveai/server-sdk';
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
## Quick start (
|
|
22
|
+
## Quick start (one line: the start profile)
|
|
23
|
+
|
|
24
|
+
Most apps need only this ([ADR-0012](../../docs/adr/0012-start-profile.md)). Two small files and one import:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
// src/fireweave/control-points.ts: every control point the app reads, with its local value
|
|
28
|
+
import { defineControlPoints } from '@fireweaveai/server-sdk/start';
|
|
29
|
+
|
|
30
|
+
export const controlPoints = defineControlPoints({
|
|
31
|
+
'new-checkout': { local: true }, // served only in local mode
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
// src/fireweave/start.ts
|
|
37
|
+
import { start } from '@fireweaveai/server-sdk/start';
|
|
38
|
+
import { controlPoints } from './control-points';
|
|
39
|
+
|
|
40
|
+
start({ controlPoints });
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
// src/main.ts: must be the FIRST import
|
|
45
|
+
import './fireweave/start';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
// any call site
|
|
50
|
+
import { fw } from '@fireweaveai/server-sdk/start';
|
|
51
|
+
|
|
52
|
+
// @fireweave-controlpoint new-checkout
|
|
53
|
+
if (await fw.controlPoints.getBooleanValue('new-checkout', false, { targetingKey: user.id })) { /* … */ }
|
|
54
|
+
await fw.identify(user.id, { plan: user.plan }); // at sign-in
|
|
55
|
+
await fw.controlPoints.getBooleanValue('nightly-reindex', false, { targetingKey: fw.instanceKey() }); // server as subject
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Deployed environments set one variable, `FIREWEAVE_KEY` (the project key, `project-api-key_…`).
|
|
59
|
+
Local development needs nothing when `NODE_ENV` (or `APP_ENV` / `FIREWEAVE_ENV`) is
|
|
60
|
+
`development`, `dev`, `local` or `test`.
|
|
61
|
+
|
|
62
|
+
### Options and overrides
|
|
63
|
+
|
|
64
|
+
Every value resolves as: `start()` option, then env var, then legacy name (warns once), then default.
|
|
65
|
+
|
|
66
|
+
| Option | Env var | Default | What it does |
|
|
67
|
+
| --- | --- | --- | --- |
|
|
68
|
+
| `controlPoints` | — | `{}` | Local values per control point. Ignored in remote mode. |
|
|
69
|
+
| `mode` | — | inferred | `'remote'` or `'local'`. Overrides inference. `'remote'` without a key is a start error; `'local'` ignores a key. |
|
|
70
|
+
| `environment` | `FIREWEAVE_ENV`, `APP_ENV`, `NODE_ENV` | — | Environment name used for inference when there is no key and no `mode`. Pass your own, e.g. `environment: process.env.DEPLOY_STAGE`. |
|
|
71
|
+
| `url` | `FIREWEAVE_URL` (legacy `FW_API_URL`, `FW_ATTEST_URL`) | from the SDK build | A `-staging.N` build calls `staging-app-server.fireweave.ai`; any other calls `app-server.fireweave.ai`. Set it for a self-hosted or local fw-server. |
|
|
72
|
+
| `key` | `FIREWEAVE_KEY` (legacy `FW_PROJECT_API_KEY`) | — | Project key. Pass it to read from your own secret store. Browser keys and vendor keys are rejected at start. |
|
|
73
|
+
| `instanceId` | `FIREWEAVE_INSTANCE_ID` | hash of the host name | Value of `fw.instanceKey()`. Nothing is written to disk. |
|
|
74
|
+
| `env` | — | the process | Read values from this object instead of the environment. |
|
|
75
|
+
| `log` | — | console | Where `[fireweave]` lines go. |
|
|
76
|
+
|
|
77
|
+
**Mode rule.** `mode` wins. Otherwise: a key means remote. No key and a development
|
|
78
|
+
environment name means local. Anything else (including no environment name at all) throws
|
|
79
|
+
at `start()`, naming the variable, so a deploy that forgot its key fails instead of silently
|
|
80
|
+
serving defaults.
|
|
81
|
+
|
|
82
|
+
**Reads never throw.** If start fails, reads return your default (`*Details` return an `ERROR`
|
|
83
|
+
decision). `fw.status()` reports the mode, channel, host and key source, never the key.
|
|
84
|
+
`start()` is idempotent; a second call with a different config throws. Zero-config apps can use
|
|
85
|
+
`import '@fireweaveai/server-sdk/register'` (or `node --import`, `bun --preload`) instead of
|
|
86
|
+
`src/fireweave/start.ts`.
|
|
87
|
+
|
|
88
|
+
**When reads return only defaults.** A revoked or wrong key must not look like a rollout at 0%.
|
|
89
|
+
When fw-server refuses the key (HTTP 401 or 403), rate-limits it (429) or cannot be reached
|
|
90
|
+
(network error, timeout, 5xx), the start profile logs **one** `[fireweave]` line per kind for the
|
|
91
|
+
life of the process, naming where the key came from (`FIREWEAVE_KEY`, `FW_PROJECT_API_KEY` or
|
|
92
|
+
`start({ key })`) or the endpoint host, never the key itself. `fw.status().lastErrorKind` holds
|
|
93
|
+
the kind of the latest failed request (`Authentication`, `Authorization`, `RateLimited`,
|
|
94
|
+
`Network`, `Timeout` or `BackendUnavailable`). It is sticky: once requests succeed again, reads
|
|
95
|
+
return real values, but `lastErrorKind` keeps the last failure and the line is not logged again.
|
|
96
|
+
A fresh `start()` after `fw.shutdown()` clears it.
|
|
97
|
+
|
|
98
|
+
## Quick start (production path, core API)
|
|
23
99
|
|
|
24
100
|
```ts
|
|
25
101
|
import { initFireweave } from '@fireweaveai/server-sdk';
|
|
@@ -81,10 +157,8 @@ const fireweave = new FireweaveClient(runtime);
|
|
|
81
157
|
await fireweave.initialize();
|
|
82
158
|
```
|
|
83
159
|
|
|
84
|
-
The
|
|
85
|
-
|
|
86
|
-
"Control point" is the product noun; `flagKey` is its key at those boundaries
|
|
87
|
-
([ADR-0007](../../docs/adr/0007-control-point-vocabulary.md)).
|
|
160
|
+
The key is `controlPointKey` everywhere, on the wire and in `Decision`, from 3.0.0
|
|
161
|
+
([ADR-0013](../../docs/adr/0013-control-point-wire.md)).
|
|
88
162
|
|
|
89
163
|
## Module layout
|
|
90
164
|
|
|
@@ -93,7 +167,7 @@ The per-call parameter is `flagKey`, not `controlPointKey` — that name is fixe
|
|
|
93
167
|
| `application/runtime.ts` | Lifecycle state machine, config validation, context policy, decision construction. Evaluation never throws. |
|
|
94
168
|
| `application/client.ts` | `FireweaveClient` — `controlPoints`, `registerTarget`. |
|
|
95
169
|
| `application/mode.ts` | `initFireweave` — the single entry point; the only module allowed to import concrete adapters. |
|
|
96
|
-
| `infrastructure/adapters/remote.ts` | `FireweaveRemoteAdapter` — the production backend (`/v1/
|
|
170
|
+
| `infrastructure/adapters/remote.ts` | `FireweaveRemoteAdapter` — the production backend (`/v1/control-points/evaluate`, `/v1/targets/register`). |
|
|
97
171
|
| `infrastructure/adapters/inmemory.ts` | Deterministic fixture-driven adapter for tests and conformance. |
|
|
98
172
|
| `infrastructure/adapters/local.ts` | `FireweaveLocalAdapter` — the DEV substrate `initFireweave({ mode: 'local' })` builds. |
|
|
99
173
|
| `application/ports.ts` | The `BackendAdapter` boundary. |
|
|
@@ -110,122 +184,12 @@ The SDK reads no environment variables (spec/modes.md) — every option is an ex
|
|
|
110
184
|
| --- | --- | --- |
|
|
111
185
|
| `apiUrl` | `remote` | fw-server base URL (required) |
|
|
112
186
|
| `apiKey` | `remote` | Fireweave project key (`project-api-key_…`) (required) |
|
|
113
|
-
| `allowedHosts` | `remote` | SSRF allowlist override
|
|
187
|
+
| `allowedHosts` | `remote` | SSRF allowlist override |
|
|
114
188
|
| `local.controlPoints` | `local` | seeded boolean overrides; a present key resolves `STATIC`, an absent key misses to the caller's default with reason `DEFAULT` |
|
|
115
189
|
|
|
116
|
-
## Upgrading from
|
|
117
|
-
|
|
118
|
-
**Only one change is mandatory.** If you imported the direct vendor adapter, swap it. Everything else from v2 still works, so most of this section exists to tell you what you *don't* have to do.
|
|
119
|
-
|
|
120
|
-
### Does this affect me?
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
# Mandatory to fix (any hit ⇒ migration required)
|
|
124
|
-
rg -n "@fireweaveai/server-sdk/posthog|PostHogAdapter"
|
|
125
|
-
rg -n '"posthog-node"' package.json
|
|
126
|
-
|
|
127
|
-
# Configuration that moves
|
|
128
|
-
rg -n "POSTHOG_HOST|POSTHOG_API_KEY|POSTHOG_PROJECT_API_KEY"
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
No hits? Bump the version; you are done.
|
|
132
|
-
|
|
133
|
-
### 1. Swap the adapter (required)
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
// before
|
|
137
|
-
import { PostHogAdapter } from '@fireweaveai/server-sdk/posthog';
|
|
138
|
-
const adapter = new PostHogAdapter({
|
|
139
|
-
projectApiKey: process.env.POSTHOG_API_KEY,
|
|
140
|
-
host: process.env.POSTHOG_HOST,
|
|
141
|
-
featureFlagsRequestTimeoutMs: 3000,
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
// after
|
|
145
|
-
import { initFireweave } from '@fireweaveai/server-sdk';
|
|
146
|
-
const fireweave = await initFireweave({
|
|
147
|
-
mode: 'remote',
|
|
148
|
-
apiUrl: process.env.FW_API_URL!,
|
|
149
|
-
apiKey: process.env.FW_PROJECT_API_KEY!,
|
|
150
|
-
});
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
| v2 option | 2.1 |
|
|
154
|
-
| --- | --- |
|
|
155
|
-
| `projectApiKey` (`phc_…`) | `apiKey` (`project-api-key_…`) |
|
|
156
|
-
| `host` | `apiUrl` |
|
|
157
|
-
| `featureFlagsRequestTimeoutMs` | `requestTimeoutMs` (adapter-level; `initFireweave` does not expose it directly — use *Lower-level construction* above if you need it) |
|
|
158
|
-
| `shutdownTimeoutMs`, `allowedHosts` | unchanged |
|
|
159
|
-
| `secretApiKey`, `onlyEvaluateLocally`, `featureFlagsPollingInterval`, `waitForLocalDefinitions`, `client` | **no equivalent** — see §4 |
|
|
160
|
-
|
|
161
|
-
Then:
|
|
162
|
-
|
|
163
|
-
- Remove `posthog-node` from `package.json` — **unless** you use it for your own analytics capture. Check with `rg "posthog-node"` first.
|
|
164
|
-
- Update deployment config, secret stores, and CI: `POSTHOG_HOST` → `FW_API_URL`, `POSTHOG_API_KEY` → `FW_PROJECT_API_KEY`. **The new key is a Fireweave project key, not a re-labelled vendor key** — it has to be issued from your Fireweave project.
|
|
165
|
-
|
|
166
|
-
### 2. What you do *not* have to change
|
|
167
|
-
|
|
168
|
-
| v2 | Status in 2.1 |
|
|
169
|
-
| --- | --- |
|
|
170
|
-
| `client.flags.evaluate` / `getBooleanValue` / … | works — the same object as `client.controlPoints` |
|
|
171
|
-
| `new InMemoryAdapter({ flags })` | unchanged |
|
|
172
|
-
| `Decision.flagKey`, `flagMetadata` | unchanged |
|
|
173
|
-
| `FlagValueType`, `InMemoryFlagDefinition`, `ExpectedFlagType` | unchanged |
|
|
174
|
-
| every other v2 export | unchanged |
|
|
175
|
-
|
|
176
|
-
`client.flags === client.controlPoints` — a getter returning the same instance, not a copy. It is
|
|
177
|
-
marked `@deprecated` in JSDoc and **is not scheduled for removal in the 2.x line**; retiring it
|
|
178
|
-
would need its own major and its own ADR. Renaming your call sites is cosmetic and can be
|
|
179
|
-
deferred indefinitely. Accessing `client.flags` is silent at runtime — no log line, no env gate —
|
|
180
|
-
because the SDK reads no environment variables regardless (spec/modes.md); the deprecation is
|
|
181
|
-
conveyed by JSDoc only.
|
|
182
|
-
|
|
183
|
-
### 3. Two type-level narrowings
|
|
184
|
-
|
|
185
|
-
`'posthog'` is no longer a member of `BackendAdapter['name']` or `Capabilities['runtime']['backend']`.
|
|
186
|
-
|
|
187
|
-
- A custom adapter declaring `name: 'posthog'` → use `'other'`.
|
|
188
|
-
- An exhaustive `switch` on `backend` with a `case 'posthog'` → that arm is unreachable; remove it.
|
|
189
|
-
|
|
190
|
-
Both are rare, and `tsc` points straight at them.
|
|
191
|
-
|
|
192
|
-
### 4. Local evaluation is gone
|
|
193
|
-
|
|
194
|
-
v2's vendor adapter could evaluate in-process from polled definitions with a secret key. 2.1 has no equivalent: caching is fw-server's concern, and both shipped adapters report `localEvaluation: false`.
|
|
195
|
-
|
|
196
|
-
If in-process evaluation is load-bearing for you — an air-gapped service, or a latency floor below one network hop — **stay on v2 for now and tell us**. The interface seam (`AdapterRuntimeFeatures.localEvaluation` / `localOnly`, `AdapterResolution.fromCache`, the `STALE` reason) is deliberately preserved for a future Fireweave-native cache ([ADR-0006](../../docs/adr/0006-node-drops-direct-posthog-adapter.md)).
|
|
197
|
-
|
|
198
|
-
### 5. Worth re-checking
|
|
199
|
-
|
|
200
|
-
1. **`DEFAULT_ALLOWED_HOSTS` changed contents** while keeping its name. It now lists Fireweave hosts, not vendor hosts. Code doing `allowedHosts: [...DEFAULT_ALLOWED_HOSTS, 'mine.example']` keeps compiling and silently stops permitting the old endpoints. That is intended — verify it matches your deployment.
|
|
201
|
-
2. **Move durable attributes to `registerTarget`.** Attributes you resend on every evaluation can be registered once per login. Per-request attributes still override stored properties, so the two compose — this is an optimization, not a cutover. Note that `registerTarget` returns `{ ok }` rather than throwing (it sits in sign-in paths); log `ok: false`, because a silently unregistered target is exactly how targeting rules end up matching nobody.
|
|
202
|
-
|
|
203
|
-
### 6. Verify
|
|
204
|
-
|
|
205
|
-
```bash
|
|
206
|
-
npm install @fireweaveai/server-sdk@latest
|
|
207
|
-
npx tsc --noEmit # catches §3
|
|
208
|
-
<your test command>
|
|
209
|
-
rg -n "@fireweaveai/server-sdk/posthog|PostHogAdapter" # expect no hits
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
At runtime, a boolean read against a known-on control point should resolve `true` with reason
|
|
213
|
-
`TARGETING_MATCH`/`SPLIT`/`STATIC` (never `ERROR`); if it resolves the default with reason
|
|
214
|
-
`ERROR`, the remote adapter was never wired in correctly — check `apiUrl`/`apiKey`.
|
|
215
|
-
|
|
216
|
-
### Rollback
|
|
217
|
-
|
|
218
|
-
```bash
|
|
219
|
-
npm install @fireweaveai/server-sdk@2 # re-add posthog-node if you removed it
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Revert the adapter swap and the env vars. No data migration is involved, so rollback is code and config only.
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
## Renaming `flags` → `controlPoints` safely
|
|
190
|
+
## Upgrading from 2.x: `flags` → `controlPoints`
|
|
227
191
|
|
|
228
|
-
|
|
192
|
+
`client.flags` was removed in 3.0.0 ([ADR-0013](../../docs/adr/0013-control-point-wire.md)); use `client.controlPoints`, which is the same object it returned. `Decision.flagKey` is now `Decision.controlPointKey`, the error kind `FlagNotFound` is `ControlPointNotFound`, and the start option `flags` is `controlPoints` (`defineControlPoints`). Scope the edit. `flags` is an ordinary word: your repo very likely contains feature-flag code, config keys, DB columns, and `flags` variables that have nothing to do with this SDK.
|
|
229
193
|
|
|
230
194
|
**Rename only `.flags` accesses whose receiver is provably a `FireweaveClient`** — traceable to a `new FireweaveClient(...)`/`initFireweave(...)` call, an imported binding assigned from one, or a parameter annotated `FireweaveClient`.
|
|
231
195
|
|
|
@@ -234,12 +198,11 @@ Never rename:
|
|
|
234
198
|
| Looks similar | Why it stays |
|
|
235
199
|
| --- | --- |
|
|
236
200
|
| `new InMemoryAdapter({ flags: … })` | SDK option key, unchanged |
|
|
237
|
-
| `
|
|
238
|
-
| `features.flags` in the capability matrix | still `true`; removing it fails conformance |
|
|
201
|
+
| `FlagValueType`, `InMemoryFlagDefinition` | SDK API, unchanged |
|
|
239
202
|
| your own `flags` variables, `featureFlags`, CLI `--flags`, `flags` columns | not this SDK |
|
|
240
203
|
| another vendor's SDK (`ldClient.variation`, flagd, Unleash) | not this SDK |
|
|
241
204
|
|
|
242
|
-
**Do not run a repo-wide `flags` → `controlPoints` replacement** — not with `sed`, not with editor replace-all. Go call site by call site, and when a receiver is ambiguous, leave it.
|
|
205
|
+
**Do not run a repo-wide `flags` → `controlPoints` replacement** — not with `sed`, not with editor replace-all. Go call site by call site, and when a receiver is ambiguous, leave it. The compiler finds a missed rename; a wrong one breaks unrelated code.
|
|
243
206
|
|
|
244
207
|
## Development
|
|
245
208
|
|
|
@@ -256,7 +219,7 @@ deno run --allow-read scripts/smoke-runtimes.mjs
|
|
|
256
219
|
|
|
257
220
|
## Documentation
|
|
258
221
|
|
|
259
|
-
Full docs live in [`docs/`](../../docs/): [
|
|
222
|
+
Full docs live in [`docs/`](../../docs/): [remote adapter](../../docs/remote.md) · [runtimes](../../docs/runtimes.md) · [testing](../../docs/testing.md) · [troubleshooting](../../docs/troubleshooting.md) · [ADRs](../../docs/adr/).
|
|
260
223
|
|
|
261
224
|
## License
|
|
262
225
|
|
|
@@ -20,20 +20,18 @@ export interface ExtensionResult {
|
|
|
20
20
|
* Decision-returning evaluation without reaching into the runtime. Never throws
|
|
21
21
|
* — errors surface as ERROR decisions, exactly like the OpenFeature path.
|
|
22
22
|
*
|
|
23
|
-
* "Control point" is the Fireweave product noun (ADR-0007)
|
|
24
|
-
*
|
|
25
|
-
* spec, by `spec/decision.schema.json`, and by the `/v1/flags/evaluate` wire
|
|
26
|
-
* contract shared with the Python, Go, and Java SDKs.
|
|
23
|
+
* "Control point" is the Fireweave product noun (ADR-0007), on the wire too
|
|
24
|
+
* from 3.0.0 (ADR-0013).
|
|
27
25
|
*/
|
|
28
26
|
export declare class ControlPointsApi {
|
|
29
27
|
private readonly runtime;
|
|
30
28
|
constructor(runtime: FireweaveRuntime);
|
|
31
29
|
/** Evaluate a flag to a canonical Decision (detailed evaluation). */
|
|
32
|
-
evaluate(
|
|
33
|
-
getBooleanValue(
|
|
34
|
-
getStringValue(
|
|
35
|
-
getNumberValue(
|
|
36
|
-
getObjectValue(
|
|
30
|
+
evaluate(controlPointKey: string, expectedType: ExpectedFlagType, defaultValue: JsonValue, context?: ContextInput, options?: EvaluateOptions): Promise<Decision>;
|
|
31
|
+
getBooleanValue(controlPointKey: string, defaultValue: boolean, context?: ContextInput): Promise<boolean>;
|
|
32
|
+
getStringValue(controlPointKey: string, defaultValue: string, context?: ContextInput): Promise<string>;
|
|
33
|
+
getNumberValue(controlPointKey: string, defaultValue: number, context?: ContextInput): Promise<number>;
|
|
34
|
+
getObjectValue(controlPointKey: string, defaultValue: JsonValue, context?: ContextInput): Promise<JsonValue>;
|
|
37
35
|
/**
|
|
38
36
|
* Detailed reads — the whole {@link Decision} rather than just its value.
|
|
39
37
|
*
|
|
@@ -43,28 +41,16 @@ export declare class ControlPointsApi {
|
|
|
43
41
|
* `variant` or `error` was the OpenFeature provider's `resolve*Evaluation`,
|
|
44
42
|
* so detailed evaluation was unreachable without installing OpenFeature.
|
|
45
43
|
*/
|
|
46
|
-
getBooleanDetails(
|
|
47
|
-
getStringDetails(
|
|
48
|
-
getNumberDetails(
|
|
49
|
-
getObjectDetails(
|
|
44
|
+
getBooleanDetails(controlPointKey: string, defaultValue: boolean, context?: ContextInput): Promise<Decision>;
|
|
45
|
+
getStringDetails(controlPointKey: string, defaultValue: string, context?: ContextInput): Promise<Decision>;
|
|
46
|
+
getNumberDetails(controlPointKey: string, defaultValue: number, context?: ContextInput): Promise<Decision>;
|
|
47
|
+
getObjectDetails(controlPointKey: string, defaultValue: JsonValue, context?: ContextInput): Promise<Decision>;
|
|
50
48
|
}
|
|
51
49
|
export interface FireweaveClientOptions {
|
|
52
50
|
}
|
|
53
51
|
export declare class FireweaveClient {
|
|
54
52
|
readonly runtime: FireweaveRuntime;
|
|
55
53
|
readonly controlPoints: ControlPointsApi;
|
|
56
|
-
/**
|
|
57
|
-
* Control-point evaluation under its former name.
|
|
58
|
-
*
|
|
59
|
-
* @deprecated Renamed to {@link FireweaveClient.controlPoints} (ADR-0007).
|
|
60
|
-
* Identical and fully supported — `client.flags === client.controlPoints`, so
|
|
61
|
-
* no migration is required and none is planned. Silent at runtime: the alias
|
|
62
|
-
* is permanent, not scheduled for removal, so there is nothing to warn a
|
|
63
|
-
* caller toward — deprecation is conveyed by this doc comment only (no log,
|
|
64
|
-
* and no env gate to control one, since the SDK reads no environment
|
|
65
|
-
* variables regardless — spec/modes.md).
|
|
66
|
-
*/
|
|
67
|
-
get flags(): ControlPointsApi;
|
|
68
54
|
constructor(runtime: FireweaveRuntime, _options?: FireweaveClientOptions);
|
|
69
55
|
/**
|
|
70
56
|
* Register durable targeting facts for a target (spec/modes.md).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/application/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAA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AAM,WAAW,sBAAsB;CAAG;AAE1C,qBAAa,eAAe;IAC1B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,gBAAgB,CAAC;gBAE7B,OAAO,EAAE,gBAAgB,EAAE,QAAQ,GAAE,sBAA2B;IAK5E;;;;;;;;;;OAUG;IACH,cAAc,CACZ,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,oBAAoB,CAAC;IAIhC;;;;;;OAMG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,eAAe;IAWlF,UAAU,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhC"}
|
|
@@ -33,10 +33,8 @@ const lifecycleGate = (runtime) => {
|
|
|
33
33
|
* Decision-returning evaluation without reaching into the runtime. Never throws
|
|
34
34
|
* — errors surface as ERROR decisions, exactly like the OpenFeature path.
|
|
35
35
|
*
|
|
36
|
-
* "Control point" is the Fireweave product noun (ADR-0007)
|
|
37
|
-
*
|
|
38
|
-
* spec, by `spec/decision.schema.json`, and by the `/v1/flags/evaluate` wire
|
|
39
|
-
* contract shared with the Python, Go, and Java SDKs.
|
|
36
|
+
* "Control point" is the Fireweave product noun (ADR-0007), on the wire too
|
|
37
|
+
* from 3.0.0 (ADR-0013).
|
|
40
38
|
*/
|
|
41
39
|
export class ControlPointsApi {
|
|
42
40
|
runtime;
|
|
@@ -44,23 +42,23 @@ export class ControlPointsApi {
|
|
|
44
42
|
this.runtime = runtime;
|
|
45
43
|
}
|
|
46
44
|
/** Evaluate a flag to a canonical Decision (detailed evaluation). */
|
|
47
|
-
evaluate(
|
|
48
|
-
return this.runtime.evaluate(
|
|
45
|
+
evaluate(controlPointKey, expectedType, defaultValue, context, options) {
|
|
46
|
+
return this.runtime.evaluate(controlPointKey, expectedType, defaultValue, context, options ?? {});
|
|
49
47
|
}
|
|
50
|
-
async getBooleanValue(
|
|
51
|
-
const decision = await this.evaluate(
|
|
48
|
+
async getBooleanValue(controlPointKey, defaultValue, context) {
|
|
49
|
+
const decision = await this.evaluate(controlPointKey, 'boolean', defaultValue, context);
|
|
52
50
|
return decision.value;
|
|
53
51
|
}
|
|
54
|
-
async getStringValue(
|
|
55
|
-
const decision = await this.evaluate(
|
|
52
|
+
async getStringValue(controlPointKey, defaultValue, context) {
|
|
53
|
+
const decision = await this.evaluate(controlPointKey, 'string', defaultValue, context);
|
|
56
54
|
return decision.value;
|
|
57
55
|
}
|
|
58
|
-
async getNumberValue(
|
|
59
|
-
const decision = await this.evaluate(
|
|
56
|
+
async getNumberValue(controlPointKey, defaultValue, context) {
|
|
57
|
+
const decision = await this.evaluate(controlPointKey, 'number', defaultValue, context);
|
|
60
58
|
return decision.value;
|
|
61
59
|
}
|
|
62
|
-
async getObjectValue(
|
|
63
|
-
const decision = await this.evaluate(
|
|
60
|
+
async getObjectValue(controlPointKey, defaultValue, context) {
|
|
61
|
+
const decision = await this.evaluate(controlPointKey, 'object', defaultValue, context);
|
|
64
62
|
return decision.value;
|
|
65
63
|
}
|
|
66
64
|
/**
|
|
@@ -72,17 +70,17 @@ export class ControlPointsApi {
|
|
|
72
70
|
* `variant` or `error` was the OpenFeature provider's `resolve*Evaluation`,
|
|
73
71
|
* so detailed evaluation was unreachable without installing OpenFeature.
|
|
74
72
|
*/
|
|
75
|
-
getBooleanDetails(
|
|
76
|
-
return this.evaluate(
|
|
73
|
+
getBooleanDetails(controlPointKey, defaultValue, context) {
|
|
74
|
+
return this.evaluate(controlPointKey, 'boolean', defaultValue, context);
|
|
77
75
|
}
|
|
78
|
-
getStringDetails(
|
|
79
|
-
return this.evaluate(
|
|
76
|
+
getStringDetails(controlPointKey, defaultValue, context) {
|
|
77
|
+
return this.evaluate(controlPointKey, 'string', defaultValue, context);
|
|
80
78
|
}
|
|
81
|
-
getNumberDetails(
|
|
82
|
-
return this.evaluate(
|
|
79
|
+
getNumberDetails(controlPointKey, defaultValue, context) {
|
|
80
|
+
return this.evaluate(controlPointKey, 'number', defaultValue, context);
|
|
83
81
|
}
|
|
84
|
-
getObjectDetails(
|
|
85
|
-
return this.evaluate(
|
|
82
|
+
getObjectDetails(controlPointKey, defaultValue, context) {
|
|
83
|
+
return this.evaluate(controlPointKey, 'object', defaultValue, context);
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
/**
|
|
@@ -96,20 +94,6 @@ const SUPPORTED_CAPABILITIES = Object.freeze([]);
|
|
|
96
94
|
export class FireweaveClient {
|
|
97
95
|
runtime;
|
|
98
96
|
controlPoints;
|
|
99
|
-
/**
|
|
100
|
-
* Control-point evaluation under its former name.
|
|
101
|
-
*
|
|
102
|
-
* @deprecated Renamed to {@link FireweaveClient.controlPoints} (ADR-0007).
|
|
103
|
-
* Identical and fully supported — `client.flags === client.controlPoints`, so
|
|
104
|
-
* no migration is required and none is planned. Silent at runtime: the alias
|
|
105
|
-
* is permanent, not scheduled for removal, so there is nothing to warn a
|
|
106
|
-
* caller toward — deprecation is conveyed by this doc comment only (no log,
|
|
107
|
-
* and no env gate to control one, since the SDK reads no environment
|
|
108
|
-
* variables regardless — spec/modes.md).
|
|
109
|
-
*/
|
|
110
|
-
get flags() {
|
|
111
|
-
return this.controlPoints;
|
|
112
|
-
}
|
|
113
97
|
constructor(runtime, _options = {}) {
|
|
114
98
|
this.runtime = runtime;
|
|
115
99
|
this.controlPoints = new ControlPointsApi(runtime);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/application/client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAA2B,MAAM,qBAAqB,CAAC;AAc9E,MAAM,OAAO,GAAG,CAAC,GAAmB,EAAE,QAAQ,GAAG,KAAK,EAAmB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,cAAc,CACZ,YAAoB,EACpB,UAAiC,EAAE;QAEnC,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,UAAkB,EAAE,KAAiC;QACpE,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACjD,OAAO,OAAO,CAAC,IAAI,cAAc,CAAC,uBAAuB,CAAC,EAAE,IAAI,CAAC,CAAC;QACpE,CAAC;QACD,IAAI,UAAU,KAAK,kBAAkB,EAAE,CAAC;YACtC,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9C,IAAI,SAAS,KAAK,SAAS;gBAAE,OAAO,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAoB;QACnC,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -45,7 +45,7 @@ export interface AdapterResolution {
|
|
|
45
45
|
/** Flag definition version. */
|
|
46
46
|
version?: number;
|
|
47
47
|
/** Vendor-side numeric flag id. */
|
|
48
|
-
|
|
48
|
+
vendorControlPointId?: number;
|
|
49
49
|
/** Optional flag payload (object or pre-serialized JSON string). */
|
|
50
50
|
payload?: JsonValue;
|
|
51
51
|
/** True when the /flags response reported quota limiting. */
|
|
@@ -65,7 +65,7 @@ export interface AdapterRuntimeFeatures {
|
|
|
65
65
|
groupAnalytics?: boolean;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
-
* Backend adapter boundary
|
|
68
|
+
* Backend adapter boundary. Adapters translate
|
|
69
69
|
* canonical requests to vendor protocols; they never see OpenFeature types.
|
|
70
70
|
*/
|
|
71
71
|
export interface BackendAdapter {
|
|
@@ -74,7 +74,7 @@ export interface BackendAdapter {
|
|
|
74
74
|
/** Bring the backend to a usable state. Reject with FireweaveError on failure. */
|
|
75
75
|
initialize(signal?: AbortSignal): Promise<void>;
|
|
76
76
|
/** Resolve one flag. Throws FireweaveError for transport/auth/parse faults. */
|
|
77
|
-
resolve(
|
|
77
|
+
resolve(controlPointKey: string, context: CanonicalContext, options?: ResolveOptions): Promise<AdapterResolution>;
|
|
78
78
|
/**
|
|
79
79
|
* Register a user or device so rules can target its durable properties
|
|
80
80
|
* (optional capability). Resolves with `ok: false` rather than throwing —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../src/application/ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,WAAW,qBAAqB;IACpC,0BAA0B;IAC1B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACvC,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,uFAAuF;AACvF,MAAM,WAA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,OAAO,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAClH;;;;OAIG;IACH,cAAc,CAAC,CACb,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,sDAAsD;IACtD,cAAc,CAAC,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1C,uFAAuF;IACvF,YAAY,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,0CAA0C;IAC1C,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,6CAA6C;IAC7C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,IAAI,sBAAsB,CAAC;CACpC"}
|
|
@@ -80,7 +80,7 @@ export declare class FireweaveRuntime {
|
|
|
80
80
|
* type, (3) context, (4) lifecycle. Only once all four pass does this
|
|
81
81
|
* reach the adapter (the one I/O call in this method).
|
|
82
82
|
*/
|
|
83
|
-
evaluate(
|
|
83
|
+
evaluate(controlPointKey: string, expectedType: ExpectedFlagType, defaultValue: JsonValue, invocationContext?: ContextInput, options?: EvaluateOptions): Promise<Decision>;
|
|
84
84
|
/**
|
|
85
85
|
* Register a user or device so flag rules can target its DURABLE properties.
|
|
86
86
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/application/runtime.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,aAAa,EAEnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAEV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AACpB,OAAO,KAA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