org.inovus.flags 1.0.0 → 1.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/AGENT.md +27 -0
- package/README.md +2 -0
- package/package.json +3 -2
package/AGENT.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Agent guide — `org.inovus.flags` (npm)
|
|
2
|
+
|
|
3
|
+
**Monorepo maintainers** (publish, tags, npm): see **[DEVELOP.md](./DEVELOP.md)** — merging to `master` does not publish the SDK.
|
|
4
|
+
|
|
5
|
+
**For consuming applications:** use the README shipped with the npm package. After install:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
node_modules/org.inovus.flags/README.md
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
That file is self-contained — install, env vars, integration pattern, API reference, troubleshooting, and agent rules. **Copy this `AGENT.md` into your app repo** (e.g. `.cursor/rules`, `AGENTS.md`, or `docs/flags-agent.md`) so AI tools implement flags correctly.
|
|
12
|
+
|
|
13
|
+
**Do not** reference monorepo paths, source repositories, or infrastructure setup from application code.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Quick rules for agents
|
|
18
|
+
|
|
19
|
+
1. `npm install org.inovus.flags`
|
|
20
|
+
2. Env: `FLAGS_PROXY_URL`, `FLAGS_API_KEY` only — no infrastructure credentials
|
|
21
|
+
3. `await flags.init(declarations[, context])` once with every flag you read
|
|
22
|
+
4. `flags.getBoolean()` / `getString()` / etc. are **synchronous** — never `await`
|
|
23
|
+
5. `await flags.refresh(context)` after login or targeting changes
|
|
24
|
+
6. Flag keys: hyphens only, product prefix (e.g. `my-app-dark-mode`)
|
|
25
|
+
7. Dashboard **Enabled** ≠ boolean `true`; check **Default** variant and `reason: "DEFAULT"`
|
|
26
|
+
|
|
27
|
+
Full detail: `node_modules/org.inovus.flags/README.md`
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ TypeScript client for Totum feature flags. Call `init()` once at startup, then r
|
|
|
4
4
|
|
|
5
5
|
**Zero runtime dependencies.** Requires global `fetch` (Node 18+, browsers, Workers).
|
|
6
6
|
|
|
7
|
+
> **AI agents & developers:** use **[AGENT.md](./AGENT.md)** — copy into your app repo (`.cursor/rules`, `AGENTS.md`) for correct flag integration. This README is the full reference.
|
|
8
|
+
|
|
7
9
|
---
|
|
8
10
|
|
|
9
11
|
## Install
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "org.inovus.flags",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "TypeScript client for cf-flags-proxy with stale-while-revalidate caching",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
26
|
"LICENSE",
|
|
27
|
-
"README.md"
|
|
27
|
+
"README.md",
|
|
28
|
+
"AGENT.md"
|
|
28
29
|
],
|
|
29
30
|
"scripts": {
|
|
30
31
|
"build": "tsup",
|