@ultimat3/cli 31.6.1 → 31.7.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/cli",
3
- "version": "31.6.1",
3
+ "version": "31.7.0",
4
4
  "description": "The `x` binary: new, dev, build, verify, generate, db, mcp, doctor, deploy",
5
5
  "keywords": [
6
6
  "ultimate",
@@ -53,34 +53,34 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@babel/core": "^8.0.9",
56
- "@ultimat3/action": "31.6.1",
57
- "@ultimat3/admin": "31.6.1",
58
- "@ultimat3/ai": "31.6.1",
59
- "@ultimat3/auth": "31.6.1",
60
- "@ultimat3/cache": "31.6.1",
61
- "@ultimat3/core": "31.6.1",
62
- "@ultimat3/db": "31.6.1",
63
- "@ultimat3/entity": "31.6.1",
64
- "@ultimat3/flags": "31.6.1",
65
- "@ultimat3/http": "31.6.1",
66
- "@ultimat3/i18n": "31.6.1",
67
- "@ultimat3/jobs": "31.6.1",
68
- "@ultimat3/mail": "31.6.1",
69
- "@ultimat3/manifest": "31.6.1",
70
- "@ultimat3/mcp": "31.6.1",
71
- "@ultimat3/money": "31.6.1",
72
- "@ultimat3/notify": "31.6.1",
73
- "@ultimat3/policy": "31.6.1",
74
- "@ultimat3/pwa": "31.6.1",
75
- "@ultimat3/query": "31.6.1",
76
- "@ultimat3/realtime": "31.6.1",
77
- "@ultimat3/render": "31.6.1",
78
- "@ultimat3/schema": "31.6.1",
79
- "@ultimat3/scraping": "31.6.1",
80
- "@ultimat3/seo": "31.6.1",
81
- "@ultimat3/storage": "31.6.1",
82
- "@ultimat3/testing": "31.6.1",
83
- "@ultimat3/time": "31.6.1",
56
+ "@ultimat3/action": "31.7.0",
57
+ "@ultimat3/admin": "31.7.0",
58
+ "@ultimat3/ai": "31.7.0",
59
+ "@ultimat3/auth": "31.7.0",
60
+ "@ultimat3/cache": "31.7.0",
61
+ "@ultimat3/core": "31.7.0",
62
+ "@ultimat3/db": "31.7.0",
63
+ "@ultimat3/entity": "31.7.0",
64
+ "@ultimat3/flags": "31.7.0",
65
+ "@ultimat3/http": "31.7.0",
66
+ "@ultimat3/i18n": "31.7.0",
67
+ "@ultimat3/jobs": "31.7.0",
68
+ "@ultimat3/mail": "31.7.0",
69
+ "@ultimat3/manifest": "31.7.0",
70
+ "@ultimat3/mcp": "31.7.0",
71
+ "@ultimat3/money": "31.7.0",
72
+ "@ultimat3/notify": "31.7.0",
73
+ "@ultimat3/policy": "31.7.0",
74
+ "@ultimat3/pwa": "31.7.0",
75
+ "@ultimat3/query": "31.7.0",
76
+ "@ultimat3/realtime": "31.7.0",
77
+ "@ultimat3/render": "31.7.0",
78
+ "@ultimat3/schema": "31.7.0",
79
+ "@ultimat3/scraping": "31.7.0",
80
+ "@ultimat3/seo": "31.7.0",
81
+ "@ultimat3/storage": "31.7.0",
82
+ "@ultimat3/testing": "31.7.0",
83
+ "@ultimat3/time": "31.7.0",
84
84
  "babel-preset-solid": "^1.9.16"
85
85
  }
86
86
  }
package/src/cmd-dev.ts CHANGED
@@ -56,7 +56,7 @@ export const devCommand: CliCommand = {
56
56
  // refuses every later one with a pid that is no longer running.
57
57
  // Before the boot, so its own lines are in it: `logs.tail` reads this file, and a dev server
58
58
  // that never wrote it answered every agent with X_NOT_IMPLEMENTED.
59
- const untee = teeDevLog(services.stateDir, { json: ctx.args.json });
59
+ const untee = teeDevLog(services.stateDir);
60
60
  const restart = childRestart(root, ctx.env);
61
61
  const server = await startDev({
62
62
  root,
@@ -2,6 +2,7 @@
2
2
  // (`docker/Dockerfile`, through `scripts/compile-x.ts`) and the boot e2e that proves it. One
3
3
  // `Bun.build`, because the CLI's `bun build --compile` takes no plugin and this graph needs one.
4
4
 
5
+ import { rasterWorkerBundle } from '@ultimat3/core';
5
6
  import { serverTsxBuildPlugin } from '@ultimat3/render/server';
6
7
  import { COMPILE_EXTERNALS } from './compile-externals';
7
8
  import { ExecutableCompileFailedError } from './errors';
@@ -23,13 +24,35 @@ export interface CompileExecutableOptions {
23
24
  * nobody defines. `serverTsxBuildPlugin` compiles them to the server factory, as the runtime
24
25
  * loader does for the same files off disk.
25
26
  */
27
+ /**
28
+ * What the graph is built from: the entry, plus core's raster Worker — this graph BUNDLES core, and
29
+ * Bun neither finds a `new Worker(…)` target on its own nor resolves one off disk inside the
30
+ * executable. Without it `transformImageBytes` runs inline and the web role (`ROLE` unset) refuses
31
+ * every static OG card as `X_IMAGE_RASTER_BUDGET`. The caller's defines win no key of the worker's.
32
+ */
33
+ export function executableGraph(options: CompileExecutableOptions): {
34
+ readonly entrypoints: readonly string[];
35
+ readonly root: string;
36
+ readonly define: Readonly<Record<string, string>>;
37
+ } {
38
+ const raster = rasterWorkerBundle([options.entry]);
39
+ return {
40
+ entrypoints: [options.entry, raster.entrypoint],
41
+ // Stated, not inferred: the worker's define is a path relative to exactly this directory.
42
+ root: raster.root,
43
+ define: { ...options.define, ...raster.define },
44
+ };
45
+ }
46
+
26
47
  export async function compileExecutable(options: CompileExecutableOptions): Promise<void> {
48
+ const graph = executableGraph(options);
27
49
  const built = await Bun.build({
28
- entrypoints: [options.entry],
50
+ entrypoints: [...graph.entrypoints],
51
+ root: graph.root,
29
52
  compile: { outfile: options.outfile },
30
53
  minify: options.minify ?? false,
31
54
  sourcemap: options.sourcemap === true ? 'linked' : 'none',
32
- define: { ...options.define },
55
+ define: { ...graph.define },
33
56
  external: [...COMPILE_EXTERNALS],
34
57
  plugins: [serverTsxBuildPlugin],
35
58
  throw: false,
package/src/dev-log.ts CHANGED
@@ -15,9 +15,7 @@ import {
15
15
  } from 'node:fs';
16
16
  // why: Bun exposes no path-join primitive.
17
17
  import { join } from 'node:path';
18
- import type { LogLevel } from '@ultimat3/core';
19
- import { installLogSink } from '@ultimat3/core';
20
- import { writeErrorLine, writeLine } from './write-line';
18
+ import { teeLogLines } from '@ultimat3/core';
21
19
 
22
20
  export const DEV_LOG_FILENAME = 'dev.log';
23
21
  /** The size at which `dev.log` becomes `dev.log.1` and starts over. */
@@ -62,29 +60,14 @@ export function openDevLog(stateDir: string, maxBytes: number = DEV_LOG_MAX_BYTE
62
60
  };
63
61
  }
64
62
 
65
- /** Where a terminal line goes: the CLI's own synchronous fd writers, by default. */
66
- export type TerminalWrite = (line: string, stream: 'stdout' | 'stderr') => void;
67
-
68
- const toTerminal: TerminalWrite = (line, stream) =>
69
- stream === 'stderr' ? writeErrorLine(line) : writeLine(line);
70
-
71
- const ERROR_LEVELS: ReadonlySet<LogLevel> = new Set(['error', 'fatal']);
72
-
73
63
  /**
74
- * Tee the process logger into `dev.log` until the returned release runs. The terminal keeps the
75
- * lanes core's own writer uses: `--json` (`dispatch.ts`'s `setLogStream('stderr')`) and every
76
- * `error`/`fatal` line on stderr, the rest on stdout — stdout under `--json` is the document.
64
+ * Tee the process logger into `dev.log` until the returned release runs. A TEE, never a redirect:
65
+ * the terminal keeps every line on core's own lanes (`--json` and `error`/`fatal` on stderr), and
66
+ * which lane a level takes stays core's rule alone — this file only adds the copy on disk.
77
67
  */
78
- export function teeDevLog(
79
- stateDir: string,
80
- options: { readonly json: boolean; readonly write?: TerminalWrite },
81
- ): () => void {
68
+ export function teeDevLog(stateDir: string): () => void {
82
69
  const log = openDevLog(stateDir);
83
- const terminal = options.write ?? toTerminal;
84
- const release = installLogSink((line, level) => {
85
- log.write(line);
86
- terminal(line, options.json || ERROR_LEVELS.has(level) ? 'stderr' : 'stdout');
87
- });
70
+ const release = teeLogLines((line) => log.write(line));
88
71
  let released = false;
89
72
  return () => {
90
73
  if (released) return;
package/wiki/Auth.md CHANGED
@@ -257,6 +257,9 @@ const resolveToken = oauthBearerResolver(oauth, { actor: (grant) => actorFor(gra
257
257
  | S256 only; an absent method is `plain` and refused | same |
258
258
  | a code lives 2 minutes, is stored hashed, is single use; a replay revokes what it minted | `authorization-server.test.ts`, `authServerStoreConformance` from `@ultimat3/testing/conformance` (racing redemptions, run on memory and on Postgres by `auth-server-store-conformance-postgres.live.test.ts`) |
259
259
  | refresh rotates; a retired one's replay revokes the grant; idle past `refreshIdleDays` is dead | `authorization-server.test.ts` |
260
+ | refresh tokens only for a client whose `grantTypes` list `refresh_token`; otherwise none is issued and refreshing is `unauthorized_client` (device grant too) | `authorization-server.test.ts`, `authorization-server-postgres.test.ts` |
261
+ | a confidential client authenticates only with its registered `token_endpoint_auth_method`; the other is `invalid_client` | `authorization-server-clients.test.ts` |
262
+ | a redirect URI containing whitespace is refused at registration | `authorization-server-clients.test.ts` |
260
263
  | `resource` (RFC 8707) binds the grant; one not in `resources` is `invalid_target` | `authorization-server-request.test.ts`, `oauth-bearer-resolver.test.ts` |
261
264
  | tokens are opaque and stored hashed, never a JWT, so `revoke` holds on the next lookup | `token-endpoints.test.ts` |
262
265
  | an `https://` `client_id` is a metadata document, fetched through `outbound({ dial: 'public' })`, 5 KiB, cached 5 minutes, public clients only | `authorization-server-clients.test.ts` |
package/wiki/Upgrading.md CHANGED
@@ -212,6 +212,15 @@ A setter still on a package's `.` barrel is `X_ADAPTER_PORT_INCOMPLETE` on the `
212
212
  | `x verify`'s `unit` step runs the app's seeds on the memory driver (**31.6.0**): a seed row the entity refuses — float money, a value its schema rejects — turns `unit` red under the entity's own code, and a seed that throws with no code is `X_SEED_FAILED` | fix the seed row the finding names, as its `fix:` says. Then `x verify --only unit` |
213
213
  | `x verify`'s `errors` step reports `X_ERROR_FIX_INVALID` on an app's own error whose `fix:` defers the edit (a whitespace-delimited `# after <verb>ing …` or `# once <…>ed`), only says re-run, or runs `x g … --force` (**31.6.0**) | rewrite that `fix:` as the edit itself (`edit <path>.<ext>:<line> — <instruction>`) or a command that works on its own, with no `--force` |
214
214
  | every island and `/_x/assets` URL changes once (**31.6.1**): each is now named by a hash of its final bytes, never its sources (#1075) | nothing to do; a CDN in front needs no purge, since new names never collide with old ones |
215
+ | Sentry grouping (**31.7.0**): the default fingerprint is `[code]` (`X_INTERNAL`: `[code, '<fn> <path>']`; `X_CLIENT_ERROR`: `[code, '<pattern>#<island>']`), and `exception.values[0].stacktrace.frames` carries the stack | nothing: each existing issue reopens once under its code's group, and issues split by operation merge. An alert rule keyed on the old hash moves to the `code` tag (source is a tag, operation is the transaction). `extra.stack` stays through 31.x. Custom grouping: `sentryErrorReporter({ fingerprint })` |
216
+ | `pollEvery` / `visibleInterval` back off on failure by default (**31.7.0**): `maxMs` is 8 × `ms` | nothing, unless a poll must keep hitting a failing endpoint at full rate: pass `{ maxMs: <ms> }` equal to `ms` |
217
+ | `requestMemo(ctx)` from `@ultimat3/query` returns `MemoFlights`, not a `Map` (**31.7.0**) | a caller that wrote into it: use `memoFlights(ctx, name)` from `@ultimat3/cache`, or `memoPerRequest(fn, key)` for a plain function |
218
+ | `buildSitemap` / `sitemapUrls` option `now: Date` is deprecated (**31.7.0**) | pass `clock: frozenClock(now)` instead |
219
+ | a compiled web role cropping or compositing a raster above `RASTER_SYNC_PIXELS` where no Worker can start answers `X_IMAGE_RASTER_BUDGET` (503) (**31.7.0**) | move the transform into a `warmVariants` job |
220
+ | the authorization server stops issuing and honouring refresh tokens for a client registered with explicit `grantTypes` that leave out `refresh_token`, e.g. `['authorization_code']` (**31.7.0**): its existing refresh tokens answer `unauthorized_client` | add `'refresh_token'` to that client's `grantTypes` if it should keep them |
221
+ | a confidential client sending its secret by the method it did not register answers `invalid_client` (**31.7.0**) | switch the client to its registered method, or `update x_oauth_clients set auth_method = '<method>' where client_id = '<id>'` |
222
+ | a sealed column no longer enters a history image (**31.7.0**, security): `x verify` reports `X_DB_DRIFT` in every app with `history: true` until it migrates, since the shared `ultimate_record_history` body changed. Rows already written still hold sealed ciphertext | `x db gen "history leaves sealed columns out"`, then `x db migrate`. Then, per history table whose parent has sealed columns: `begin; alter table "<t>_history" disable trigger "ultimate_history_guard"; update "<t>_history" set "before" = "before" - array['<col>', ...], "after" = "after" - array['<col>', ...]; alter table "<t>_history" enable trigger "ultimate_history_guard"; commit;`. If history left the database (exports, admin), treat lookup ciphertext as leaked and rotate the seal key |
223
+ | `.search()` through a non-Postgres search index answers `X_INVARIANT_VIOLATED` when a term matches 10,000 or more rows (**31.7.0**); before, it silently counted and paged only the first 10,000 | narrow the term, or `installSearchIndex(postgresSearchIndex())` |
215
224
 
216
225
  ## 29.x → 30.0.0, entry by entry
217
226