@withandeo/cli 0.19.10 → 0.19.12

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.
Files changed (46) hide show
  1. package/README.md +61 -1
  2. package/dist/api.d.ts +0 -1
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +0 -2
  5. package/dist/api.js.map +1 -1
  6. package/dist/cli.js +4 -1
  7. package/dist/cli.js.map +1 -1
  8. package/dist/contracts.d.ts +8 -0
  9. package/dist/contracts.d.ts.map +1 -1
  10. package/dist/documentation.d.ts +23 -0
  11. package/dist/documentation.d.ts.map +1 -1
  12. package/dist/documentation.js +157 -13
  13. package/dist/documentation.js.map +1 -1
  14. package/dist/flagship-browser.d.ts +18 -0
  15. package/dist/flagship-browser.d.ts.map +1 -0
  16. package/dist/flagship-browser.js +63 -0
  17. package/dist/flagship-browser.js.map +1 -0
  18. package/dist/flagship-contract.d.ts +4 -37
  19. package/dist/flagship-contract.d.ts.map +1 -1
  20. package/dist/flagship-contract.js +23 -65
  21. package/dist/flagship-contract.js.map +1 -1
  22. package/dist/flagship-definition.d.ts +67 -0
  23. package/dist/flagship-definition.d.ts.map +1 -0
  24. package/dist/flagship-definition.js +207 -0
  25. package/dist/flagship-definition.js.map +1 -0
  26. package/dist/flagship-runtime.d.ts +57 -0
  27. package/dist/flagship-runtime.d.ts.map +1 -0
  28. package/dist/flagship-runtime.js +79 -0
  29. package/dist/flagship-runtime.js.map +1 -0
  30. package/dist/main.d.ts +3 -0
  31. package/dist/main.d.ts.map +1 -1
  32. package/dist/main.js +126 -43
  33. package/dist/main.js.map +1 -1
  34. package/dist/update-storage.d.ts +3 -0
  35. package/dist/update-storage.d.ts.map +1 -0
  36. package/dist/update-storage.js +69 -0
  37. package/dist/update-storage.js.map +1 -0
  38. package/dist/updates.d.ts +52 -0
  39. package/dist/updates.d.ts.map +1 -0
  40. package/dist/updates.js +297 -0
  41. package/dist/updates.js.map +1 -0
  42. package/package.json +9 -2
  43. package/skill/publication.json +1 -1
  44. package/skill/tender-accounts/SKILL.md +10 -2
  45. package/skill/tender-accounts/references/feature-flags.md +140 -69
  46. package/skill/tender-accounts/references/skills.md +5 -2
@@ -1,90 +1,161 @@
1
- # Tenant feature flags
1
+ # Flexible feature flags
2
2
 
3
- This CLI implements boolean flag management and native Cloudflare Flagship declarations.
4
- Availability requires tenant enablement, a project grant, provisioned environment apps,
5
- and configured trusted management. Run `andeo capabilities --json` and `andeo doctor`;
6
- `implemented_pending_hosted_proof` does not certify a deployed binding. Read the
7
- authenticated `feature-flags` skill with `andeo skills get feature-flags --json`.
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
- Use an explicit environment on every command. Administrators connect projects with
10
- `andeo flagship apps ensure --env preview --json`. That grants only this project to
11
- the tenant's shared preview app. Developers manage granted nonproduction apps;
12
- production writes require the credential owner's current merchant-admin role.
13
- Viewers cannot mutate. A Cloudflare app ID alone gives no permission.
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 create APP_ID example-feature --env preview --json
18
- andeo flagship flags audience APP_ID example-feature --env preview --customer-ids-file ./synthetic-ids.json --json
19
- andeo flagship flags evaluate APP_ID example-feature --env preview --context customerId=synthetic-customer-a --json
20
- andeo flagship flags enable APP_ID example-feature --env preview --json
21
- andeo flagship flags rollout APP_ID example-feature --env preview --to on --percentage 5 --by customerId --json
22
- andeo flagship flags disable APP_ID example-feature --env preview --json
23
- andeo flagship flags get APP_ID example-feature --env preview --json
24
- andeo flagship flags reconcile APP_ID example-feature --env preview --json
25
- andeo flagship flags changelog APP_ID example-feature --env preview --json
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
- Create defaults to disabled, no selected customers, 0%, and false fallback.
29
- Customer files contain bounded JSON arrays of strings, for example
30
- `["synthetic-customer-a"]`. Do not commit real customer inventories. 0% still
31
- admits selected customers when enabled. `audience --all` selects 100% without
32
- discarding the list. Audience and percentage edits preserve each other and never
33
- enable a disabled flag. Enable rejects an empty list with 0%.
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
- Ordinary edits read a revision first; pass `--expected-revision N` to use a
36
- previous observation. The service checks it inside durable serialization.
37
- A stale edit cannot overwrite a newer Disable. Unknown provider outcomes block
38
- conflicting changes until `reconcile` reads the requested definition back.
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
- In `tender-app.config.json`, preserve the rest of your app contract and add:
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": [{"binding":"FLAGS","app_id":"DEVELOPMENT_APP_ID"}],
47
- "env": {
48
- "preview": {"flagship":[{"binding":"FLAGS","app_id":"PREVIEW_APP_ID"}]},
49
- "production": {"flagship":[{"binding":"FLAGS","app_id":"PRODUCTION_APP_ID"}]}
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
- The CLI's artifact packaging retains all three environments under `manifest.flags`.
55
- The trusted deployer chooses the environment and verifies registry ownership,
56
- tenant enablement, account and project grants. No environment inherits another ID.
57
- Binding names cannot conflict with resources, services, workflows, secrets or vars.
58
- Deploy/rollback never changes flag definitions. Concurrent previews share their app.
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
- Native Worker usage, immediately before each external write attempt:
112
+ Worker code evaluates env.FLAGS details methods. Optional official OpenFeature:
61
113
 
62
114
  ```ts
63
- async function allowed(env: { FLAGS?: Flagship }, customerId: string) {
64
- if (!customerId?.trim() || !env.FLAGS) return false;
65
- try { return (await env.FLAGS.getBooleanDetails("example-feature", false, { customerId })).value === true; }
66
- catch { return false; }
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
- Use the same canonical customer ID in callers and private provider services.
71
- Recheck on each batch/retry in the credential-holding service; do not cache an
72
- allow decision in a durable workflow step. Direct workflow evaluation is not
73
- supported: call a granted private service. Keep business eligibility and
74
- authorization checks. Flags do not grant permission to use live write credentials.
75
-
76
- Changes can take up to 30 seconds to propagate. Disable cannot recall an issued
77
- request. Record partial effects as `blocked_by_feature_flag`; retain evidence,
78
- do not mark completion, blindly replay events, or undo provider changes. Authorized
79
- recovery and readback remain available when ordinary operations are disabled.
80
-
81
- Wrangler 4.135.0 supports a local simulator: use development bindings with
82
- `remote:false`, explicit synthetic definitions, and test credentials. The Andeo
83
- workflow-local host rejects Flagship declarations until native evaluation is
84
- supported there; use the application's Wrangler simulator and mock private
85
- service calls. Never silently substitute production apps or credentials.
86
- Optional OpenFeature integration is application-owned; no SDK install is required.
87
-
88
- References: https://developers.cloudflare.com/flagship/configuration/,
89
- https://developers.cloudflare.com/flagship/binding/methods/,
90
- https://developers.cloudflare.com/flagship/reference/wrangler-commands/.
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/.
@@ -1,8 +1,11 @@
1
1
  # Authenticated skills
2
2
 
3
3
  The global Andeo guide is public and updates independently of CLI releases.
4
- Run `andeo skill install --agent codex --force --json` to refresh its latest
5
- compatible revision, without login. Check the returned source and revision;
4
+ Run `andeo skill sync --agent codex --json` to refresh its latest
5
+ compatible revision, without login or overwriting local edits. Use `--agent claude`
6
+ for Claude or `--directory PATH` for a custom installation. Check freshness with
7
+ `andeo skill status --json` using the same destination. After an update, reread the
8
+ entrypoint and relevant references in active chats. Check the returned source and revision;
6
9
  `--bundled` selects the CLI's offline snapshot. `andeo doctor` checks global
7
10
  guidance against the public revision. The private practice skills below still
8
11
  require authentication and do not use this public endpoint.