@r_masseater/masseater-utils 0.1.5 → 0.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r_masseater/masseater-utils",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "The small shared libraries of masseater's repositories as subpaths of one package: a chip row for React, Claude Code plugin helpers, Effect entry points for Node.js and GitHub Actions, file import mapping, Node package readers, OTLP assertions for Vitest and Cloudflare Workers tracing.",
5
5
  "keywords": [
6
6
  "actions",
@@ -123,10 +123,6 @@
123
123
  "types": "./dist/workers-tracing-browser-spans.d.mts",
124
124
  "default": "./dist/workers-tracing-browser-spans.mjs"
125
125
  },
126
- "./workers-tracing/oxlint": {
127
- "types": "./dist/workers-tracing-oxlint.d.mts",
128
- "default": "./dist/workers-tracing-oxlint.mjs"
129
- },
130
126
  "./workers-tracing/workers-ai": {
131
127
  "types": "./dist/workers-tracing-workers-ai.d.mts",
132
128
  "default": "./dist/workers-tracing-workers-ai.mjs"
@@ -38,7 +38,6 @@ Traces are kept only on the Workers Paid plan.
38
38
  | `./browser-spans` | `browserSpans({ service })`, a handler that accepts OTLP JSON spans from the browser |
39
39
  | `./browser-logs` | `browserLogs({ service })`, a handler that accepts OTLP JSON logs from the browser, such as Web Vitals and clicks |
40
40
  | `./workers-ai` | `runWorkersAi`, which retries out-of-capacity errors and records `gen_ai.*` attributes |
41
- | `./oxlint` | `restrictedSyntax`, which bans `env.AI.run` outside `runWorkersAi` |
42
41
 
43
42
  On Node.js and in the browser, `./effect`, `./tanstack-start` and `./elysia` resolve to pass-through versions.
44
43
  The same imports therefore work in tests and client bundles.
@@ -116,11 +115,11 @@ const answer =
116
115
  runWorkersAi({
117
116
  operation: "chat",
118
117
  model: "@cf/cloudflare/clef-flash",
119
- call: () => env.AI.run("@cf/cloudflare/clef-flash", { messages }),
118
+ call: (options) => env.AI.run("@cf/cloudflare/clef-flash", { messages }, options),
120
119
  });
121
120
  ```
122
121
 
123
- It fails with `WorkersAiError` and logs a cut-off answer. Add `restrictedSyntax` from `./oxlint` to `no-restricted-syntax` so direct `env.AI.run` calls are caught.
122
+ It fails with `WorkersAiError` and logs a cut-off answer. The msch preset reports a Workers AI call made outside `runWorkersAi` with its `workers-ai-through-runner` rule.
124
123
 
125
124
  ## Checking spans in CI
126
125
 
@@ -1,6 +0,0 @@
1
- export interface RestrictedSyntax {
2
- readonly selector: string;
3
- readonly message: string;
4
- }
5
- export declare const restrictedSyntax: readonly RestrictedSyntax[];
6
- //# sourceMappingURL=workers-tracing-oxlint.d.mts.map
@@ -1,8 +0,0 @@
1
- // src/app/workers-tracing-oxlint.ts
2
- const restrictedSyntax = [{
3
- selector: "CallExpression[callee.property.name=\"run\"][callee.object.property.name=\"AI\"]:not(CallExpression[callee.name=\"runWorkersAi\"] *)",
4
- message: "Call Workers AI inside runWorkersAi from @r_masseater/masseater-utils/workers-tracing/workers-ai, so an out-of-capacity error is retried and a cut-off answer is logged."
5
- }];
6
- export { restrictedSyntax };
7
-
8
- //# sourceMappingURL=workers-tracing-oxlint.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workers-tracing-oxlint.mjs","names":[],"sources":["../src/app/workers-tracing-oxlint.ts"],"sourcesContent":["export interface RestrictedSyntax {\n readonly selector: string;\n readonly message: string;\n}\n\nexport const restrictedSyntax: readonly RestrictedSyntax[] = [\n {\n selector:\n 'CallExpression[callee.property.name=\"run\"][callee.object.property.name=\"AI\"]:not(CallExpression[callee.name=\"runWorkersAi\"] *)',\n message:\n \"Call Workers AI inside runWorkersAi from @r_masseater/masseater-utils/workers-tracing/workers-ai, so an out-of-capacity error is retried and a cut-off answer is logged.\",\n },\n];\n"],"mappings":";AAKA,MAAa,mBAAgD,CAC3D;CACE,UACE;CACF,SACE;AACJ,CACF"}