@ultimat3/action 31.32.0 → 31.33.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultimat3/action",
3
- "version": "31.32.0",
3
+ "version": "31.33.0",
4
4
  "description": "The action primitive: one declaration projected to route, OpenAPI, client, MCP tool, job handle, tests",
5
5
  "keywords": [
6
6
  "ultimate",
@@ -48,13 +48,13 @@
48
48
  "test": "bun test"
49
49
  },
50
50
  "dependencies": {
51
- "@ultimat3/cache": "31.32.0",
52
- "@ultimat3/core": "31.32.0",
53
- "@ultimat3/db": "31.32.0",
54
- "@ultimat3/entity": "31.32.0",
55
- "@ultimat3/http": "31.32.0",
56
- "@ultimat3/policy": "31.32.0",
57
- "@ultimat3/schema": "31.32.0",
58
- "@ultimat3/storage": "31.32.0"
51
+ "@ultimat3/cache": "31.33.0",
52
+ "@ultimat3/core": "31.33.0",
53
+ "@ultimat3/db": "31.33.0",
54
+ "@ultimat3/entity": "31.33.0",
55
+ "@ultimat3/http": "31.33.0",
56
+ "@ultimat3/policy": "31.33.0",
57
+ "@ultimat3/schema": "31.33.0",
58
+ "@ultimat3/storage": "31.33.0"
59
59
  }
60
60
  }
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * What an app says about its API as a WHOLE, beside the primitives it registers: how action names
3
3
  * become URLs, which bearer-token mounts expose a cut of it, and what its OpenAPI document calls
4
- * itself. Declared in the one `defineApi()` call and held here, process-wide like the registries,
5
- * because every reader — the boot that mounts routes, `x manifest` writing `openapi.json` — runs
6
- * after that module was imported and never has the call's return value in hand.
4
+ * itself.
5
+ *
6
+ * Declared in the one `defineApi()` call and held here, process-wide like the registries, because
7
+ * every reader — the boot that mounts routes, `x manifest` writing `openapi.json` — runs after that
8
+ * module was imported and never has the call's return value in hand.
7
9
  */
8
10
 
9
11
  import type { ActionPathStyle } from '@ultimat3/core';
package/src/audit.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * The audit seam, as this package exposes it: THAT an action or mutator can be recorded at all.
3
+ *
3
4
  * The contract — the record, the sink, the one installed-sink slot — moved to `@ultimat3/core`'s
4
5
  * `audit.ts` so `@ultimat3/query` (a sibling this package cannot import) writes the same record
5
6
  * into the same sink. The TYPES are re-exported for this package's own modules; the slot's VALUES
6
7
  * (`getAuditSink`; the boot's `installAuditSink` is `@ultimat3/core/adapter`'s) are imported from
7
- * core and never re-exported — a second import path for one value is `X_HELPER_COPY` (`bun run flight-copies`).
8
+ * core and never re-exported — a second import path for one value is `X_HELPER_COPY`
9
+ * (`bun run flight-copies`).
8
10
  */
9
11
 
10
12
  export type { AuditFailure, AuditOutcome, AuditRecord, AuditSink } from '@ultimat3/core';
package/src/client.ts CHANGED
@@ -34,6 +34,7 @@ import {
34
34
  remoteTitleOf,
35
35
  renderedActionPin,
36
36
  renderFixShellArg,
37
+ trimTrailingSlashes,
37
38
  } from '@ultimat3/core/page';
38
39
  import type { InferInput, InferOutput, StandardSchemaV1 } from '@ultimat3/schema';
39
40
  import type { Action, StreamAction } from './action';
@@ -166,7 +167,7 @@ export function clientMethodFor<TInput extends StandardSchemaV1, TOutput extends
166
167
  const pin = pinned?.path === undefined ? renderedActionPin(name) : pinned;
167
168
  const path = pin?.path ?? actionPath(name, options.pathStyle);
168
169
  const method = pin?.method ?? pinned?.method ?? 'POST';
169
- const base = options.baseUrl.replace(/\/+$/, '');
170
+ const base = trimTrailingSlashes(options.baseUrl);
170
171
  const onResponse = (response: Response): void =>
171
172
  assertSameBuild(options.buildId, response.headers.get(BUILD_ID_HEADER), name);
172
173
  const decodeError = (
@@ -1,8 +1,9 @@
1
1
  // @ultimat3/action's error TITLES, registered at import — the one module `sideEffects` names, so
2
- // `errors.ts` (the classes) is unlisted and a chunk carries it only where it constructs a class:
2
+ // `errors.ts` (the classes) is unlisted and a chunk carries it only where it constructs a class.
3
+ //
3
4
  // Bun >= 1.4.1 honours the array and keeps a listed module wherever the barrel reaches it.
4
- // `index.ts` imports this bare, because `problemError` rebuilds a server's refusal by code and reads
5
- // its title from the registry; `errors.ts` and its two siblings import it bare as well.
5
+ // `index.ts` imports this bare, because `problemError` rebuilds a server's refusal by code and
6
+ // reads its title from the registry; `errors.ts` and its two siblings import it bare as well.
6
7
 
7
8
  import { registerErrorCodes, registerErrorRetry } from '@ultimat3/core/page';
8
9
 
package/src/facade.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * The fluent surface: every projection this package owns reachable as a method on the action
3
- * itself, `publishPost.openapi()` rather than `toOpenApiOperation(publishPost)`, and every
4
- * declared field lifted off `def` so app code never reaches through `.def`. The projection
5
- * functions stay exported for the framework's own call sites — this file only binds them to the
6
- * action, it never re-implements one. There is no `.tool()`: the MCP tool is `@ultimat3/mcp`'s
7
- * one projection (`toolFrom(publishPost)`), a tier this package cannot import.
3
+ * itself, `publishPost.openapi()` rather than `toOpenApiOperation(publishPost)`, and every declared
4
+ * field lifted off `def` so app code never reaches through `.def`.
5
+ *
6
+ * The projection functions stay exported for the framework's own call sites — this file only binds
7
+ * them to the action, it never re-implements one. There is no `.tool()`: the MCP tool is
8
+ * `@ultimat3/mcp`'s one projection (`toolFrom(publishPost)`), a tier this package cannot import.
8
9
  */
9
10
 
10
11
  import type { InferOutput, StandardSchemaV1 } from '@ultimat3/schema';
package/src/job-handle.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  /**
2
- * Projection 5: an action as durable work — its input schema, a payload-derived
3
- * idempotency key, and an `invoke` that runs the action's one execution path under
4
- * `surface: 'job'`, so a queued run takes the same validation and policy path as the HTTP call —
5
- * under the worker's system authority: the enqueuer is `enqueuedBy`, attribution only, and never
6
- * authorises the run. An action that acts for a user takes that user's id and re-authorises it.
2
+ * Projection 5: an action as durable work — its input schema, a payload-derived idempotency key,
3
+ * and an `invoke` that runs the action's one execution path under `surface: 'job'`.
4
+ *
5
+ * A queued run takes the same validation and policy path as the HTTP call — under the worker's
6
+ * system authority: the enqueuer is `enqueuedBy`, attribution only, and never authorises the run.
7
+ * An action that acts for a user takes that user's id and re-authorises it.
7
8
  * `@ultimat3/ai`'s `agentJob()` is the framework's one consumer — it takes any `Action` and
8
9
  * composes `job()` around this shape — and an app may write the same three lines.
9
10
  */
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * The COMPLETE document an app opts into with `defineApi({ openapi })`: its own `info` and
3
- * `servers`, the security schemes its routes are reached through, and the refusals an
4
- * authenticated, limited or metered operation can answer — 401 and 429, with `Retry-After` — which
5
- * the per-primitive projections cannot state: they do not know the route an operation is mounted
6
- * as. Plus the second document a bearer mount publishes: only the cut, at the mounted paths.
3
+ * `servers`, its security schemes, and the 401/429 refusals no per-primitive projection can state —
4
+ * none knows the route an operation is mounted as.
5
+ *
6
+ * The security schemes are the ones its routes are reached through; the refusals, the ones an
7
+ * authenticated, limited or metered operation can answer: 401, and 429 with `Retry-After`.
8
+ * Plus the second document a bearer mount publishes: only the cut, at the mounted paths.
7
9
  *
8
10
  * Built over the merged document (actions AND reads — `@ultimat3/cli` merges the two packages'
9
11
  * paths) and over the `Route`s that serve it, so "is this operation authenticated" is the answer
@@ -1,8 +1,10 @@
1
1
  /**
2
2
  * What the server says to a caller that derived an action's URL under the WRONG path style: a
3
3
  * script or another service passing `rpc({ pathStyle })` by hand, where matching build ids prove
4
- * nothing. Handed to `@ultimat3/http` as `hooks.explainMiss`, so it runs only when the router
5
- * matched nothing — and answers `X_CONTRACT_DRIFT` naming the style served, in place of a
4
+ * nothing.
5
+ *
6
+ * Handed to `@ultimat3/http` as `hooks.explainMiss`, so it runs only when the router matched
7
+ * nothing — and answers `X_CONTRACT_DRIFT` naming the style served, in place of a
6
8
  * `X_ROUTE_NOT_FOUND` that sends the caller looking for a route that exists.
7
9
  */
8
10