@withandeo/cli 0.19.10 → 0.19.11
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/dist/api.d.ts +0 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +0 -2
- package/dist/api.js.map +1 -1
- package/dist/contracts.d.ts +8 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/flagship-browser.d.ts +18 -0
- package/dist/flagship-browser.d.ts.map +1 -0
- package/dist/flagship-browser.js +63 -0
- package/dist/flagship-browser.js.map +1 -0
- package/dist/flagship-contract.d.ts +4 -37
- package/dist/flagship-contract.d.ts.map +1 -1
- package/dist/flagship-contract.js +23 -65
- package/dist/flagship-contract.js.map +1 -1
- package/dist/flagship-definition.d.ts +67 -0
- package/dist/flagship-definition.d.ts.map +1 -0
- package/dist/flagship-definition.js +207 -0
- package/dist/flagship-definition.js.map +1 -0
- package/dist/flagship-runtime.d.ts +57 -0
- package/dist/flagship-runtime.d.ts.map +1 -0
- package/dist/flagship-runtime.js +79 -0
- package/dist/flagship-runtime.js.map +1 -0
- package/dist/main.js +74 -38
- package/dist/main.js.map +1 -1
- package/package.json +7 -2
- package/skill/publication.json +1 -1
- package/skill/tender-accounts/SKILL.md +1 -1
- package/skill/tender-accounts/references/feature-flags.md +140 -69
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withandeo/cli",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.11",
|
|
4
4
|
"description": "Developer CLI for Andeo applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
"prepack": "npm run sync:starter && npm run check"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
+
"@cloudflare/flagship": "0.5.0",
|
|
31
|
+
"@openfeature/server-sdk": "1.23.0",
|
|
30
32
|
"@types/node": "^26.2.0",
|
|
31
33
|
"typescript": "^7.0.2",
|
|
32
34
|
"vitest": "^4.1.11"
|
|
@@ -39,7 +41,10 @@
|
|
|
39
41
|
"smol-toml": "1.8.0"
|
|
40
42
|
},
|
|
41
43
|
"exports": {
|
|
42
|
-
"./cli": "./dist/main.js"
|
|
44
|
+
"./cli": "./dist/main.js",
|
|
45
|
+
"./flagship-runtime": "./dist/flagship-runtime.js",
|
|
46
|
+
"./flagship-browser": "./dist/flagship-browser.js",
|
|
47
|
+
"./package": "./dist/workflow-package.js"
|
|
43
48
|
},
|
|
44
49
|
"publishConfig": {
|
|
45
50
|
"access": "public"
|
package/skill/publication.json
CHANGED
|
@@ -23,7 +23,7 @@ Use `npx @withandeo/cli` as the merchant platform interface. Keep merchant behav
|
|
|
23
23
|
| Define or operate background work | [Workflows](references/workflows.md) |
|
|
24
24
|
| Public configuration or private tokens | [Configuration and secrets](references/configuration-secrets.md) |
|
|
25
25
|
| Declare resources or evolve app-owned state | [Storage](references/storage.md) |
|
|
26
|
-
|
|
|
26
|
+
| Manage typed feature flags, experiments, collections and runtime guards | [Feature flags](references/feature-flags.md); authenticated `feature-flags` skill |
|
|
27
27
|
| Connect private apps or workflow services | [Services](references/services.md) |
|
|
28
28
|
| Custom domains and customer sign-in | [Domains and authentication](references/domains-auth.md) |
|
|
29
29
|
| Diagnose requests or workflow execution | [Observability](references/observability.md) |
|
|
@@ -1,90 +1,161 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Flexible feature flags
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`
|
|
7
|
-
|
|
3
|
+
Andeo wraps native Cloudflare Flagship: boolean/string/number/JSON variants,
|
|
4
|
+
configured defaults, ordered rules, nested targeting and weighted experiments.
|
|
5
|
+
Use `andeo capabilities --json`, `andeo doctor` and the authenticated
|
|
6
|
+
`andeo skills get feature-flags --json`. Local implementation is not hosted proof.
|
|
7
|
+
Use `andeo flagship --help` for this installed version's exact commands.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
production writes require
|
|
13
|
-
|
|
9
|
+
Every remote command requires explicit `--env development|preview|production`,
|
|
10
|
+
tenant enablement and a project grant. Current administrators connect collections
|
|
11
|
+
and perform lifecycle changes; developers edit granted nonproduction flags;
|
|
12
|
+
production writes require current administrator authority; viewers read only.
|
|
13
|
+
An app ID alone is not authorization. Tenant quota remains at most three apps
|
|
14
|
+
across environments/collections, separate from Cloudflare limits.
|
|
14
15
|
|
|
15
16
|
```sh
|
|
17
|
+
andeo flagship apps ensure --collection checkout --env preview --json
|
|
16
18
|
andeo flagship apps list --env preview --json
|
|
17
|
-
andeo flagship flags
|
|
18
|
-
andeo flagship flags
|
|
19
|
-
andeo flagship flags
|
|
20
|
-
andeo flagship flags
|
|
21
|
-
andeo flagship flags
|
|
22
|
-
andeo flagship flags
|
|
23
|
-
andeo flagship flags
|
|
24
|
-
andeo flagship flags
|
|
25
|
-
andeo flagship flags
|
|
19
|
+
andeo flagship flags validate --file ./definition.json --json
|
|
20
|
+
andeo flagship flags create APP_ID checkout-layout --file ./definition.json --env preview --json
|
|
21
|
+
andeo flagship flags export APP_ID checkout-layout --env preview --json
|
|
22
|
+
andeo flagship flags diff APP_ID checkout-layout --file ./edited.json --env preview --json
|
|
23
|
+
andeo flagship flags apply APP_ID checkout-layout --file ./edited.json --expected-revision 3 --expected-digest OBSERVED_DIGEST --env preview --json
|
|
24
|
+
andeo flagship flags evaluate APP_ID checkout-layout --context-file ./synthetic-context.json --type string --fallback-file ./fallback.json --env preview --json
|
|
25
|
+
andeo flagship flags enable APP_ID checkout-layout --env preview --json
|
|
26
|
+
andeo flagship flags disable APP_ID checkout-layout --env preview --json
|
|
27
|
+
andeo flagship flags reconcile APP_ID checkout-layout --env preview --json
|
|
28
|
+
andeo flagship flags changelog APP_ID checkout-layout --env preview --json
|
|
26
29
|
```
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
Offline validate needs no auth or environment. Definitions use the pinned
|
|
32
|
+
Wrangler 4.135.0 schema: key, description?, enabled, default_variation, variations,
|
|
33
|
+
rules. A rule has priority, conditions, serve_variation and optional rollout
|
|
34
|
+
{percentage, attribute?}; a nested condition has logical_operator and clauses.
|
|
35
|
+
All variants share one type. Create requires `--file` and starts disabled. Apply preserves
|
|
36
|
+
enabled state, requires the observed revision/digest and cannot enable implicitly.
|
|
37
|
+
Export returns an envelope: extract `definition` for editing, retain `observed`
|
|
38
|
+
and compatibility diagnostics for unknown fields. Inspect the complete diff first.
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
External unsupported rules require operator reconciliation; emergency Disable
|
|
40
|
-
preserves them only when the observed default variation is false.
|
|
40
|
+
Native disabled evaluation returns the configured default, which can be true or
|
|
41
|
+
non-boolean. Choose false defaults/fallbacks for business guards. Caller fallback
|
|
42
|
+
is distinct from default and type mismatch. The official OpenFeature provider
|
|
43
|
+
0.5.0 returns caller fallback on DISABLED; native details return configured default.
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
Context files are bounded JSON objects of string/number/boolean properties, including
|
|
46
|
+
{}. Native evaluation supports these types. Current management REST transport only
|
|
47
|
+
verifies strings and rejects numbers/booleans with
|
|
48
|
+
flagship_typed_management_context_unverified; no implicit string coercion occurs.
|
|
49
|
+
Use synthetic fixtures, never commit customer inventories.
|
|
50
|
+
|
|
51
|
+
Experiments use positive shares totaling 100% of eligible traffic, compiled into
|
|
52
|
+
cumulative thresholds with identical eligibility and bucketing attribute. A 50/50
|
|
53
|
+
split is thresholds 50 then 100, not independent 50/50 rules. Variant names differ
|
|
54
|
+
from returned values. Default control is not enrolled control: inspect reason and
|
|
55
|
+
variant. Missing targetingKey can assign randomly. Use stable server-owned IDs for
|
|
56
|
+
sticky assignment; request IDs deliberately sample requests. Changing app, weights,
|
|
57
|
+
eligibility or attribute can change assignment. Exposure occurs when the experience
|
|
58
|
+
is actually shown. Assignment is not conversion analysis/statistical significance.
|
|
59
|
+
|
|
60
|
+
All flags use the general definition model. Targeting and rollouts are configured
|
|
61
|
+
through rules in the full definition. Evaluation accepts `--context-file` or empty
|
|
62
|
+
context; customerId is an ordinary attribute. There are no customer-specific
|
|
63
|
+
commands, automatic definitions or old-key validation exceptions.
|
|
64
|
+
|
|
65
|
+
External changes require explicit reconciliation. Unknown outcomes retain pending
|
|
66
|
+
intent and block conflicting writes; never blindly replay. Disable keeps
|
|
67
|
+
the full compatible typed definition and requires external edits to be reconciled.
|
|
68
|
+
Unknown writable fields block all edits, including Disable. Save/readback means changes are propagating,
|
|
69
|
+
not globally cut over; runtime propagation and browser refresh add delay.
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
andeo flagship apps get APP_ID --env preview --json
|
|
73
|
+
andeo flagship apps rename APP_ID --name reviewed-provider-name --expected-revision 0 --env preview --json
|
|
74
|
+
andeo flagship apps disconnect APP_ID --confirm PROJECT_ID --expected-revision 1 --env preview --json
|
|
75
|
+
andeo flagship flags delete APP_ID KEY --confirm KEY --expected-revision 4 --expected-digest OBSERVED_DIGEST --env preview --json
|
|
76
|
+
andeo flagship apps delete APP_ID --confirm APP_ID --expected-revision 2 --env preview --json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Inspect affected projects and receipts. Retained builds block disconnect; grants
|
|
80
|
+
and flags block app deletion. Deletion has no restore guarantee. Tombstones retain
|
|
81
|
+
revisions; ensure never recreates deleted or pending collections. App reconcile
|
|
82
|
+
requires expected revision. Promotion/history reapplication use an exported exact
|
|
83
|
+
definition, current destination enabled state, current revision/digest and reviewed
|
|
84
|
+
diff/apply, followed by separate Enable. Deployment/rollback never copies flags.
|
|
85
|
+
|
|
86
|
+
Flag deletion requires a disabled saved provider definition. Disable, observe,
|
|
87
|
+
remove its evaluations from application code, and deploy before using `--confirm
|
|
88
|
+
KEY`. Disabled status alone does not prove that no code still uses the flag;
|
|
89
|
+
Andeo does not detect remaining evaluations automatically. Refresh the revision
|
|
90
|
+
and digest after Disable. Final readback rejects re-enabling or definition changes
|
|
91
|
+
during review; it cannot atomically prevent external provider edits after the read.
|
|
92
|
+
|
|
93
|
+
Declare the native binding separately for every environment in tender-app.config.json:
|
|
43
94
|
|
|
44
95
|
```json
|
|
45
96
|
{
|
|
46
|
-
"flagship":
|
|
47
|
-
"env":
|
|
48
|
-
"preview":
|
|
49
|
-
"production":
|
|
97
|
+
"flagship":[{"binding":"FLAGS","app_id":"DEVELOPMENT_APP_ID"}],
|
|
98
|
+
"env":{
|
|
99
|
+
"preview":{"flagship":[{"binding":"FLAGS","app_id":"PREVIEW_APP_ID"}]},
|
|
100
|
+
"production":{"flagship":[{"binding":"FLAGS","app_id":"PRODUCTION_APP_ID"}]}
|
|
50
101
|
}
|
|
51
102
|
}
|
|
52
103
|
```
|
|
53
104
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
105
|
+
Packaging retains all environments in manifest.flags. Trusted delivery verifies
|
|
106
|
+
registry/account/environment/tenant/project grants. No environment inherits IDs.
|
|
107
|
+
Previews share live definitions. GitHub workflows must run installed
|
|
108
|
+
`andeo artifact finalize --artifact-directory .tender/artifacts/current --json`
|
|
109
|
+
after pack:tender, before OIDC delivery; use a released CLI containing this command.
|
|
110
|
+
Finalization retains workflows, flags and attested source revision without relabeling.
|
|
59
111
|
|
|
60
|
-
|
|
112
|
+
Worker code evaluates env.FLAGS details methods. Optional official OpenFeature:
|
|
61
113
|
|
|
62
114
|
```ts
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
115
|
+
import {OpenFeature} from "@openfeature/server-sdk";
|
|
116
|
+
import {FlagshipServerProvider} from "@cloudflare/flagship/server";
|
|
117
|
+
await OpenFeature.setProviderAndWait("checkout",new FlagshipServerProvider({binding:env.FLAGS}));
|
|
118
|
+
const result=await OpenFeature.getClient("checkout","1").getStringDetails(
|
|
119
|
+
"checkout-layout","caller-fallback",{targetingKey:serverOwnedKey,plan:trustedPlan});
|
|
68
120
|
```
|
|
69
121
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
122
|
+
Pass request-local context, never mutate global client context across requests.
|
|
123
|
+
External Node/Go/Python official providers require a separately approved scoped
|
|
124
|
+
credential path and revocation proof; Andeo does not issue these credentials here
|
|
125
|
+
or share its management token. Direct Workflow binding is unsupported: call an
|
|
126
|
+
explicitly granted private service and recheck each external write/retry there.
|
|
127
|
+
Keep business eligibility, authorization and recovery independent of feature flags.
|
|
128
|
+
|
|
129
|
+
Browser helpers: import @withandeo/cli/flagship-runtime for createFlagGateway,
|
|
130
|
+
flagVisitorIdentity and optional flagExposure; import @withandeo/cli/flagship-browser
|
|
131
|
+
for createFlagBrowserClient after release. The application authenticates its own
|
|
132
|
+
gateway, selects client-visible keys/environment/binding and enriches trusted
|
|
133
|
+
context server-side. Return bounded values and refresh hints, never private rules,
|
|
134
|
+
raw context or provider tokens. Initial loading uses caller fallbacks; SSR can
|
|
135
|
+
hydrate matching bootstrap. Each client instance isolates caches; invalidate on
|
|
136
|
+
login/logout/tenant/context changes before refresh. The app schedules refreshes.
|
|
137
|
+
Server actions independently guard operations. Optional one-year HttpOnly visitor
|
|
138
|
+
cookie survives login/actions; explicit reset changes identity. Consent, exposure
|
|
139
|
+
deduplication/retention and outcome measurement remain application-owned.
|
|
140
|
+
|
|
141
|
+
Local simulator uses remote:false and synthetic definitions/test credentials.
|
|
142
|
+
Andeo's Workflow dev host rejects native flags; use app Wrangler simulation plus
|
|
143
|
+
mock private services. Do not swap production IDs into development. New names
|
|
144
|
+
use the pinned syntax and a maximum of 64 characters for every operation. Values are
|
|
145
|
+
finite bounded JSON with safe keys; provider/Andeo limits are separately documented.
|
|
146
|
+
No local check establishes hosted lifecycle, propagation or external SDK readiness.
|
|
147
|
+
|
|
148
|
+
See repository docs/runbooks/FLEXIBLE_FEATURE_FLAGS.md for the parity matrix,
|
|
149
|
+
migration 0092, exact boundaries and remaining hosted acceptance evidence.
|
|
150
|
+
Official documentation: https://developers.cloudflare.com/flagship/.
|
|
151
|
+
|
|
152
|
+
External access design: Specified Flagship apps + Flagship App Evaluate, limited
|
|
153
|
+
to the exact approved collection/environment, server-side secret storage, no Read,
|
|
154
|
+
Write or Entire Account permissions. Provisioning/revocation proof is pending.
|
|
155
|
+
Node uses the official appId/accountId/authToken provider; Go uses
|
|
156
|
+
github.com/cloudflare/flagship/sdks/go; Python uses cloudflare-flagship. Go/Python
|
|
157
|
+
evaluate HTTP only and offer sync/details (Python also async), request-local scalar
|
|
158
|
+
context and optional TTL caches; leave caches off for guards until verified.
|
|
159
|
+
See https://developers.cloudflare.com/flagship/sdk/go/,
|
|
160
|
+
https://developers.cloudflare.com/flagship/sdk/python/ and
|
|
161
|
+
https://developers.cloudflare.com/flagship/api-tokens/.
|