@mccaskie-labs/workbench-config 0.1.10 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @mccaskie-labs/workbench-config
2
2
 
3
+ ## 0.1.12
4
+
5
+ ### Patch Changes
6
+
7
+ - Capabilities: analytics lists cf_web_analytics_site_delete and the WEB_ANALYTICS_TOKEN config written by cf_worker_secret_put source=web_analytics; manifests may say a tool ships in phase 5.
8
+
9
+ ## 0.1.11
10
+
11
+ ### Patch Changes
12
+
13
+ - The Gateway's error list gains `content_refused` (422) and `content_check_unavailable` (503) for the Workbench content rules (`docs/spec.md` §2.7).
14
+
3
15
  ## 0.1.10
4
16
 
5
17
  ### Patch Changes
@@ -12,21 +12,40 @@
12
12
  "eventsMigration"
13
13
  ],
14
14
  "tools": [
15
- "cf_web_analytics_site_create"
15
+ "cf_web_analytics_site_create",
16
+ "cf_web_analytics_site_delete",
17
+ "cf_worker_secret_put"
16
18
  ]
17
19
  },
20
+ "config": [
21
+ {
22
+ "name": "WEB_ANALYTICS_TOKEN",
23
+ "required": false,
24
+ "secret": false,
25
+ "environments": [
26
+ "staging",
27
+ "production"
28
+ ],
29
+ "description": "The public beacon token of the Web Analytics site for the Worker's own hostname, for beaconScript(); written by cf_worker_secret_put source=web_analytics (free, new or replacing). Unset in development and CI, where beaconScript returns ''"
30
+ }
31
+ ],
18
32
  "actions": [
19
33
  {
20
34
  "tool": "cf_web_analytics_site_create",
21
35
  "gate": "free",
22
36
  "ships": "4"
37
+ },
38
+ {
39
+ "tool": "cf_web_analytics_site_delete",
40
+ "gate": "two_step",
41
+ "ships": "5"
23
42
  }
24
43
  ],
25
44
  "rules": [
26
45
  {
27
46
  "id": "analytics.beacon-on-pages",
28
47
  "kind": "must",
29
- "text": "Put beaconScript(token) on every page, with the site's public beacon token from cf_web_analytics_site_create.",
48
+ "text": "Put beaconScript(env.WEB_ANALYTICS_TOKEN) on every page; Control writes the site's public beacon token onto each Worker with cf_worker_secret_put source=web_analytics.",
30
49
  "enforced_by": "review",
31
50
  "probe": "analytics.beacon"
32
51
  },
@@ -55,6 +55,8 @@
55
55
  { "code": "forbidden_scope", "http": 403, "retryable": false, "meaning": "The key doesn't carry the scope this endpoint needs" },
56
56
  { "code": "invalid_request", "http": 400, "retryable": false, "meaning": "The body or a required header is missing or malformed" },
57
57
  { "code": "budget_exceeded", "http": 402, "retryable": false, "meaning": "The environment's enforced monthly budget, or the global ceiling, is reached" },
58
+ { "code": "content_refused", "http": 422, "retryable": false, "meaning": "The Workbench content rules refuse what was sent (stage input) or what the vendor made (stage output). The error names the rule, the stage and the rules version, never the content. A vendor's own safety block is reported the same way, with rule vendor" },
59
+ { "code": "content_check_unavailable", "http": 503, "retryable": true, "meaning": "The content check couldn't be run, so nothing was returned. Nothing passes unchecked" },
58
60
  { "code": "rate_limited", "http": 429, "retryable": true, "meaning": "Per-key rate limit; it stops runaway loops, budgets limit spend" },
59
61
  { "code": "not_available", "http": 501, "retryable": false, "meaning": "Not built yet, e.g. bulk email" },
60
62
  { "code": "upstream_error", "http": 502, "retryable": true, "meaning": "The vendor failed after the Gateway's retries" },
@@ -211,6 +211,7 @@
211
211
  "enum": [
212
212
  "3",
213
213
  "4",
214
+ "5",
214
215
  "later"
215
216
  ]
216
217
  }
@@ -1,4 +1,4 @@
1
- export declare const MANIFEST_VERSION: "cf96a8fa8ff2";
1
+ export declare const MANIFEST_VERSION: "f3d5b55e579d";
2
2
  export declare const capabilities: {
3
3
  readonly ai: {
4
4
  readonly $schema: "./schema.json";
@@ -145,18 +145,29 @@ export declare const capabilities: {
145
145
  readonly summary: "Cloudflare Web Analytics counts page views through a beacon on every page; product events go into the app's own database through workbench-analytics. Apps hold no Cloudflare token: Claude reads page views through Control.";
146
146
  readonly status: "built";
147
147
  readonly surfaces: {
148
- readonly tools: readonly ["cf_web_analytics_site_create"];
148
+ readonly tools: readonly ["cf_web_analytics_site_create", "cf_web_analytics_site_delete", "cf_worker_secret_put"];
149
149
  readonly package: readonly ["beaconScript", "createEvents", "eventsMigration"];
150
150
  };
151
+ readonly config: readonly [{
152
+ readonly name: "WEB_ANALYTICS_TOKEN";
153
+ readonly required: false;
154
+ readonly secret: false;
155
+ readonly environments: readonly ["staging", "production"];
156
+ readonly description: "The public beacon token of the Web Analytics site for the Worker's own hostname, for beaconScript(); written by cf_worker_secret_put source=web_analytics (free, new or replacing). Unset in development and CI, where beaconScript returns ''";
157
+ }];
151
158
  readonly actions: readonly [{
152
159
  readonly tool: "cf_web_analytics_site_create";
153
160
  readonly gate: "free";
154
161
  readonly ships: "4";
162
+ }, {
163
+ readonly tool: "cf_web_analytics_site_delete";
164
+ readonly gate: "two_step";
165
+ readonly ships: "5";
155
166
  }];
156
167
  readonly rules: readonly [{
157
168
  readonly id: "analytics.beacon-on-pages";
158
169
  readonly kind: "must";
159
- readonly text: "Put beaconScript(token) on every page, with the site's public beacon token from cf_web_analytics_site_create.";
170
+ readonly text: "Put beaconScript(env.WEB_ANALYTICS_TOKEN) on every page; Control writes the site's public beacon token onto each Worker with cf_worker_secret_put source=web_analytics.";
160
171
  readonly enforced_by: "review";
161
172
  readonly probe: "analytics.beacon";
162
173
  }, {
@@ -935,6 +946,16 @@ export declare const capabilities: {
935
946
  readonly http: 402;
936
947
  readonly retryable: false;
937
948
  readonly meaning: "The environment's enforced monthly budget, or the global ceiling, is reached";
949
+ }, {
950
+ readonly code: "content_refused";
951
+ readonly http: 422;
952
+ readonly retryable: false;
953
+ readonly meaning: "The Workbench content rules refuse what was sent (stage input) or what the vendor made (stage output). The error names the rule, the stage and the rules version, never the content. A vendor's own safety block is reported the same way, with rule vendor";
954
+ }, {
955
+ readonly code: "content_check_unavailable";
956
+ readonly http: 503;
957
+ readonly retryable: true;
958
+ readonly meaning: "The content check couldn't be run, so nothing was returned. Nothing passes unchecked";
938
959
  }, {
939
960
  readonly code: "rate_limited";
940
961
  readonly http: 429;
@@ -1,6 +1,6 @@
1
1
  // Generated by `npm run capabilities:build` from capabilities/*.json. Do not edit.
2
2
  // check:capabilities fails in Checks when this file is stale.
3
- export const MANIFEST_VERSION = "cf96a8fa8ff2";
3
+ export const MANIFEST_VERSION = "f3d5b55e579d";
4
4
  export const capabilities = {
5
5
  "ai": {
6
6
  "$schema": "./schema.json",
@@ -203,7 +203,9 @@ export const capabilities = {
203
203
  "status": "built",
204
204
  "surfaces": {
205
205
  "tools": [
206
- "cf_web_analytics_site_create"
206
+ "cf_web_analytics_site_create",
207
+ "cf_web_analytics_site_delete",
208
+ "cf_worker_secret_put"
207
209
  ],
208
210
  "package": [
209
211
  "beaconScript",
@@ -211,18 +213,35 @@ export const capabilities = {
211
213
  "eventsMigration"
212
214
  ]
213
215
  },
216
+ "config": [
217
+ {
218
+ "name": "WEB_ANALYTICS_TOKEN",
219
+ "required": false,
220
+ "secret": false,
221
+ "environments": [
222
+ "staging",
223
+ "production"
224
+ ],
225
+ "description": "The public beacon token of the Web Analytics site for the Worker's own hostname, for beaconScript(); written by cf_worker_secret_put source=web_analytics (free, new or replacing). Unset in development and CI, where beaconScript returns ''"
226
+ }
227
+ ],
214
228
  "actions": [
215
229
  {
216
230
  "tool": "cf_web_analytics_site_create",
217
231
  "gate": "free",
218
232
  "ships": "4"
233
+ },
234
+ {
235
+ "tool": "cf_web_analytics_site_delete",
236
+ "gate": "two_step",
237
+ "ships": "5"
219
238
  }
220
239
  ],
221
240
  "rules": [
222
241
  {
223
242
  "id": "analytics.beacon-on-pages",
224
243
  "kind": "must",
225
- "text": "Put beaconScript(token) on every page, with the site's public beacon token from cf_web_analytics_site_create.",
244
+ "text": "Put beaconScript(env.WEB_ANALYTICS_TOKEN) on every page; Control writes the site's public beacon token onto each Worker with cf_worker_secret_put source=web_analytics.",
226
245
  "enforced_by": "review",
227
246
  "probe": "analytics.beacon"
228
247
  },
@@ -1253,6 +1272,18 @@ export const capabilities = {
1253
1272
  "retryable": false,
1254
1273
  "meaning": "The environment's enforced monthly budget, or the global ceiling, is reached"
1255
1274
  },
1275
+ {
1276
+ "code": "content_refused",
1277
+ "http": 422,
1278
+ "retryable": false,
1279
+ "meaning": "The Workbench content rules refuse what was sent (stage input) or what the vendor made (stage output). The error names the rule, the stage and the rules version, never the content. A vendor's own safety block is reported the same way, with rule vendor"
1280
+ },
1281
+ {
1282
+ "code": "content_check_unavailable",
1283
+ "http": 503,
1284
+ "retryable": true,
1285
+ "meaning": "The content check couldn't be run, so nothing was returned. Nothing passes unchecked"
1286
+ },
1256
1287
  {
1257
1288
  "code": "rate_limited",
1258
1289
  "http": 429,
@@ -146,6 +146,7 @@ export declare const capabilitySchema: z.ZodObject<{
146
146
  ships: z.ZodEnum<{
147
147
  3: "3";
148
148
  4: "4";
149
+ 5: "5";
149
150
  later: "later";
150
151
  }>;
151
152
  }, z.core.$strict>>>;
@@ -45,7 +45,7 @@ const action = z.strictObject({
45
45
  tool: z.string().regex(/^[a-z]+_[a-z0-9_]+$/),
46
46
  gate: z.enum(["free", "two_step", "two_step_on_production", "two_step_when"]),
47
47
  when: z.string().min(1).optional(),
48
- ships: z.enum(["3", "4", "later"]),
48
+ ships: z.enum(["3", "4", "5", "later"]),
49
49
  });
50
50
  const errorEntry = z.strictObject({
51
51
  code,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mccaskie-labs/workbench-config",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Workbench app configuration: WORKBENCH_ENV, typed variables that fail by name, secrets that are never printed, and the capabilities manifest.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",